Skip to content

Commit 2906cf7

Browse files
authored
Merge branch 'main' into update-gh-verification-statuses-enum
2 parents a50790a + 6377342 commit 2906cf7

File tree

3,477 files changed

+175665
-39085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,477 files changed

+175665
-39085
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
<!-- Describe your change here -->
44

55
# Before submitting a PR:
6-
We love getting PRs, but we hate asking people for the same basic changes every time.
76

8-
- [ ] Push your changes to a branch other than `main`. Create your PR from that branch.
9-
- [ ] Add JavaDocs and other comments
10-
- [ ] Write tests that run and pass in CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to capture snapshot data.
7+
- [ ] Changes must not break binary backwards compatibility. If you are unclear on how to make the change you think is needed while maintaining backward compatibility, [CONTRIBUTING.md](CONTRIBUTING.md) for details.
8+
- [ ] Add JavaDocs and other comments as appropriate. Consider including links in comments to relevant documentation on https://docs.github.com/en/rest .
9+
- [ ] Add tests that cover any added or changed code. This generally requires capturing snapshot test data. See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
1110
- [ ] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI.
11+
- [ ] Push your changes to a branch other than `main`. You will create your PR from that branch.
1212

1313
# When creating a PR:
1414

15-
- [ ] Fill in the "Description" above.
15+
- [ ] Fill in the "Description" above with clear summary of the changes. This includes:
16+
- [ ] If this PR fixes one or more issues, include "Fixes #<issue number>" lines for each issue.
17+
- [ ] Provide links to relevant documentation on https://docs.github.com/en/rest where possible.
18+
- [ ] All lines of new code should be covered by tests as reported by code coverage. Any lines that are not covered must have PR comments explaining why they cannot be covered. For example, "Reaching this particular exception is hard and is not a particular common scenario."
1619
- [ ] Enable "Allow edits from maintainers".

.github/dependabot.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "maven"
4-
directory: "/"
5-
schedule:
6-
interval: "monthly"
7-
time: "02:00"
8-
- package-ecosystem: "github-actions"
9-
directory: "/"
10-
schedule:
11-
interval: "monthly"
12-
time: "02:00"
3+
- package-ecosystem: "maven"
4+
directory: "/"
5+
rebase-strategy: "disabled"
6+
schedule:
7+
interval: "monthly"
8+
time: "02:00"
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
rebase-strategy: "disabled"
12+
schedule:
13+
interval: "monthly"
14+
time: "02:00"

.github/workflows/codeql-analysis.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ on:
2020
schedule:
2121
- cron: '20 0 * * 6'
2222

23+
permissions:
24+
contents: read
25+
2326
jobs:
2427
analyze:
28+
permissions:
29+
actions: read # for github/codeql-action/init to get workflow details
30+
contents: read # for actions/checkout to fetch code
31+
security-events: write # for github/codeql-action/autobuild to send a status report
2532
name: Analyze
2633
runs-on: ubuntu-latest
2734

@@ -35,11 +42,11 @@ jobs:
3542

3643
steps:
3744
- name: Checkout repository
38-
uses: actions/checkout@v2
45+
uses: actions/checkout@v3
3946

4047
# Initializes the CodeQL tools for scanning.
4148
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
49+
uses: github/codeql-action/init@v2
4350
with:
4451
languages: ${{ matrix.language }}
4552
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +57,7 @@ jobs:
5057
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5158
# If this step fails, then you should remove it and run the build manually (see below)
5259
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
60+
uses: github/codeql-action/autobuild@v2
5461

5562
# ℹ️ Command-line programs to run using the OS shell.
5663
# 📚 https://git.io/JvXDl
@@ -64,4 +71,4 @@ jobs:
6471
# make release
6572

6673
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
74+
uses: github/codeql-action/analyze@v2

.github/workflows/maven-build.yml

Lines changed: 70 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,121 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '!/refs/heads/dependabot/*'
8+
pull_request:
9+
branches:
10+
- '*'
11+
- '!/refs/heads/patch*'
412

513
# this is required by spotless for JDK 16+
614
env:
715
JAVA_11_PLUS_MAVEN_OPTS: "--add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
816

