lint: let allowed-labels skip boolean safe-output handlers (fixes main Go CI) by SivaKesava1 · Pull Request #70787 · github/gh-aw · GitHub
Skip to content

lint: let allowed-labels skip boolean safe-output handlers (fixes main Go CI) - #70787

Merged
SivaKesava1 merged 2 commits into
mainfrom
sivakesava1/lint-allowed-labels-boolean-handler
Oct 21, 2026
Merged

SivaKesava1 merged 2 commits into
mainfrom
sivakesava1/lint-allowed-labels-boolean-handler

Conversation

@SivaKesava1

Copy link
Copy Markdown
Collaborator

main's Go CI has failed since #70671 merged (15d31e5375, 03:07 UTC):

TestRepositoryAgenticWorkflows/smoke-claude-sub-agents.lock.yml
lint rule allowed-labels: AST policy lint requires a mapping at safe-outputs.create-issue

(For example, CGO run 39546336838. The same failure shows in open PRs' impacted-go-tests.)

Cause: smoke-claude-sub-agents.md uses safe-outputs.create-issue: false to stay read-only. That's valid frontmatter: the compiler sets CreateIssuesDisabled and skips default issue creation. The allowed-labels rule (pkg/workflow/lint/output_policy.go) passes every handler value to policyMapping, which accepts only a mapping or null. It's the only workflow with a top-level create-issue: false; the others nest it under missing-tool.

Fix: skip a boolean handler value, which has no allowed-labels to check. Strings and numbers are still reported as malformed (TestAdditionalPolicyMalformedInputs is unchanged and passes).

Tests:

  • New TestAllowedLabelsRuleSkipsBooleanHandlers: true or false on each of the four handlers raises no error, and another handler's wildcard is still reported.
  • go test ./pkg/workflow/lint/ passes. Without the fix, TestRepositoryAgenticWorkflows fails on main; with it, it passes.

`safe-outputs.create-issue: false` is valid frontmatter: it disables the
handler and stops default issue creation. smoke-claude-sub-agents (#70671)
uses it to stay read-only. The allowed-labels rule passed the value to
policyMapping, which accepts only a mapping, so the repository lint test
TestRepositoryAgenticWorkflows/smoke-claude-sub-agents.lock.yml fails on
main ("AST policy lint requires a mapping at safe-outputs.create-issue").

A boolean handler has no allowed-labels to check, so skip it. Other
non-mapping values (strings, numbers) are still reported as malformed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI max review requested due to automatic review settings October 21, 2026 05:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The narrow fix preserves other handlers’ label checks and includes focused regression coverage.

No open issues 🎉

What changed in this PR

Restores Go CI by letting the allowed-labels lint rule skip boolean safe-output handler values.

Changes:

  • Skip booleans before mapping validation.
  • Add coverage for all four handlers while verifying wildcard detection continues.
File Description
pkg/​workflow/​lint/​output_policy.go Adds the boolean-value guard.
pkg/​workflow/​lint/​policy_conversions_test.go Adds boolean-handler regression coverage.

Review effort: Max

@SivaKesava1

Copy link
Copy Markdown
Collaborator Author

@SivaKesava1
SivaKesava1 merged commit a4e4e5c into main Oct 21, 2026
36 checks passed
@SivaKesava1
SivaKesava1 deleted the sivakesava1/lint-allowed-labels-boolean-handler branch October 21, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants