Skip to content

Check mutable-ref pins against ref history under --verify - #156

Merged
nodeselector merged 4 commits into
mainfrom
nodeselector-prerc-5-verify-ref-history
Oct 11, 2026
Merged

nodeselector merged 4 commits into
mainfrom
nodeselector-prerc-5-verify-ref-history

Conversation

@nodeselector

@nodeselector nodeselector commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

--verify now rejects a locked mutable ref that the runner would reject: one that no longer exists, or whose recorded commit isn't in the ref's history. Refs stay case-sensitive, because the runner treats them that way.


Part 5 of 6 (#152 → #157). Previous: #155 Next: #157

@nodeselector
nodeselector marked this pull request as ready for review October 11, 2026 22:40
@nodeselector
nodeselector requested a review from a team as a code owner October 11, 2026 22:40
Copilot AI balanced review requested due to automatic review settings October 11, 2026 22:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation consistently handles GraphQL and REST paths with comprehensive command-level coverage.

0 open findings

What changed in this PR

Extends --verify to validate mutable-ref pins against current upstream history while preserving case-sensitive refs.

Changes:

  • Resolves mutable-ref heads and verifies locked commit ancestry.
  • Reports deleted refs with tailored remediation and terminal output.
  • Adds GraphQL/REST and command-level coverage.
File Description
README.md Documents verification behavior.
internal/​pipeline/​run.go Passes verify mode into parity checks.
internal/​pipeline/​parity.go Validates mutable-ref existence and ancestry.
internal/​pipeline/​checks/​finding.go Expands missing-ref semantics.
internal/​ghapi/​repos.go Supports REST-only comparisons.
internal/​ghapi/​graphql_parity.go Resolves mutable-ref heads.
cmd/​gh-actions-lock/​run.go Wires and documents verify mode.
cmd/​gh-actions-lock/​parity_test.go Tests ancestry, deletion, and ref casing.
cmd/​gh-actions-lock/​format/​terminal.go Tailors missing-ref presentation.
cmd/​gh-actions-lock/​command_test.go Updates parity response fixtures.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nodeselector
nodeselector force-pushed the nodeselector-prerc-5-verify-ref-history branch from 0ec8bfb to d06f9c0 Compare October 11, 2026 22:53
@nodeselector
nodeselector force-pushed the nodeselector-prerc-4-repo-replaced branch 2 times, most recently from 59ce200 to e53095c Compare October 11, 2026 23:20
Commits from a fork network are reachable under the upstream repo name,
so a hand-edited actions.lock can lock a branch or partial-version ref to
a commit that was never in that ref's history. Since #145 nothing caught
this on --verify.

--verify now resolves the ref head inside the batched parity query (or
REST under the Dependabot proxy). When the head differs from the locked
commit, one Compare call decides: not an ancestor is unreachable-pin,
inconclusive is a warning (exit 2 under the proxy). Plain runs make no
extra calls.
The runner keys refs case-sensitively, so @main and @main are different
refs and each needs its own --verify history check.
The runner rejects a pin whose ref doesn't resolve, so a missing branch
or partial-version ref is unreachable-pin, not a pass. A failed lookup
stays on the inconclusive path.
A locked branch or partial-version ref that no longer exists read as
"Pinned commit not in upstream history" with release and hardening
links, which describes an impostor commit. It now reads "Ref no longer
exists" with only the remediation, and omits doc_url in JSON. The
category stays unreachable-pin.
@nodeselector
nodeselector changed the base branch from nodeselector-prerc-4-repo-replaced to main October 11, 2026 23:23
@nodeselector
nodeselector force-pushed the nodeselector-prerc-5-verify-ref-history branch from d06f9c0 to 3b7dcb1 Compare October 11, 2026 23:23
@nodeselector
nodeselector merged commit f0e80cd into main Oct 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants