Verify and rebuild complete transitive lock graphs by nodeselector · Pull Request #214 · github/gh-actions-lock · GitHub
Skip to content

Verify and rebuild complete transitive lock graphs - #214

Merged
nodeselector merged 3 commits into
mainfrom
nodeselector-whole-lock-graph
Oct 21, 2026
Merged

nodeselector merged 3 commits into
mainfrom
nodeselector-whole-lock-graph

Conversation

@nodeselector

@nodeselector nodeselector commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator
  • --verify-local and --verify report a recorded uses: edge with no dependencies entry as an incomplete-lockfile error pointing at gh actions-lock --relock, and a write refuses to leave a workflow's lock graph incomplete.
  • A composite whose manifest the run read gets the edges that manifest has, so stale children go; entries reused unread, or reached by workflows the run doesn't write, keep their recorded edges.
  • --relock and --accept-moved rebuild every selected workflow's closure from live manifests even when no ref moved, leaving recorded roots and uses a composite declares as they are.

Copilot AI max review requested due to automatic review settings October 21, 2026 04:08
@nodeselector
nodeselector requested a review from a team as a code owner October 21, 2026 04:08
@nodeselector
nodeselector added this pull request to stack #216 October 21, 2026 04:14
@nodeselector
nodeselector removed this pull request from stack #216 October 21, 2026 04:15
@nodeselector
nodeselector changed the base branch from nodeselector-transitive-lock-graphs-f92 to main October 21, 2026 04:16

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.

🟡 Changes recommended

Graph rebuilding can remove dependencies still required by composite manifests or unselected workflows.

4 open issues
What changed in this PR

Strengthens transitive dependency graph validation and rebuilding in gh-actions-lock.

Changes:

  • Adds graph-fault checks during verification and before writes.
  • Rebuilds selected closures with --relock and --accept-moved.
  • Updates documentation and regression tests.
File Description
README.md Documents graph validation and rebuilding.
internal/​pipeline/​verify_local_test.go Tests missing transitive entries.
internal/​pipeline/​checks/​structural.go Reports lock graph faults.
internal/​pipeline/​checks/​run.go Runs graph validation.
internal/​pipeline/​checks/​prune.go Updates edge-preservation comments.
internal/​pin/​record.go Tracks unread lockfile entries.
internal/​pin/​plan.go Rebuilds closures and preserves recorded roots.
internal/​pin/​plan_test.go Updates reverse-lookup test arguments.
internal/​pin/​commit.go Rejects incomplete written closures.
internal/​pin/​commit_test.go Tests incomplete-graph write refusal.
internal/​lockfile/​state.go Validates graphs and replaces read edges.
internal/​lockfile/​state_test.go Tests graph faults and edge replacement.
internal/​lockfile/​preview_test.go Tests unread-edge preservation.
internal/​lockfile/​convertor.go Marks lockfile-derived dependencies.
internal/​dep/​dependency.go Preserves provenance during deduplication.
cmd/​gh-actions-lock/​run_test.go Tests CLI graph repair.
cmd/​gh-actions-lock/​parity_test.go Updates rebuild and verification scenarios.

Review effort: Max

Comment thread internal/lockfile/state.go
Comment thread internal/pin/plan.go
Comment thread internal/pipeline/checks/structural.go
Comment thread internal/pipeline/checks/structural.go Outdated
nodeselector and others added 3 commits October 20, 2026 21:39
--verify-local and --verify report a recorded edge with no entry, or a
cycle, as a blocking finding that points at --relock, and a write refuses
to leave a workflow's closure incomplete. Set replaces a composite's uses:
when the run read its manifest and keeps them for entries reused from the
lock, and --relock and --accept-moved rebuild every selected workflow's
closure even when no ref moved.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…kfile

A run's manifest reads cover only the sub-actions it uses, so entries
that workflows the run doesn't write reach keep their recorded edges.
A use a composite also declares keeps its ref, so narrowing can't move
the composite's edge. A missing entry is an incomplete-lockfile finding,
which renderers show with its --relock remediation; the loader already
rejects cycles, so the walker no longer looks for them.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@nodeselector
nodeselector force-pushed the nodeselector-whole-lock-graph branch from cc69e16 to cbacc15 Compare October 21, 2026 04:44
@nodeselector
nodeselector added this pull request to stack #218 October 21, 2026 04:57
@nodeselector
nodeselector merged commit 723eebc into main Oct 21, 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