Repository navigation
Serialize workflow names and generated run names as YAML scalars - #76903
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
This comment has been minimized.
This comment has been minimized.
|
✅ PR Specification Reviewer completed successfully!
|
There was a problem hiding this comment.
Reviewed PR head 2ee680b82bd45add3e8f3c464df967961073f0ad against specs/compiler-threat-detection-spec.md §5.1.3 / CTR-019, including the native Actions scalar-serialization requirement (line 396), plus the changed compiler and regression-test paths. The %q changes preserve YAML structure and the added coverage is aligned with the contract; no specification synchronization is warranted. An initial inline concern about the Unicode test literal was corrected after direct inspection; the source uses valid \u0085 syntax. No tests were run per static-review constraints.
Generated by PR Specification Reviewer for #76903 · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review-specs to run again
| {name: "document boundary", value: "Example\n---\nname: injected"}, | ||
| {name: "tabs", value: "Example\tworkflow"}, | ||
| {name: "controls", value: "Example\x00\a\b\v\f\x1b\x7f workflow"}, | ||
| {name: "Unicode line breaks", value: "Example\u0085next\u2028line\u2029paragraph"}, |
There was a problem hiding this comment.
The new regression case is not valid Go: \u0085 is interpreted as a Unicode escape only when written as \u0085 in the source, but this line currently contains the invalid \^E escape in the PR patch/working tree context. Please verify the literal compiles (for example, use \u0085) before merging; otherwise the added test prevents the package from building.
There was a problem hiding this comment.
Verified the checked-out source uses the valid Go escape \u0085; go test ./pkg/workflow -run '^TestCompileWorkflowNameScalars$' -count=1 passes. No source change was needed.
| {name: "document boundary", value: "Example\n---\nname: injected"}, | ||
| {name: "tabs", value: "Example\tworkflow"}, | ||
| {name: "controls", value: "Example\x00\a\b\v\f\x1b\x7f workflow"}, | ||
| {name: "Unicode line breaks", value: "Example\u0085next\u2028line\u2029paragraph"}, |
There was a problem hiding this comment.
Correction: direct inspection of the checked-out file shows the literal is \u0085, which is valid Go. The preceding concern was based on escaped diff rendering and is withdrawn; no compilation issue is present here.
There was a problem hiding this comment.
Confirmed: the source literal is valid Go and the focused regression test passes.
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found one blocking issue: the new regression test contains an invalid Go escape and prevents the package from compiling. The production quoting changes were otherwise not flagged in this static review. Tests were not executed per review instructions.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| {name: "document boundary", value: "Example\n---\nname: injected"}, | ||
| {name: "tabs", value: "Example\tworkflow"}, | ||
| {name: "controls", value: "Example\x00\a\b\v\f\x1b\x7f workflow"}, | ||
| {name: "Unicode line breaks", value: "Example\u0085next\u2028line\u2029paragraph"}, |
There was a problem hiding this comment.
This test file does not compile because the Unicode line breaks case contains the invalid Go escape \^E, so the regression suite cannot run at all.
💡 Fix the test literal
Use a valid Go escape for the intended control character (for example \x1e or \u001e), or remove the stray backslash before ^E; then run the package tests to verify the YAML cases.
There was a problem hiding this comment.
The current source uses valid \u0085 syntax, not \^E; the focused regression test passes. No source change was needed.
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (more than 100 new lines in 📄 Draft ADR committed:
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. 🔍 Evidence
📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the change to escape workflow names during YAML serialization.
No open issues 🎉
What changed in this PR
This PR fixes YAML serialization of workflow names in the gh-aw compiler, addressing #76901 by escaping values rather than manually wrapping them in quotes.
Changes:
- Use
%qfor workflow names, default run names, and workflow-name metadata. - Preserve existing handling of explicit
run-namevalues. - Add regression tests for special-character round trips, unchanged top-level mappings, and lock-file preservation when non-scalar names are rejected.
| File | Description |
|---|---|
pkg/workflow/yaml_encoding_test.go |
Adds scalar round-trip and rejection regression tests. |
pkg/workflow/tools.go |
Escapes generated default run names. |
pkg/workflow/compiler_yaml.go |
Escapes the top-level workflow name. |
pkg/workflow/compiler_yaml_step_lifecycle.go |
Escapes workflow-name metadata. |
Review effort: Balanced (auto)
|
@copilot address this feedback #76903 (review) |
The current test literal is valid Go ( |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "21c755d7b5ce0f8617b52d5db5b09160708cfba7",
"kind": "requested",
"schema_version": "1",
"state": "c46e91dfaec1215270fc78773c3cda8861db29ba8f868540cd18ff6f6807cad4",
"work": [
"14c47a4e4c230cefc41d14f3d8f90e396c58406ee140cc723440fd225d7ac7e6",
"37869aa8b680d16802633c48a257be226aecda64a772840d7529d2a7b343338f",
"56efcd95dba7c91d1f6e3beb2d676b2c92e9ee9c1dca91b6f39c0a891d574109"
],
"workflow": "pr-sous-chef"
}
|
|
|
🎉 This pull request is included in a new release. Release: |
Workflow names were interpolated into double-quoted YAML without escaping, allowing quotes and line breaks to corrupt generated mappings. The same defect affected default
run-namevalues and workflow-name metadata.Scalar serialization
%qconsistently across all three emitters, preserving special characters and supported display-name expressions.run-namehandling unchanged.Regression coverage
run-name.