17+
permissions:
18+
contents: read
19+
920
jobs:
1021
build:
1122
name: build-only (Java ${{ matrix.java }})
1223
runs-on: ubuntu-latest
1324
strategy:
1425
fail-fast: false
1526
matrix:
16-
java: [ 16 ]
27+
java: [ 17 ]
1728
steps:
18-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v3
1930
- name: Set up JDK
20-
uses: actions/setup-java@v2
31+
uses: actions/setup-java@v3
2132
with:
2233
java-version: ${{ matrix.java }}
23-
distribution: 'adopt'
24-
- name: Cached .m2
25-
uses: actions/cache@v2.1.6
26-
with:
27-
path: ~/.m2/repository
28-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
29-
restore-keys: |
30-
${{ runner.os }}-maven-
34+
distribution: 'zulu'
35+
cache: 'maven'
3136
- name: Maven Install (skipTests)
3237
env:
3338
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
34-
run: mvn -B install -DskipTests --file pom.xml
39+
run: mvn -B clean install -DskipTests --file pom.xml
3540
site:
3641
name: site (Java ${{ matrix.java }})
3742
runs-on: ubuntu-latest
3843
strategy:
3944
fail-fast: false
4045
matrix:
41-
java: [ 8, 11 ]
46+
java: [ 17 ]
4247
steps:
43-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v3
4449
- name: Set up JDK
45-
uses: actions/setup-java@v2
50+
uses: actions/setup-java@v3
4651
with:
4752
java-version: ${{ matrix.java }}
4853
distribution: 'adopt'
49-
- uses: actions/cache@v2.1.6
50-
with:
51-
path: ~/.m2/repository
52-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
53-
restore-keys: |
54-
${{ runner.os }}-maven-
54+
cache: 'maven'
5555
- name: Maven Site
56-
run: mvn -B site -D enable-ci --file pom.xml
57-
test:
58-
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
56+
env:
57+
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
58+
run: mvn -B clean site -D enable-ci --file pom.xml
59+
test-8:
60+
name: test (${{ matrix.os }}, Java 8)
5961
runs-on: ${{ matrix.os }}-latest
6062
strategy:
6163
fail-fast: false
6264
matrix:
63-
os: [ ubuntu, windows ]
64-
java: [ 8, 11, 16 ]
65+
os: [ ubuntu ]
66+
java: [ 8 ]
6567
steps:
66-
- uses: actions/checkout@v2
68+
- uses: actions/checkout@v3
6769
- name: Set up JDK
68-
uses: actions/setup-java@v2
70+
uses: actions/setup-java@v3
6971
with:
7072
java-version: ${{ matrix.java }}
71-
distribution: 'adopt'
72-
- uses: actions/cache@v2.1.6
73-
with:
74-
path: ~/.m2/repository
75-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
76-
restore-keys: |
77-
${{ runner.os }}-maven-
73+
distribution: 'zulu'
74+
cache: 'maven'
7875
# JDK 8
79-
- name: Maven Install without Code Coverage
80-
if: matrix.os == 'windows' && matrix.java == '8'
81-
run: mvn -B install --file pom.xml
8276
- name: Maven Install with Code Coverage
83-
if: matrix.os != 'windows' && matrix.java == '8'
84-
run: mvn -B install -D enable-ci --file pom.xml
77+
run: mvn -B clean install -D enable-ci -Djapicmp.skip --file pom.xml
8578
- name: Codecov Report
86-
if: matrix.os != 'windows' && matrix.java == '8'
87-
uses: codecov/codecov-action@v1.5.2
79+
uses: codecov/codecov-action@v3.1.1
80+
test:
81+
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
82+
runs-on: ${{ matrix.os }}-latest
83+
strategy:
84+
fail-fast: false
85+
matrix:
86+
os: [ ubuntu, windows ]
87+
java: [ 11, 17 ]
88+
steps:
89+
- uses: actions/checkout@v3
90+
- name: Set up JDK
91+
uses: actions/setup-java@v3
92+
with:
93+
java-version: ${{ matrix.java }}
94+
distribution: 'zulu'
95+
cache: 'maven'
8896
# JDK 11+
8997
- name: Maven Install without Code Coverage
90-
if: matrix.os == 'windows' && matrix.java != '8'
98+
if: matrix.os == 'windows'
9199
env:
92100
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
93-
run: mvn -B install --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
101+
run: mvn -B clean install -D japicmp.skip=true --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
94102
- name: Maven Install with Code Coverage
95-
if: matrix.os != 'windows' && matrix.java != '8'
103+
if: matrix.os != 'windows'
96104
env:
97105
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
98-
run: mvn -B install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
106+
run: mvn -B clean install -D enable-ci --file pom.xml "-Dsurefire.argLine=--add-opens java.base/java.net=ALL-UNNAMED"
107+
deploy:
108+
name: Deploy
109+
runs-on: ubuntu-latest
110+
needs: [build, test-8, test]
111+
steps:
112+
- uses: actions/checkout@v2
113+
- uses: actions/setup-java@v2
114+
with:
115+
java-version: 8
116+
distribution: 'zulu'
117+
cache: 'maven'
118+
- name: Deploy
119+
run: mvn --batch-mode deploy
120+
env:
121+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-drafter.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ on:
66
branches:
77
- main
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
update_release_draft:
14+
permissions:
15+
contents: write # for release-drafter/release-drafter to create a github release
16+
pull-requests: write # for release-drafter/release-drafter to add label to PR
1117
runs-on: ubuntu-latest
1218
steps:
1319
- name: Release Drafter

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Contributing
22

3+
## Make sure it's spotless
4+
5+
Run `mvn spotless:apply` to fix any formatting, etc issues.
6+
7+
## Make sure you pass CI
8+
9+
If the following does not succeed, you will not pass the pull request checks.
10+
11+
`mvn -D enable-ci clean install site`
12+
313
## Using WireMock and Snapshots
414

515
This project has started converting to using WireMock to stub out http responses instead of use live data.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@
77

88

99
See https://github-api.kohsuke.org/ for more details
10+
11+
To locally publish changes to this API, update the version in `pom.xml` to a unique identifier.
12+
Then run `mvn install -Dmaven.test.skip -Dspotless.check.skip=true -Dgpg.skip -Dmaven.javadoc.skip=true -Djacoco.skip=true -Dspotbugs.skip`.
13+
To use this dependency in `brain-backend`, update the version of `cortexapps-github-api` in `build.gradle.kts (:web)` to the same identifier.
14+
15+
See this [Notion doc](https://www.notion.so/cortexio/How-to-publish-Github-Api-e80324a13abf4497afaa67e0a215e53a) for how to publish this client.

0 commit comments

Comments
 (0)