Skip to content

Don't count about-to-be-pinned workflows as failed#86

Open
nodeselector wants to merge 2 commits into
mainfrom
nodeselector-issue-802-summary-miscount
Open

Don't count about-to-be-pinned workflows as failed#86
nodeselector wants to merge 2 commits into
mainfrom
nodeselector-issue-802-summary-miscount

Conversation

@nodeselector

Copy link
Copy Markdown
Collaborator

What

The pre-remediation summary line counted workflows that this run is about to pin as failures. A plain onboarding run (everything unpinned) shouted:

N of N workflows failed: N not-pinned

even though nothing had actually failed — the run was in the middle of pinning those very workflows.

Why

PresentResults in cmd/gh-actions-lock/format/terminal.go computed its failed count by treating every workflow where !IsValid() as failed. A dep-level NotPinned finding makes a workflow !IsValid(), so about-to-be-pinned workflows landed in the "failed" bucket.

Fix (rendering-only)

  • Add isRemediableOnly(wr, willRemediate): true when the run will remediate and every non-valid finding in the workflow is NotPinned.
  • Exclude remediable-only workflows from failedCount, gate the error block on failedCount > 0, and drop not-pinned from the error parts when remediating.
  • Read-only / verify surfaces (willRemediate == false) still count not-pinned as a genuine coverage gap — unchanged.

Confined to the terminal renderer and its test. Finding classification (checks categories, IsValid, NeedsAttention, diagnose.go) is untouched.

Tests

terminal_test.go covers: pure onboarding emits no failed line; a genuine failure alongside an onboarding workflow reports 1 of 2 workflows failed without not-pinned; read-only still counts not-pinned as a gap.

Resolves github/actions-dispatch#802

The pre-remediation summary computed its failed count by treating every
workflow where !IsValid() as a failure. A workflow whose only non-valid
finding is a dep-level NotPinned is exactly what the current run is about
to pin, so a plain onboarding run reported "N of N workflows failed:
N not-pinned" for work it was actively doing.

Exclude remediable-only workflows (willRemediate and every non-valid
finding is NotPinned) from the failed count, gate the error block on a
non-zero failed count, and drop not-pinned from the error parts when
remediating. Read-only and verify surfaces (willRemediate=false) still
count not-pinned as a genuine coverage gap.

Confined to the terminal renderer and its test; finding classification
(checks/IsValid/NeedsAttention) is unchanged.

Resolves github/actions-dispatch#802
Copilot AI review requested due to automatic review settings July 13, 2026 22:01
@nodeselector
nodeselector requested a review from a team as a code owner July 13, 2026 22:01

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.

⚠️ Not ready to approve

The new “remediable-only” logic can incorrectly suppress real failures because NotPinned is also used for non-remediable workflow errors (e.g., load/deps errors), and the current exclusion logic can hide the only failure reason.

Pull request overview

Adjusts the terminal renderer’s failure summary so workflows that are about to be auto-pinned (dep-level not-pinned) don’t get reported as “failed” during a remediation run, avoiding misleading onboarding output.

Changes:

  • Adds isRemediableOnly to detect workflows that are only failing due to dep-level NotPinned when willRemediate is true.
  • Updates PresentResults to exclude remediable-only workflows from failedCount, and to conditionally suppress not-pinned in the error summary during remediation.
  • Adds a focused regression test covering onboarding-only output vs mixed failures vs read-only behavior.
File summaries
File Description
cmd/gh-actions-lock/format/terminal.go Refines “failed workflows” counting and error-summary rendering to treat about-to-be-pinned workflows as remediable (not failed).
cmd/gh-actions-lock/format/terminal_test.go Adds regression coverage for remediation vs read-only summary output around not-pinned.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Low

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/gh-actions-lock/format/terminal.go
Comment thread cmd/gh-actions-lock/format/terminal.go
Comment thread cmd/gh-actions-lock/format/terminal_test.go
The #802 remediable-only logic treated any workflow whose only invalid
finding was not-pinned as "about to be pinned", but diagnose.go also
reports fatal workflow load / deps-read failures as workflow-level
not-pinned (SeverityError, no ActionRef). Those are not remediable, so
suppressing them let a genuinely broken workflow drop out of the failed
count, and the unconditional not-pinned exclusion could blank out the
only reason in the summary line.

Restrict remediable-only to dep-level not-pinned (non-nil ActionRef), and
exclude not-pinned from the summary only when another category already
explains a failure. Update the regression test to model dep-level
not-pinned at its production SeverityError and add fatal-load-error cases.

Adds a catalog scenario asserting a fresh multi-workflow pin run does not
report "N of N workflows failed".
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