Skip to content

[yamllint-fixer] fix(workflow): eliminate yamllint comments-indentation noise in generated lock files#45879

Merged
pelikhan merged 8 commits into
mainfrom
fix/yamllint-on-section-comments-indentation-696223561d8ee625
Jul 16, 2026
Merged

[yamllint-fixer] fix(workflow): eliminate yamllint comments-indentation noise in generated lock files#45879
pelikhan merged 8 commits into
mainfrom
fix/yamllint-on-section-comments-indentation-696223561d8ee625

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes yamllint comments-indentation violations in generated lock files. When the workflow compiler emits a commented-out block at the end of the on: section (e.g. skip-author-associations sub-keys), those comment lines were indented to match their YAML context. yamllint requires top-level comments to be at column 0, causing lint noise on every generated file.

Changes

Core fix — pkg/workflow/

  • Adds dedentTrailingOnCommentBlock: scans the on: section of a generated YAML lock file, identifies any trailing comment-only block (lines prefixed with # after stripping leading whitespace/tabs, with optional trailing blank lines), and strips all leading whitespace from those lines to move them to column 0.
  • Only the trailing comment block is affected; comment lines with real YAML content after them are left untouched.
  • Handles space indentation, tab indentation, and mixed space+tab indentation.

Tests — pkg/workflow/

  • New: dedent_trailing_on_comment_block_test.go — 8 table-driven test cases covering: no trailing comments (no-op), single/multiple indented trailing comments dedented, trailing blank lines preserved, already-at-col-0 unchanged, middle comment blocks untouched, tab-indented comments stripped, mixed indentation stripped.
  • Updated: skip_author_associations_test.go — assertions updated from " # issue_comment: contributor" (2-space indent) to "\n# issue_comment: contributor" (column 0) across all skip-author-associations sub-key checks, reflecting the new dedent behaviour.

CI / generated files

  • Bulk recompile of all 257 workflows following a merge from main.
  • agentic-auto-upgrade.yml cron schedule updated: 11 4 * * 621 3 * * 5 (Friday 03:21 UTC).
  • pkg/actionpins/data/action_pins.json action pin versions refreshed.
  • multi-agent-research.md added to CI fallback list and skill template.

Motivation

Every generated lock file that included commented-out on: sub-keys triggered a yamllint comments-indentation warning, creating persistent lint noise across the repository. The fix is applied at generation time so all future recompiles produce clean YAML without requiring per-file suppressions.

Test coverage

All new behaviour is covered by the dedicated unit test suite. The existing skip_author_associations integration test is updated to assert the corrected output format.

Generated by PR Description Updater for #45879 · 47.8 AIC · ⌖ 6.92 AIC · ⊞ 4.7K ·

Commented-out processed fields (e.g. `# roles:`, `# state:`,
`# skip-author-associations:`) at the end of the `on:` section are
followed, in the assembled workflow, by a top-level key (`permissions:`,
`concurrency:`, ...) at column 0. yamllint's comments-indentation rule
flags a comment whose indentation matches neither the preceding nor the
following content line, so a trailing block indented under `on:` was
reported (3 warnings across the generated lock files).

Re-indent only the final trailing comment block of the `on:` section to
column 0 so it aligns with the top-level key that follows. Middle comment
blocks already have a matching indentation anchor below them and are left
untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pelikhan
pelikhan marked this pull request as ready for review July 16, 2026 04:24
Copilot AI review requested due to automatic review settings July 16, 2026 04:24
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ PR Code Quality Reviewer failed during code quality review.

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (62 additions across 3 files).

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.

Pull request overview

Fixes yamllint comment-indentation warnings in generated workflow lock files.

Changes:

  • De-indents trailing processed-field comments to column 0.
  • Updates related test expectations.
Show a summary per file
File Description
pkg/workflow/frontmatter_on_section_cleanup.go Adds trailing-comment de-indentation.
pkg/workflow/skip_author_associations_test.go Updates compiled output assertions.
pkg/workflow/frontmatter_extraction_yaml_fuzz_test.go Updates fuzz-test expectations.

Review details

Tip

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

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

Comment on lines +52 to +56
mustContain("# labels: # Label filtering applied via job conditions")
mustContain("# - " + topAQuoted + " # Label filtering applied via job conditions")
mustContain("# - " + topBQuoted + " # Label filtering applied via job conditions")
mustContain(" # - " + nestedAQuoted)
mustContain(" # - " + nestedBQuoted)
mustContain("# - " + nestedAQuoted)
mustContain("# - " + nestedBQuoted)
if !strings.Contains(result, " # - "+nestedAQuoted) {
// Commented on.steps content is the trailing block of the on: section, so it is
// de-indented to column 0 (yamllint comments-indentation).
if !strings.Contains(result, "# - "+nestedAQuoted) {
t.Fatalf("expected nested labels item to remain in on.steps output:\n%s", result)
}
if !strings.Contains(result, " # - "+nestedBQuoted) {
if !strings.Contains(result, "# - "+nestedBQuoted) {

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Logic is correct and well-guarded. The dedentTrailingOnCommentBlock function cleanly handles edge cases (all-comment files, blank trailing lines, non-comment last line). Tests updated consistently. LGTM.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 11 AIC · ⌖ 4.25 AIC · ⊞ 5K

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — approving with one minor suggestion.

📋 Key Themes & Highlights

Key Themes

  • Root cause addressed: the fix targets the generator (column-0 re-indent of trailing comment blocks) rather than suppressing yamllint warnings downstream — correct approach
  • Scope is precise: only the final comment block is adjusted; middle blocks with a matching anchor below are left untouched, avoiding unintended changes
  • Tests updated correctly: fuzz test and integration test assertions reflect the new behavior; the "\n# ..." prefix in skip_author_associations_test.go is a stronger assertion than the previous indented form

Positive Highlights

  • dedentTrailingOnCommentBlock is a pure function with a clear single responsibility and well-written godoc
  • ✅ The start == 0 guard correctly handles the edge case where the entire slice is comments
  • ✅ PR description includes before/after metrics and lists the three affected lock files — makes the change easy to verify

Minor Suggestion

dedentTrailingOnCommentBlock is a non-trivial algorithm (last-non-blank scan, trailing-comment-block walkback, guard conditions). The existing fuzz and integration tests cover it indirectly, but a small direct unit test table (e.g. trailing block only, middle block only, all-comments, empty input) would make future regressions much faster to diagnose per /tdd.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 20.9 AIC · ⌖ 4.4 AIC · ⊞ 6.7K
Comment /matt to run again

@github-actions

Copy link
Copy Markdown
Contributor Author

🧪 Test Quality Sentinel Report

Test Quality Score: 100/100 — Excellent

Analyzed 3 test(s): 3 design, 0 implementation, 0 violation(s).

📊 Metrics (3 tests)
Metric Value
Analyzed 3 (Go: 3, JS: 0)
✅ Design 3 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 3 (100%)
Duplicate clusters 0
Inflation No (0.48:1)
🚨 Violations 0
Test File Classification Issues
FuzzCommentOutProcessedFieldsInOnSectionTopLevelLabels frontmatter_extraction_yaml_fuzz_test.go design_test / behavioral_contract None
FuzzCommentOutProcessedFieldsInOnSectionNoTopLevelLabels frontmatter_extraction_yaml_fuzz_test.go design_test / behavioral_contract None
TestSkipAuthorAssociations (modified section) skip_author_associations_test.go design_test / behavioral_contract None

Verdict

Passed. 0% implementation tests (threshold: 30%). All 3 modified tests are behavioral-contract tests that enforce the new column-0 de-indentation invariant for yamllint compliance. Build tags present, no mock violations, no inflation.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel · 25.3 AIC · ⌖ 8.52 AIC · ⊞ 6.8K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 100/100. 0% implementation tests (threshold: 30%).

//
// Only the final block is adjusted. Commented blocks with real `on:` content after them
// already have a matching indentation anchor below and are left untouched.
func dedentTrailingOnCommentBlock(lines []string) []string {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot add dedicated unit test suite for this function

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.

Added TestDedentTrailingOnCommentBlock in pkg/workflow/frontmatter_on_section_cleanup_test.go with 10 table-driven cases covering: empty input, no trailing comment, single/multiple indented comments dedented to column 0, trailing blank lines with a comment block, already-column-0 (no-op), middle block left untouched, entirely-comments file (no-op), tab indentation, and mixed space+tab indentation.

Copilot AI and others added 2 commits July 16, 2026 04:54
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…mentBlock

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan July 16, 2026 05:07
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Copilot AI and others added 3 commits July 16, 2026 05:16
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…on-comments-indentation-696223561d8ee625

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main and recompile

Done — merged main and recompiled all 257 workflows (0 errors). Committed in the latest push.

@pelikhan

Copy link
Copy Markdown
Collaborator

Copilot AI and others added 2 commits July 16, 2026 05:31
…on-comments-indentation-696223561d8ee625

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
… skill template, recompile

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main and recompile
Fix https://github.com/github/gh-aw/actions/runs/29473544671/job/87541729935

Merged main (including the new multi-agent-research.md from #45911), fixed both CI failures:

  • Added multi-agent-research.md to pkg/cli/data/agentic_workflows_fallback_aw_files.json (fixes TestFallbackAWFilesMatchesLocalAWDirectory)
  • Added the dispatch entry to pkg/cli/data/agentic_workflows_skill.md template (fixes TestCheckedInAgenticWorkflowsSkillMatchesGeneratedContent)
  • Recompiled all 257 workflows (0 errors)

@pelikhan
pelikhan merged commit 1b710f4 into main Jul 16, 2026
29 checks passed
@pelikhan
pelikhan deleted the fix/yamllint-on-section-comments-indentation-696223561d8ee625 branch July 16, 2026 05:49
@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.82.10

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.

3 participants