-
Notifications
You must be signed in to change notification settings - Fork 2
feat(ci): harden the supply chain and build the server once #1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
FelixTJDietrich
wants to merge
11
commits into
main
Choose a base branch
from
ci-supply-chain-best-practices-overhaul
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3b9889d
feat(ci): gate dependency risk and publish supply-chain posture
FelixTJDietrich c0cf926
fix(ci): align supply-chain checks with upstream guidance
FelixTJDietrich 140dbab
refactor(ci): replace security theatre with durable contracts
FelixTJDietrich e9eecc3
perf(ci): scope invalidation to owned workflows
FelixTJDietrich b715b01
fix(deps): automate reproducible supply-chain updates
FelixTJDietrich 89046dc
perf(ci): package the server once and test that artifact everywhere
FelixTJDietrich fb257ac
fix(ci): drop OCI labels from the pack build
FelixTJDietrich 1125581
fix(ci): run the image job beside Test and install the parent pom for…
FelixTJDietrich 75135cc
perf(ci): start the long suites from source and give Maven caches a p…
FelixTJDietrich 45b44bd
fix(ci): grant Build the checks permission its test reporter needs
FelixTJDietrich b044ec1
perf(scripts): skip test compilation when packaging for the OpenAPI spec
FelixTJDietrich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "hephaestus": patch | ||
| --- | ||
|
|
||
| Makes the agent and PostgreSQL images reproducible by installing the agent SDK from a committed lockfile and pinning every supported PostgreSQL base image by digest. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: "Restore the built server" | ||
| description: "Downloads the packaged reactor into server/ and installs its generated-clients JAR, so Maven goals run against the built classes instead of compiling again." | ||
| inputs: | ||
| artifact: | ||
| description: "Name of the reactor artifact uploaded by the package job" | ||
| required: true | ||
| outputs: | ||
| executable-jar: | ||
| description: "Absolute path of the executable application JAR" | ||
| value: ${{ steps.locate.outputs.executable-jar }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| name: ${{ inputs.artifact }} | ||
| path: server | ||
|
|
||
| - name: Install the generated clients and locate the executable JAR | ||
| id: locate | ||
| shell: bash | ||
| working-directory: server | ||
| run: | | ||
| set -euo pipefail | ||
| test -d application/target/classes | ||
| test -d application/target/test-classes | ||
| mapfile -t jars < <(find application/target -maxdepth 1 -name 'hephaestus-application-*.jar') | ||
| mapfile -t clients < <(find generated-clients/target -maxdepth 1 -name 'hephaestus-generated-clients-*.jar') | ||
| (( ${#jars[@]} == 1 )) && (( ${#clients[@]} == 1 )) | ||
| # Single-module goals resolve the sibling from the local repository, not from the reactor; | ||
| # reading its descriptor needs the parent pom there too. | ||
| ./mvnw --batch-mode --quiet -Dmaven.build.cache.enabled=false install:install-file \ | ||
| -Dfile=pom.xml -DpomFile=pom.xml -Dpackaging=pom | ||
| ./mvnw --batch-mode --quiet -Dmaven.build.cache.enabled=false install:install-file \ | ||
| -Dfile="${clients[0]}" -DpomFile=generated-clients/pom.xml | ||
| echo "executable-jar=$PWD/${jars[0]}" >> "$GITHUB_OUTPUT" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
Restore the Maven dependency cache for saving runs that never save it.
The restore step runs only when
save != 'true'. The save step runs only whensave == 'true'and the cache type isapplication-server-reactor. A default-branch push, schedule, or dispatch run with cache typeapplication-server-teststherefore matches neither step and resolves the whole dependency tree from the network.server-apiandserver-databasein.github/workflows/ci-build.ymluse that cache type.♻️ Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents