Conversation
This was referenced Jul 28, 2026
trumpyla
marked this pull request as ready for review
July 28, 2026 22:08
Contributor
There was a problem hiding this comment.
Pull request overview
This PR consolidates this tap into a single canonical distribution point for both official prebuilt Valhalla binaries and pinned source/bottle-built Valhalla snapshots, while hardening CI/workflow security and preserving existing install tokens.
Changes:
- Adds pinned source formulas (
openjdk-valhalla@27,openjdk-valhalla@28) plus a rolling alias and updates user-facing docs to cover both prebuilt and source/bottled installs. - Introduces a split-trust bottle build/publish workflow plus artifact validation tooling and security/contract tests.
- Reworks validation and update automation to use least-privilege permissions, SHA-pinned actions, and fail-closed aggregation; removes the obsolete release workflow.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/workflow_security_test.rb |
Adds workflow security contract tests (permissions, checkout behavior, action pinning, update/bottle trust boundaries). |
tests/parse_valhalla_release_test.rb |
Adds unit tests for strict parsing of the official Valhalla release page. |
tests/formula_contract.bats |
Adds contract tests for formula/cask validity, alias resolution, and source formula pinning. |
tests/documentation_contract.bats |
Adds contract tests to ensure README/SECURITY document the supported tokens and security posture. |
tests/bottle_artifact_validator_test.rb |
Adds unit tests for strict validation of bottle artifacts + JSON metadata. |
SECURITY.md |
Replaces the previous security policy with a tighter, workflow-/supply-chain-focused policy reflecting the new trust model. |
scripts/validate-bottle-artifact.rb |
Adds strict validator for bottle artifact sets and metadata before publication/merge. |
scripts/test.sh |
Expands local test runner to cover all package files, contract tests, and Ruby unit tests. |
scripts/parse-valhalla-release.rb |
Adds strict parser producing validated release metadata for update automation. |
README.md |
Rewrites documentation to explain the prebuilt vs source/bottle matrix and jenv registration. |
Formula/openjdk-valhalla@27.rb |
Adds pinned, macOS ARM64 Sonoma-only source formula for JDK 27 Valhalla milestone. |
Formula/openjdk-valhalla@28.rb |
Adds pinned, macOS ARM64 Sonoma-only source formula for JDK 28 Valhalla snapshot (bottle-capable). |
docs/superpowers/specs/2026-07-28-valhalla-tap-consolidation-design.md |
Adds design spec documenting consolidation goals, trust boundaries, and acceptance criteria. |
docs/superpowers/plans/2026-07-28-legacy-jdk26ea-compatibility-archive.md |
Adds execution plan for legacy jdk26ea compatibility + archival workflow (documentation/operations). |
docs/superpowers/plans/2026-07-28-canonical-valhalla-tap-consolidation.md |
Adds detailed implementation plan for the canonical consolidation (documentation/operations). |
.github/workflows/validate.yml |
Replaces validation with a read-only, fail-closed workflow plus updated install tests and static checks. |
.github/workflows/update.yml |
Splits update into read-only prepare + write-scoped PR creation; adds strict download/checksum verification and exact artifact allowlisting. |
.github/workflows/release.yml |
Removes obsolete release workflow (superseded by bottle publication + updated validation). |
.github/workflows/codeql.yml |
Updates checkout pinning and CodeQL action pinning; tightens permissions. |
.github/workflows/bottles.yml |
Adds split-trust bottle build + publish workflow with anonymous digest verification and PR-based bottle block updates. |
.github/workflows/audit.yml |
Updates audit workflow to be explicitly read-only and SHA-pinned checkout. |
Comments suppressed due to low confidence (1)
tests/workflow_security_test.rb:334
- These tests also use
YAML.load_filewhen iterating over workflow files. This has the same unsafe-deserialization risk as above when run against untrusted PR changes.
def test_every_action_reference_is_an_immutable_commit
action_references = Dir[File.join(ROOT, ".github", "workflows", "*.yml")].flat_map do |path|
document = YAML.load_file(path)
document.fetch("jobs").values.flat_map { |job| job.fetch("steps", []) }
.each_with_object([]) do |step, references|
references << step["uses"] if step["uses"]
end
end
action_references.each do |reference|
assert_match(/\A[^@\s]+@[0-9a-f]{40}\z/, reference)
end
end
def test_every_workflow_declares_permissions_and_safe_checkout
workflow_paths = Dir[File.join(ROOT, ".github", "workflows", "*.yml")]
workflow_paths.each do |path|
document = YAML.load_file(path)
assert document.key?("permissions"), "#{File.basename(path)} has no top-level permissions"
Comment on lines
+35
to
46
| - name: Run Homebrew style and audit | ||
| run: | | ||
| for f in Casks/*.rb; do | ||
| echo "==> Checking $f" | ||
| brew style "$f" | ||
| ruby -c "$f" | ||
| set -Eeuo pipefail | ||
| brew style Casks/*.rb Formula/*.rb | ||
| for formula in Formula/*.rb; do | ||
| token="$(basename "${formula}" .rb)" | ||
| brew audit --formula "artagon/jdkvalhalla/${token}" | ||
| done | ||
| for cask in Casks/*.rb; do | ||
| token="$(basename "${cask}" .rb)" | ||
| brew audit --cask "artagon/jdkvalhalla/${token}" | ||
| done |
Comment on lines
+90
to
98
| test-prebuilt-formula: | ||
| name: Prebuilt formula (${{ matrix.formula }}) | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-22.04 | ||
| arch: x64 | ||
| - os: ubuntu-24.04 | ||
| arch: x64 | ||
| runs-on: ${{ matrix.os }} | ||
| formula: [jdkvalhalla@26, jdkvalhalla@27] | ||
| steps: |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: GT <trumpyla@gmail.com>
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
Consolidates the Valhalla Homebrew packages and build automation in this canonical tap while preserving existing install tokens.
Package matrix
jdkvalhallajdkvalhalla@26,jdkvalhalla@27openjdk-valhalla@27,openjdk-valhalla@28openjdk-valhalla->openjdk-valhalla@28The README includes installation, forced source-build, and versioned
jenvregistration examples.Automation and security
download.java.netand independently verifies every archive checksum.GITHUB_TOKEN.Validation
bats tests/formula_contract.bats tests/documentation_contract.bats— 9/9 passedruby tests/bottle_artifact_validator_test.rb— 11 tests, 28 assertionsruby tests/parse_valhalla_release_test.rb— 4 tests, 12 assertionsruby tests/workflow_security_test.rb— 15 tests, 229 assertionsactionlint .github/workflows/*.yml— passedshellcheck scripts/test.sh tests/*.bats— passedbrew style— 10 files, no offensesbrew audit— all four formulas and the unchanged canonical cask passedgit diff --check origin/main...HEAD— passedA full Valhalla source build was intentionally not run; CI builds bottles from the pinned source formulas.
Superseded PR mapping
peter-evans/create-pull-requestpin incorporated here.actions/cachepin incorporated here.actions/checkoutpin incorporated here.Owner follow-up
On the first bottle publication, GHCR may create the package as private. If anonymous verification stops the workflow, make the package public and rerun it; subsequent publication remains checksum-bound and token-free for verification.