feat: add secure multi-version Valhalla support - #6
Open
trumpyla wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the tap from “JDK 26 EA auto-updates” toward a Valhalla-focused, multi-version packaging model, while preserving the legacy jdk26ea token/paths by repinning it to current OpenJDK 26.0.2 GA archives and removing obsolete EA automation.
Changes:
- Add pinned, source-built Valhalla formulae (
openjdk-valhalla@27,openjdk-valhalla@28) plus a rolling alias and documentation for bottles/source installs and jEnv. - Introduce a manually dispatched bottle build/publish workflow with artifact validation, plus new workflow-security and validator tests.
- Update legacy
jdk26eaformula/cask to OpenJDK 26.0.2 GA URLs/checksums and remove the retired EA update/release workflows.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/workflow_security_test.rb |
Adds CI-enforced workflow security contracts (action pinning, permissions, persisted credentials, bottle immutability checks). |
tests/formula_contract.bats |
Adds a compatibility/contract test for Valhalla formula presence + legacy token invariants. |
tests/bottle_artifact_validator_test.rb |
Adds tests for the bottle artifact validator script and its outputs. |
SECURITY.md |
Rewrites security policy for Valhalla + legacy compatibility scope and workflow/bottle controls. |
scripts/validate-bottle-artifact.rb |
New validator to fail-closed on bottle artifact shape, metadata, filenames, and checksums. |
scripts/update.sh |
Removes obsolete JDK 26 EA auto-update helper script. |
scripts/test.sh |
Extends local validation to run the new Bats compatibility contract and style-check all formulae. |
README.md |
Updates documentation to “Homebrew Valhalla”, describes tokens, install modes, bottles, and jEnv usage. |
Formula/openjdk-valhalla@28.rb |
Adds pinned source-build formula for Valhalla 28 snapshot with smoke test. |
Formula/openjdk-valhalla@27.rb |
Adds pinned source-build formula for Valhalla 27 JEP 401 milestone with smoke test. |
Formula/jdk26ea.rb |
Repins legacy token to OpenJDK 26.0.2+10 GA archives and adjusts test expectation. |
Casks/jdk26ea.rb |
Repins legacy cask to OpenJDK 26.0.2 GA archives while preserving install location/token. |
.github/workflows/validate.yml |
Hardens permissions, disables persisted checkout credentials, and adds lint + security/validator test jobs. |
.github/workflows/update.yml |
Removes obsolete scheduled EA update workflow. |
.github/workflows/release.yml |
Removes obsolete release workflow tied to EA version bumps. |
.github/workflows/bottles.yml |
Adds manual Valhalla bottle build/publish workflow with validation + PR creation. |
.github/workflows/auto-update.yml |
Removes obsolete scheduled EA auto-update workflow. |
.github/workflows/audit.yml |
Extends audit workflow to style/syntax-check all formulae. |
.github/workflows/first-time-contributor.yml |
Updates actions/first-interaction pin to a newer immutable commit. |
ABOUT.md |
New document describing provenance, release model, and migration/compatibility policy. |
Comments suppressed due to low confidence (2)
tests/workflow_security_test.rb:83
- This test enumerates workflow files with YAML.load_file, which is unsafe for untrusted PR content because YAML tags can deserialize objects. Switch to YAML.safe_load_file (and keep aliases disabled) to avoid object injection during CI.
workflow = YAML.load_file(path)
tests/workflow_security_test.rb:56
- If the "Confirm completion" step is missing or renamed, confirm_step will be nil and subsequent assertions will raise NoMethodError. Assert it exists so the test reports a clear failure.
confirm_step = status_job.fetch("steps").find { |step| step["name"] == "Confirm completion" }
| ROOT = File.expand_path("..", __dir__) | ||
|
|
||
| def workflow(name) | ||
| YAML.load_file(File.join(ROOT, ".github", "workflows", name)) |
Comment on lines
+36
to
+37
| release_step = publish.fetch("steps").find { |step| step["name"] == "Publish bottle release" } | ||
| assert_equal "${{ github.token }}", release_step.fetch("env").fetch("GH_TOKEN") |
|
|
||
| jobs: | ||
| validate-syntax: | ||
| runs-on: macos-14 |
| strategy: | ||
| matrix: | ||
| os: [macos-13, macos-14] | ||
| os: [macos-14, macos-15-intel] |
|
|
||
| jobs: | ||
| build: | ||
| runs-on: macos-14 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
openjdk-valhalla@27andopenjdk-valhalla@28source formulae plus a rolling aliasjdk26eaformula and cask tokens and installation locationsSecurity
The bottle build runs with read-only repository access and no persisted checkout credential. The publish job revalidates exact bottle metadata and checksums before receiving a step-scoped write token. Release tags are atomically bound to the dispatched commit and releases are immutable.
Repository policy is configured for read-only default workflow tokens, full-SHA Action references, immutable releases, an app-bound required validation check, review approval, latest-push approval, conversation resolution, and admin enforcement.
Validation
Validation Status: passedgit diff --checkA full OpenJDK Valhalla source build and tier-one test run were not repeated; the previous long-running build was intentionally interrupted.