Skip to content

Commit e6192de

Browse files
committed
Merge branch 'master' into RBT-928-pass-through-jakarta-annotations-try-2
# Conflicts: # graphql-builder/pom.xml # graphql-builder/src/test/java/com/phocassoftware/graphql/builder/DirectiveTest.java
2 parents 0debef3 + 2d71f77 commit e6192de

File tree

15 files changed

+293
-131
lines changed

15 files changed

+293
-131
lines changed

.github/workflows/release.yml

Lines changed: 91 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,123 @@
11
name: Release
2+
23
permissions:
34
contents: write
4-
on: workflow_dispatch
5+
packages: write
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
releaseType:
11+
type: choice
12+
description: "Release type"
13+
required: true
14+
default: minor
15+
options:
16+
- patch
17+
- minor
18+
- major
19+
520
jobs:
621
release:
722
runs-on: ubuntu-latest
823
steps:
9-
- uses: actions/checkout@v4
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
1026

11-
- uses: actions/cache@v4
27+
- name: Setup cache
28+
uses: actions/cache@v4
1229
with:
1330
path: ~/.m2/repository
1431
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
1532
restore-keys: |
1633
${{ runner.os }}-maven-
17-
- name: Set up JDK 21
34+
35+
- name: Setup JDK 21
1836
uses: actions/setup-java@v4
1937
with:
2038
java-version: 21
2139
distribution: zulu
22-
- uses: whelk-io/maven-settings-xml-action@v22
40+
cache: maven
41+
42+
- name: Setup Maven
43+
uses: whelk-io/maven-settings-xml-action@v22
2344
with:
2445
servers: >
2546
[
2647
{ "id": "central", "username": "${{ secrets.MAVEN_CENTRAL_TOKEN_USER }}", "password": "${{ secrets.MAVEN_CENTRAL_TOKEN_PASS }}" }
2748
]
2849
29-
- run: git config --global user.name phocasadmin; git config --global user.email [email protected]
50+
- name: Get current development version
51+
id: get_version
52+
run: |
53+
VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout | sed 's/-SNAPSHOT//' )
54+
echo "version=$VERSION" >> $GITHUB_OUTPUT
55+
56+
- name: Generate versions
57+
id: generate_versions
58+
uses: WyriHaximus/[email protected]
59+
with:
60+
version: ${{ steps.get_version.outputs.version }}
3061

31-
- name: add key
62+
- name: Pick release version
63+
id: pick_release_version
64+
run: |
65+
VERSION=$(
66+
case ${{ github.event.inputs.releaseType }} in
67+
("minor") echo "${{ steps.generate_versions.outputs.minor }}" ;;
68+
("major") echo "${{ steps.generate_versions.outputs.major }}" ;;
69+
("patch") echo "${{ steps.generate_versions.outputs.patch }}" ;;
70+
esac
71+
)
72+
echo "version=$VERSION" >> $GITHUB_OUTPUT
73+
74+
- name: Setup Git
75+
run: |
76+
git config --global user.name phocasadmin;
77+
git config --global user.email [email protected]
78+
79+
- name: Setup key
3280
run: |
3381
echo "${{ secrets.MAVEN_PRIVATE_KEY }}" | base64 -d > private.key
3482
gpg --batch --import ./private.key
3583
rm ./private.key
3684
gpg --list-secret-keys --keyid-format LONG
3785
38-
- name: prepare
86+
- name: Maven prepare release
3987
run: |
40-
mvn release:prepare -Dusername=${{ secrets.GITHUB_TOKEN }} -P sonatype -DscmForceUpdate=true
41-
- name: release
88+
mvn release:prepare -DreleaseVersion=${release_version} \
89+
-DdevelopmentVersion=${release_version}-SNAPSHOT \
90+
-Dusername=${{ secrets.GITHUB_TOKEN }} \
91+
-P sonatype -DscmForceUpdate=true
92+
env:
93+
release_version: ${{ steps.pick_release_version.outputs.version }}
94+
95+
- name: Maven perform release
96+
run: |
97+
mvn release:perform -DreleaseVersion=${release_version} \
98+
-DdevelopmentVersion=${release_version}-SNAPSHOT \
99+
-Dusername=${{ secrets.GITHUB_TOKEN }} \
100+
-Darguments="-DskipTests" \
101+
-P sonatype -DscmForceUpdate=true
102+
env:
103+
release_version: ${{ steps.pick_release_version.outputs.version }}
104+
105+
- name: Create GitHub release
42106
run: |
43-
mvn release:perform -Dusername=${{ secrets.GITHUB_TOKEN }} -P sonatype -DscmForceUpdate=true
107+
repo_name="${GITHUB_REPOSITORY#*/}"
108+
prior_release_tag=$(git tag --list "${repo_name}-*" --sort=-creatordate | sed -n '2p')
109+
if [ -z "$prior_release_tag" ]; then
110+
gh release create "${repo_name}-${release_version}" \
111+
--repo="$GITHUB_REPOSITORY" \
112+
--title="${release_version}" \
113+
--generate-notes
114+
else
115+
gh release create "${repo_name}-${release_version}" \
116+
--repo="$GITHUB_REPOSITORY" \
117+
--title="${release_version}" \
118+
--generate-notes \
119+
--notes-start-tag "${prior_release_tag}"
120+
fi
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
release_version: ${{ steps.pick_release_version.outputs.version }}

