Skip to content

Commit bc648f4

Browse files
authored
Merge branch 'hub4j:main' into ready-for-review-graphql
2 parents f73fbae + f748642 commit bc648f4

6 files changed

Lines changed: 42 additions & 12 deletions

File tree

.github/workflows/create_release_tag_and_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
mvn -B versions:set versions:commit -DremoveSnapshot
3636
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
3737
38-
- uses: stefanzweifel/git-auto-commit-action@v6
38+
- uses: stefanzweifel/git-auto-commit-action@v7
3939
with:
4040
commit_message: "Prepare release (${{ github.actor }}): github-api-${{ steps.release.outputs.version }}"
4141
tagging_message: 'github-api-${{ steps.release.outputs.version }}'
@@ -45,7 +45,7 @@ jobs:
4545
run: |
4646
mvn versions:set versions:commit -DnextSnapshot
4747
48-
- uses: stefanzweifel/git-auto-commit-action@v6
48+
- uses: stefanzweifel/git-auto-commit-action@v7
4949
with:
5050
commit_message: "Prepare for next development iteration"
5151
branch: staging/${{ github.ref_name }}

.github/workflows/maven-build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
env:
3737
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
3838
run: mvn -B clean install -DskipTests --file pom.xml
39-
- uses: actions/upload-artifact@v5
39+
- uses: actions/upload-artifact@v6
4040
with:
4141
name: maven-target-directory
4242
path: target/
@@ -110,7 +110,7 @@ jobs:
110110
run: mvn -B clean install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
111111
- name: Save coverage data
112112
if: matrix.os == 'ubuntu' && matrix.java == '17'
113-
uses: actions/upload-artifact@v5
113+
uses: actions/upload-artifact@v6
114114
with:
115115
name: maven-test-target-directory
116116
path: target/
@@ -121,12 +121,12 @@ jobs:
121121
runs-on: ubuntu-latest
122122
steps:
123123
- uses: actions/checkout@v6
124-
- uses: actions/download-artifact@v6
124+
- uses: actions/download-artifact@v7
125125
with:
126126
name: maven-test-target-directory
127127
path: target
128128
- name: Codecov Report
129-
uses: codecov/codecov-action@v5.5.1
129+
uses: codecov/codecov-action@v5.5.2
130130
with:
131131
# Codecov token from https://app.codecov.io/gh/hub4j/github-api/settings
132132
token: ${{ secrets.CODECOV_TOKEN }}
@@ -139,7 +139,7 @@ jobs:
139139
runs-on: ubuntu-latest
140140
steps:
141141
- uses: actions/checkout@v6
142-
- uses: actions/download-artifact@v6
142+
- uses: actions/download-artifact@v7
143143
with:
144144
name: maven-target-directory
145145
path: target

.github/workflows/publish_release_branch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
2626
run: mvn -B clean install site -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
2727

28-
- uses: actions/upload-artifact@v5
28+
- uses: actions/upload-artifact@v6
2929
with:
3030
name: maven-release-target-directory
3131
path: target/
@@ -78,7 +78,7 @@ jobs:
7878
run: |
7979
echo "version=$(mvn -B help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
8080
81-
- uses: actions/download-artifact@v6
81+
- uses: actions/download-artifact@v7
8282
with:
8383
name: maven-release-target-directory
8484
path: target
@@ -90,7 +90,7 @@ jobs:
9090
cp -r ./target/site/* ./
9191
9292
- name: Publish GH Pages
93-
uses: stefanzweifel/git-auto-commit-action@v6
93+
uses: stefanzweifel/git-auto-commit-action@v7
9494
with:
9595
commit_message: "Release (${{ github.actor }}): v${{ steps.release.outputs.version }}"
9696
branch: gh-pages

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<jacoco.haltOnFailure>false</jacoco.haltOnFailure>
7272

7373
<jacoco.surefire.argLine></jacoco.surefire.argLine>
74-
<jjwt.suite.version>0.12.6</jjwt.suite.version>
74+
<jjwt.suite.version>0.13.0</jjwt.suite.version>
7575
<!-- This project was registered before 2021, so it uses the old server. -->
7676
<nexus.serverUrl>https://ossrh-staging-api.central.sonatype.com</nexus.serverUrl>
7777
<okhttp3.version>4.12.0</okhttp3.version>
@@ -268,7 +268,7 @@
268268
<dependency>
269269
<groupId>org.mockito</groupId>
270270
<artifactId>mockito-core</artifactId>
271-
<version>5.20.0</version>
271+
<version>5.21.0</version>
272272
<scope>test</scope>
273273
</dependency>
274274
<!--

src/main/java/org/kohsuke/github/GitHub.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,7 @@ protected GHUser getUser(GHUser orig) {
12851285
@Nonnull
12861286
Requester createGraphQLRequest(String query) {
12871287
return createRequest().method("POST")
1288+
.withApiUrl(getApiUrl().replace("/api/v3", "/api"))
12881289
.rateLimit(RateLimitTarget.GRAPHQL)
12891290
.with("query", query)
12901291
.withUrlPath("/graphql");

src/test/java/org/kohsuke/github/GitHubConnectionTest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,35 @@ public void testGitHubBuilderFromEnvironment() throws IOException {
207207

208208
}
209209

210+
/**
211+
* Test that GitHub.com GraphQL URL is correctly constructed.
212+
*
213+
* @throws Exception
214+
* the exception
215+
*/
216+
@Test
217+
public void testGitHubCloudGraphQLUrl() throws Exception {
218+
GitHub hub = GitHub.connect("bogus", "bogus");
219+
GitHubRequest request = hub.createGraphQLRequest("test query").build();
220+
assertThat(request.url().toString(), equalTo("https://api.github.com/graphql"));
221+
}
222+
223+
/**
224+
* Test that GitHub Enterprise GraphQL URL is correctly constructed.
225+
* <p>
226+
* GitHub Enterprise Server has REST API at /api/v3 but GraphQL at /api/graphql.
227+
* </p>
228+
*
229+
* @throws Exception
230+
* the exception
231+
*/
232+
@Test
233+
public void testGitHubEnterpriseGraphQLUrl() throws Exception {
234+
GitHub hub = GitHub.connectToEnterpriseWithOAuth("https://enterprise.kohsuke.org/api/v3", "bogus", "bogus");
235+
GitHubRequest request = hub.createGraphQLRequest("test query").build();
236+
assertThat(request.url().toString(), equalTo("https://enterprise.kohsuke.org/api/graphql"));
237+
}
238+
210239
/**
211240
* Test git hub is api url valid.
212241
*

0 commit comments

Comments
 (0)