Skip to content

Preserve quoted cron expressions in frontmatter updates - #55502

Merged
pelikhan merged 2 commits into
mainfrom
copilot/go-fan-go-module-review
Aug 24, 2026
Merged

Preserve quoted cron expressions in frontmatter updates#55502
pelikhan merged 2 commits into
mainfrom
copilot/go-fan-go-module-review

Conversation

Copilot AI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

UpdateWorkflowFrontmatter could emit unquoted cron expressions after YAML marshaling, producing invalid workflow frontmatter during mutations such as gh aw mcp add.

  • Frontmatter serialization

    • Apply the existing QuoteCronExpressions post-processing before reconstructing the workflow file.
    • Preserve cron values such as:
      cron: "0 14 * * 1-5"
  • Regression coverage

    • Verify scheduled workflows retain quoted cron expressions while applying unrelated frontmatter updates.

gh-aw-pr-sous-chef
Run: https://github.com/github/gh-aw/actions/runs/32777439671

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 6.4 AIC · ⌖ 8 AIC · ⊞ 6.2K ·
Comment /souschef to run again

Copilot AI linked an issue Aug 24, 2026 that may be closed by this pull request
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Review Go module goccy/go-yaml and its usage Preserve quoted cron expressions in frontmatter updates Aug 24, 2026
Copilot AI requested a review from pelikhan August 24, 2026 20:33
@pelikhan
pelikhan marked this pull request as ready for review August 24, 2026 20:38
Copilot AI balanced review requested due to automatic review settings August 24, 2026 20:38
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

No actionable PR review findings; the patch looks correct and I did not submit review comments.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🧠 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 24, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #55502

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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

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

🏗️ ADR gate enforced by Design Decision Gate 🏗️

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 #55333 by preserving valid quoted cron expressions during frontmatter mutations.

Changes:

  • Post-process marshaled frontmatter with QuoteCronExpressions.
  • Add regression coverage for unrelated updates to scheduled workflows.
Show a summary per file
File Description
pkg/parser/workflow_update.go Re-quotes cron expressions after YAML marshaling.
pkg/parser/frontmatter_helpers_test.go Verifies cron quoting and updates are preserved.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

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

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-24T00:00:00Z
review_event: COMMENT
top_themes:
  - no actionable issues in changed lines
files_reviewed:
  - pkg/parser/frontmatter_helpers_test.go
  - pkg/parser/workflow_update.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 · 2.84 AIC · ⌖ 6.74 AIC · ⊞ 7K ·
Comment /review to run again

@github-actions github-actions Bot 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — the fix is correct and well-tested. Approving.

📋 Key Themes & Highlights

Positive Highlights

  • ✅ Root cause properly addressed: QuoteCronExpressions is applied immediately after yaml.Marshal, which is exactly where cron values get unquoted
  • ✅ Regression test is present, descriptive, and follows the existing Arrange/Act/Assert pattern in this file
  • ✅ The fix is a single-line surgical change — minimal blast radius
  • ✅ Test validates both the cron preservation and that the unrelated frontmatter mutation (engine: copilot) still applies, confirming no side effects

Minor Observation

The test uses assert.Contains to check that the output contains cron: "0 14 * * 1-5". This is correct but does not verify the full reconstructed YAML structure. That said, it is consistent with how the neighbouring tests in this file are written, so it's the right style call here.

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

@github-actions github-actions Bot 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.

The fix is correct and well-placed. QuoteCronExpressions is applied immediately after YAML marshaling (where go-yaml strips quotes from cron strings), and the regex safely skips already-quoted values by requiring the value to start with a digit. The new integration test validates the round-trip preservation. No blocking issues.

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

@github-actions

Copy link
Copy Markdown
Contributor

Excellent work, @Copilot! 👋 This PR correctly addresses the cron expression quoting issue identified in the Go Fan review (#55333).

Your changes do exactly what is needed:

Implementation — Added the missing QuoteCronExpressions() call after YAML marshaling in UpdateWorkflowFrontmatter, matching the pattern already used elsewhere in the codebase.

Regression Coverage — New test TestUpdateWorkflowFrontmatterQuotesCronExpressions verifies cron values stay quoted after unrelated frontmatter updates.

Focused & Minimal — One-liner fix + focused test, no unrelated changes.

This PR is ready for review and looks great for merge.

Generated by ✅ Contribution Check · copilot · auto · 54.3 AIC · ⌖ 4.04 AIC · ⊞ 9.3K ·

@pelikhan
pelikhan merged commit 4544e4b into main Aug 24, 2026
113 of 114 checks passed
@pelikhan
pelikhan deleted the copilot/go-fan-go-module-review branch August 24, 2026 21:09
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

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

Please use the pr-finisher skill and do one focused follow-up pass on this PR.

  • review the latest maintainer and reviewer feedback, then either push the smallest needed follow-up or reply in-thread if no code change is still required
  • refresh the branch if needed and run make fmt if you touch code
  • hand back only after the branch is ready for re-review

I also attempted a branch refresh for this PR in this run.

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

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 6.4 AIC · ⌖ 8 AIC · ⊞ 6.2K ·
Comment /souschef to run again

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.

[go-fan] Go Module Review: goccy/go-yaml

4 participants