graphql-builder/pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
<name>graphql-builder</name>
1818
<description>Builds a graphql schema from a model using reflection</description>
1919

20-
<parent>
21-
<groupId>com.phocassoftware</groupId>
22-
<artifactId>graphql-builder-parent</artifactId>
23-
<version>1.0.10-SNAPSHOT</version>
24-
</parent>
20+
<parent>
21+
<groupId>com.phocassoftware</groupId>
22+
<artifactId>graphql-builder-parent</artifactId>
23+
<version>1.1.0-SNAPSHOT</version>
24+
</parent>
2525

2626
<artifactId>graphql-builder</artifactId>
2727

28-
<properties>
29-
<junit.jupiter.version>5.12.1</junit.jupiter.version>
30-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31-
<jackson.version>2.18.3</jackson.version>
32-
<graphql.version>22.3</graphql.version>
33-
</properties>
28+
<properties>
29+
<junit.jupiter.version>5.12.2</junit.jupiter.version>
30+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31+
<jackson.version>2.19.0</jackson.version>
32+
<graphql.version>24.0</graphql.version>
33+
</properties>
3434

3535
<licenses>
3636
<license>

graphql-builder/src/test/java/com/phocassoftware/graphql/builder/DirectiveTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void testDirectiveArgumentDefinition() {
8989
List<LinkedHashMap<String, Object>> dir = (List<LinkedHashMap<String, Object>>) ((Map<String, Object>) response.get("__schema")).get("directives");
9090
LinkedHashMap<String, Object> input = dir.stream().filter(map -> map.get("name").equals("Input")).collect(Collectors.toList()).get(0);
9191

92-
assertEquals(30, dir.size());
92+
assertEquals(32, dir.size());
9393
assertEquals("ARGUMENT_DEFINITION", ((List<String>) input.get("locations")).get(0));
9494
assertEquals(1, ((List<Object>) input.get("args")).size());
9595
// getNickname(nickName: String! @Input(value : "TT")): String!

graphql-builder/src/test/java/com/phocassoftware/graphql/builder/JakartaValidationDirectiveTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void testJakartaSizeDirectiveArgumentDefinition() {
4242
List<LinkedHashMap<String, Object>> dir = (List<LinkedHashMap<String, Object>>) ((Map<String, Object>) response.get("__schema")).get("directives");
4343
LinkedHashMap<String, Object> constraint = dir.stream().filter(map -> map.get("name").equals("Size")).collect(Collectors.toList()).get(0);
4444

45-
assertEquals(30, dir.size());
45+
assertEquals(32, dir.size());
4646
assertEquals("ARGUMENT_DEFINITION", ((List<String>) constraint.get("locations")).get(0));
4747
assertEquals("INPUT_FIELD_DEFINITION", ((List<String>) constraint.get("locations")).get(1));
4848
assertEquals(5, ((List<Object>) constraint.get("args")).size());

graphql-database-dynmodb-history-lambda/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<groupId>com.phocassoftware</groupId>
2020
<artifactId>graphql-builder-parent</artifactId>
21-
<version>1.0.10-SNAPSHOT</version>
21+
<version>1.1.0-SNAPSHOT</version>
2222
</parent>
2323

2424
<artifactId>graphql-database-dynmodb-history-lambda</artifactId>

graphql-database-manager-core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
<parent>
1919
<groupId>com.phocassoftware</groupId>
2020
<artifactId>graphql-builder-parent</artifactId>
21-
<version>1.0.10-SNAPSHOT</version>
21+
<version>1.1.0-SNAPSHOT</version>
2222
</parent>
2323

2424
<artifactId>graphql-database-manager-core</artifactId>
2525

2626
<properties>
27-
<junit.jupiter.version>5.12.1</junit.jupiter.version>
27+
<junit.jupiter.version>5.12.2</junit.jupiter.version>
2828
</properties>
2929

3030

graphql-database-manager-core/src/main/java/com/phocassoftware/graphql/database/manager/Database.java

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.util.stream.Collectors;
3434
import java.util.stream.Stream;
3535
import org.dataloader.DataLoader;
36+
import org.dataloader.DataLoaderFactory;
3637
import org.dataloader.DataLoaderOptions;
3738

3839
@SuppressWarnings("unchecked")
@@ -59,32 +60,29 @@ public class Database {
5960
this.submitted = new AtomicInteger();
6061

6162
items = new TableDataLoader<>(
62-
new DataLoader<DatabaseKey<Table>, Table>(
63-
keys -> {
64-
return driver.get(keys);
65-
},
66-
DataLoaderOptions.newOptions().setMaxBatchSize(driver.maxBatchSize())
67-
),
63+
DataLoaderFactory
64+
.newDataLoader(
65+
driver::get,
66+
DataLoaderOptions.newOptions().setMaxBatchSize(driver.maxBatchSize()).build()
67+
),
6868
this::handleFuture
6969
); // will auto call global
7070

7171
queries = new TableDataLoader<>(
72-
new DataLoader<DatabaseQueryKey<Table>, List<Table>>(
73-
keys -> {
74-
return merge(keys.stream().map(driver::query));
75-
},
76-
DataLoaderOptions.newOptions().setBatchingEnabled(false)
77-
),
72+
DataLoaderFactory
73+
.newDataLoader(
74+
keys -> merge(keys.stream().map(driver::query)),
75+
DataLoaderOptions.newOptions().setBatchingEnabled(false).build()
76+
),
7877
this::handleFuture
7978
); // will auto call global
8079

8180
queryHistories = new TableDataLoader<>(
82-
new DataLoader<DatabaseQueryHistoryKey<Table>, List<Table>>(
83-
keys -> {
84-
return merge(keys.stream().map(driver::queryHistory));
85-
},
86-
DataLoaderOptions.newOptions().setBatchingEnabled(false)
87-
),
81+
DataLoaderFactory
82+
.newDataLoader(
83+
keys -> merge(keys.stream().map(driver::queryHistory)),
84+
DataLoaderOptions.newOptions().setBatchingEnabled(false).build()
85+
),
8886
this::handleFuture
8987
); // will auto call global
9088

graphql-database-manager-dynamo/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
<parent>
1919
<groupId>com.phocassoftware</groupId>
2020
<artifactId>graphql-builder-parent</artifactId>
21-
<version>1.0.10-SNAPSHOT</version>
21+
<version>1.1.0-SNAPSHOT</version>
2222
</parent>
2323

2424
<artifactId>graphql-database-manager-dynamo</artifactId>
2525

2626
<properties>
27-
<junit.jupiter.version>5.12.1</junit.jupiter.version>
27+
<junit.jupiter.version>5.12.2</junit.jupiter.version>
2828
</properties>
2929

3030
<licenses>
@@ -44,7 +44,7 @@
4444
<dependency>
4545
<groupId>com.google.guava</groupId>
4646
<artifactId>guava</artifactId>
47-
<version>33.4.0-jre</version>
47+
<version>33.4.8-jre</version>
4848
</dependency>
4949
<dependency>
5050
<groupId>software.amazon.awssdk</groupId>

graphql-database-manager-dynamo/src/main/java/com/phocassoftware/graphql/database/manager/dynamo/DynamoDb.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -551,10 +551,6 @@ public <T extends Table> CompletableFuture<List<T>> getViaLinks(
551551
Class<T> type,
552552
TableDataLoader<DatabaseKey<Table>> items
553553
) {
554-
if (getExtractor(entry.getClass()).isPresent() || getExtractor(type).isPresent()) {
555-
throw new UnsupportedOperationException("hashed objects can not be linked");
556-
}
557-
558554
String tableTarget = table(type);
559555
var links = getLinks(entry).get(tableTarget);
560556
if (links == null) {
@@ -1289,10 +1285,6 @@ private <T extends Table> CompletableFuture<T> updateEntityLinks(
12891285

12901286
@Override
12911287
public <T extends Table> CompletableFuture<T> link(String organisationId, T entity, Class<? extends Table> class1, List<String> groupIds) {
1292-
if (getExtractor(entity.getClass()).isPresent() || getExtractor(class1).isPresent()) {
1293-
throw new UnsupportedOperationException("hashed objects can not be linked");
1294-
}
1295-
12961288
var source = table(entity.getClass());
12971289

12981290
var target = table(class1);
@@ -1333,10 +1325,6 @@ public <T extends Table> CompletableFuture<T> unlink(
13331325
final Class<? extends Table> clazz,
13341326
final String targetId
13351327
) {
1336-
if (getExtractor(entity.getClass()).isPresent() || getExtractor(clazz).isPresent()) {
1337-
throw new UnsupportedOperationException("hashed objects can not be linked");
1338-
}
1339-
13401328
final var updateEntityLinksRequest = createRemoveLinkRequest(organisationId, entity, clazz, targetId);
13411329

13421330
return client
@@ -1394,9 +1382,6 @@ public <T extends Table> CompletableFuture<T> deleteLinks(String organisationId,
13941382
if (getLinks(entity).isEmpty()) {
13951383
return CompletableFuture.completedFuture(entity);
13961384
}
1397-
if (getExtractor(entity.getClass()).isPresent()) {
1398-
throw new UnsupportedOperationException("hashed objects can not be linked");
1399-
}
14001385

14011386
var organisationIdAttribute = AttributeValue.builder().s(organisationId).build();
14021387
var id = AttributeValue.builder().s(table(entity.getClass()) + ":" + entity.getId()).build();

graphql-database-manager-memory/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
<parent>
2121
<groupId>com.phocassoftware</groupId>
2222
<artifactId>graphql-builder-parent</artifactId>
23-
<version>1.0.9</version>
23+
<version>1.1.0</version>
2424
</parent>
2525

2626
<artifactId>graphql-database-manager-memory</artifactId>
2727

2828
<properties>
29-
<junit.jupiter.version>5.12.1</junit.jupiter.version>
29+
<junit.jupiter.version>5.12.2</junit.jupiter.version>
3030
</properties>
3131

3232

0 commit comments

Comments
 (0)