Skip to content

[yamllint-fixer] Fix yamllint indentation warnings in workflow_call on: sections - #55921

Open
github-actions[bot] wants to merge 4 commits into
mainfrom
fix/yamllint-workflow-call-schedule-indent-7d1a542d3ace49e7
Open

[yamllint-fixer] Fix yamllint indentation warnings in workflow_call on: sections#55921
github-actions[bot] wants to merge 4 commits into
mainfrom
fix/yamllint-workflow-call-schedule-indent-7d1a542d3ace49e7

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Reduces yamllint noise in generated *.lock.yml files by fixing a root cause in the Go
YAML generator code: the on: trigger section for workflow_call-triggered workflows was
losing its sequence indentation when outputs/secrets were injected.

yamllint config used:

{extends: default, rules: {line-length: disable, document-start: disable, truthy: {check-keys: false}, comments: {require-starting-space: true, min-spaces-from-content: 1}}}

Results

Metric Before After Reduction
Total warnings 2 0 2 (100%)

Warning breakdown

Category Before After
indentation 2 0

Root cause

extractTopLevelYAMLSection (pkg/workflow/frontmatter_extraction_yaml.go) already marshals
the on: section with yaml.IndentSequence(true) so that sequence items like schedule:
cron lists are indented under their parent key, satisfying yamllint's default
indentation rule.

However, for workflows that use workflow_call as a trigger, injectWorkflowCallOutputs
and injectWorkflowCallSecretsSection in pkg/workflow/compiler_workflow_call.go
re-parse and re-marshal that same on: section afterward (to inject
workflow_call.outputs / workflow_call.secrets), but did so with plain yaml.Marshal,
which uses the default (non-indented) sequence style. This flattened any sequence under
on: — most visibly schedule: cron lists — back to the same indent level as the key,
e.g.:

on:
  schedule:
  - cron: "0 0 */2 * *"   # wrong: expected 4-space indent, found 2

This affected smoke-workflow-call.lock.yml and smoke-workflow-call-with-inputs.lock.yml,
both of which combine a schedule trigger with workflow_call.

Changes

  • pkg/workflow/compiler_workflow_call.go: both re-marshal call sites now pass
    yaml.IndentSequence(true) to yaml.MarshalWithOptions, matching the option used in
    extractTopLevelYAMLSection so the indentation style is preserved end-to-end.

Notes

  • The generated .lock.yml files are not included in this PR.
    Run gh aw compile after merging to regenerate them with the improvement.
  • Related to Reduce yamllint noise in generated *.lock.yml #41507 (already closed; this addresses one of the two warnings
    remaining in the current baseline).

Warning

Firewall blocked 1 domain

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

  • registry.npmjs.org

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

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

Generated by 🧹 Daily yamllint Fixer · claude · agent · 158.6 AIC · ⌖ 8.19 AIC · ⊞ 8.1K ·

  • expires on Sep 1, 2026, 7:15 PM UTC-08:00

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 22.7 AIC · ⌖ 8.14 AIC · ⊞ 8.7K ·
Comment /souschef to run again

injectWorkflowCallOutputs and injectWorkflowCallSecretsSection re-marshal
the on: section with plain yaml.Marshal, dropping the IndentSequence(true)
option applied earlier in extractTopLevelYAMLSection. This flattened
sequence items (e.g. schedule cron lists) back to the same indent as
their parent key, triggering yamllint's default indentation rule.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #55921

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

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

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped.

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR #55921 does not have the 'implementation' label and has only 5 new lines of code in business logic directories (threshold: 100).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

Copy link
Copy Markdown
Contributor Author

Comment Memory

reviewed_at: 2026-08-26T00:00:00Z
review_event: COMMENT
top_themes:
  - no blocking issues in changed lines
  - formatting consistency could be centralized later
files_reviewed:
  - pkg/workflow/compiler_workflow_call.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 5.72 AIC · ⌖ 6.86 AIC · ⊞ 7K ·
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.

Verdict: non-blocking

This change fixes the intended indentation regression and I did not find a correctness, crash, or compatibility issue in the modified lines.

Notes
  • Switching these two remarshal sites to yaml.MarshalWithOptions(..., yaml.IndentSequence(true)) matches the existing behavior in extractTopLevelYAMLSection.
  • The one thing still worth tightening later is consistency with the repository's centralized DefaultMarshalOptions, but that is maintainability debt, not a merge blocker for this patch.
  • The requested grumpy-coder sub-agent could not be started in this environment because the executable is unavailable, so this review is based on my direct analysis only.

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 5.72 AIC · ⌖ 6.86 AIC · ⊞ 7K
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.

Skills-Based Review 🧠

Applied /tdd — one observation on test coverage; no blocking issues.

📋 Key Themes & Highlights

Key Themes

  • Missing regression test: the schedule + workflow_call combined scenario that triggered this bug has no test case in compiler_workflow_call_test.go. A future refactor dropping IndentSequence(true) from either call site would silently re-introduce the indentation issue.

Positive Highlights

  • ✅ Root cause correctly identified and fixed at both call sites (injectWorkflowCallOutputs and injectWorkflowCallSecretsSection)
  • ✅ Fix is consistent with the existing extractTopLevelYAMLSection pattern
  • ✅ Clear, well-written PR description with before/after evidence

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 22.5 AIC · ⌖ 9.88 AIC · ⊞ 7.6K
Comment /matt to run again

Comment thread pkg/workflow/compiler_workflow_call.go
@github-actions github-actions Bot mentioned this pull request Aug 26, 2026

@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.

Looks good. The two-line change is correct and symmetric — switching yaml.Marshal to yaml.MarshalWithOptions(..., yaml.IndentSequence(true)) at both injection sites is the right fix for yamllint indentation warnings, and the added comment clearly explains the rationale.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet46 · 13.7 AIC · ⌖ 9.03 AIC · ⊞ 6.2K

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 YAML sequence indentation when injecting workflow_call outputs or secrets.

Changes:

  • Uses yaml.IndentSequence(true) in both remarshal paths.
  • Preserves yamllint-compliant schedule indentation.
Show a summary per file
File Description
pkg/workflow/compiler_workflow_call.go Preserves nested sequence indentation during injection.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Balanced

// Re-marshal to YAML.
newOnData := map[string]any{"on": onMap}
newYAML, err := yaml.Marshal(newOnData)
newYAML, err := yaml.MarshalWithOptions(newOnData, yaml.IndentSequence(true))

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.

Addressed in b3b0593, extended in 06b4ed8.

TestInjectWorkflowCallSecretsSection now has a schedule + workflow_call case (pkg/workflow/compiler_workflow_call_test.go:441):

{
    name: "schedule sequence stays indented and cron stays quoted",
    onSection: `"on":
  schedule:
    - cron: "0 0 */2 * *"
  workflow_call: {}`,
    secrets:     []string{"MY_TOKEN"},
    wantContain: []string{"MY_TOKEN", "  schedule:\n    - cron: \"0 0 */2 * *\""},
    wantAbsent:  []string{"  schedule:\n  - cron:", "- cron: 0 0"},
},

It asserts the four-space nesting positively and pins the flattened two-space form as absent, plus the unquoted cron form after 06b4ed8 also restored parser.QuoteCronExpressions on this path.

Verified it's a real guard rather than a tautology: reverting the secrets call site back to plain yaml.Marshal makes this case fail with

"...\n  schedule:\n  - cron: 0 0 */2 * *\n  workflow_call:\n    secrets:..."
  does not contain "  schedule:\n    - cron: \"0 0 */2 * *\""

The equivalent case exists for the outputs path at line 142.

Comment thread pkg/workflow/compiler_workflow_call.go
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

Run: https://github.com/github/gh-aw/actions/runs/32955372316

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 22.7 AIC · ⌖ 8.14 AIC · ⊞ 8.7K ·
Comment /souschef to run again

…ession tests

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

Done in 2f45d47.

On the failed checks: all 8 jobs in run 32936194474 failed with the same infrastructure error, not a code error:

##[error]Failed to restore cache entry. Exiting as fail-on-cache-miss is set.
Input key: checkout-cgo-fix/yamllint-workflow-call-schedule-indent-...

i.e. the shared checkout cache entry was missing, so every dependent job aborted before running anything. Nothing in the diff caused it; the new push should repopulate the cache.

Forward-progress pass in this branch:

  • Regenerated the affected .lock.yml files with make recompile (smoke-workflow-call, smoke-workflow-call-with-inputs) so validate-yaml sees the schedule sequences at the corrected 4-space indent.
  • Added regression tests to TestInjectWorkflowCallOutputs and TestInjectWorkflowCallSecretsSection covering a schedule: trigger alongside workflow_call, asserting schedule:\n - cron: is present and the flattened schedule:\n - cron: form is absent.
  • Verified make fmt and the full pkg/workflow suite pass locally.

Note: make agent-report-progress reports pre-existing largefunc warnings for injectWorkflowCallOutputs/injectWorkflowCallSecretsSection (77/104 lines at the base commit, before this branch). That analyzer isn't enabled in the CI golint-custom flag set, and splitting those functions is out of scope here.

Copilot AI requested a review from gh-aw-bot August 26, 2026 10:17
on:
schedule:
- cron: 0 0 */2 * *
- cron: 0 0 */2 * *

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 this cron expression should be quoted

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.

Fixed in 750b100.

Same root cause as the indentation issue, one layer deeper. extractTopLevelYAMLSection marshals the on: section and then post-processes it with parser.QuoteCronExpressions, because goccy drops quotes from cron scalars like 0 0 */2 * *. The workflow_call injection functions re-marshal that section afterwards, which re-introduced the unquoted form — my previous commit restored the indentation but not the quoting.

Both re-marshal sites now route through a small finalizeWorkflowCallOnSection helper that re-applies parser.QuoteCronExpressions, so the two paths stay consistent.

on:
  schedule:
    - cron: "0 0 */2 * *"

Also verified grep -rn 'cron: [^"]' .github/workflows/*.lock.yml now returns nothing across all 294 lock files — these two were the only unquoted ones. The regression tests in TestInjectWorkflowCallOutputs/TestInjectWorkflowCallSecretsSection were extended to assert the quoted form is preserved in addition to the 4-space indentation.

…/secrets

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan August 26, 2026 14:30
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.

Please do one focused follow-up pass:

  • address the remaining maintainer-facing review context, especially the missing schedule+workflow_call regression-test follow-up noted in review
  • reply in-thread with the concrete fix reference if already addressed, otherwise push the missing coverage
  • use the pr-finisher skill before handing back for review

Run: https://github.com/github/gh-aw/actions/runs/32979958387

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 23.4 AIC · ⌖ 8.18 AIC · ⊞ 8.7K ·
Comment /souschef to run again

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

gh-aw-pr-sous-chef
@copilot PR Sous Chef triage: this PR still needs a forward-progress pass before maintainer investigation is likely to be productive.
...

No new code was needed this pass — the schedule+workflow_call regression coverage was already pushed. Replied in-thread on the secrets review thread (#discussion_r3860058001) with the concrete reference.

Status:

  • Reviews — both review threads are covered. TestInjectWorkflowCallOutputs (compiler_workflow_call_test.go:142) and TestInjectWorkflowCallSecretsSection (line 441) each have a schedule: + workflow_call case added in b3b0593 and extended in 06b4ed8 to also pin cron quoting. @pelikhan's cron-quoting thread was fixed in 06b4ed8.
  • Checks (CI) — the 8 failures cited in the previous triage were all a transient Failed to restore cache entry miss, not code. On the current HEAD every one of them is green: validate-yaml, impacted-go-tests, lint-go-format, lint-go-custom, actions-build, mcp-server-compile-test, Alpine Container Test, safe-outputs-conformance, plus build, build-wasm, security and all five unit-test shards. No failing checks remain.
  • Checks (local)make fmt clean, make recompile regenerates with no drift, full pkg/workflow suite passes.

Both new test cases were confirmed to be genuine regression guards: reverting either call site to plain yaml.Marshal makes them fail on the flattened/unquoted output.

Nothing actionable is left on my side; this needs maintainer review. One pre-existing note: make agent-report-progress flags largefunc warnings for injectWorkflowCallOutputs/injectWorkflowCallSecretsSection (78/104 lines), which predate this branch and are not enabled in CI's lint-go-custom analyzer set — out of scope here.

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.

4 participants