Conversation
…s duplication generatePreSteps and generatePostSteps had identical implementations for stripping the YAML header line and normalising indentation. Extract a shared writeStepsSection helper so the logic lives in one place. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors YAML step rendering in the workflow compiler by extracting shared pre/post-steps formatting logic into a single helper, removing duplication introduced by the earlier pre-steps feature work.
Changes:
- Extracted shared step-section rendering logic into
writeStepsSection. - Simplified
generatePreStepsandgeneratePostStepsto delegate to the shared helper.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_yaml.go | Removes duplicated pre/post-steps YAML rendering code by introducing writeStepsSection and delegating both generators to it. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
pelikhan
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR simplifies recently modified code from PR #25242 (feat: add
pre-stepsto agent job) to eliminate code duplication introduced by the new feature.Files Simplified
pkg/workflow/compiler_yaml.go— extracted sharedwriteStepsSectionhelperImprovements Made
Eliminated duplicated step-rendering logic
generatePreStepsandgeneratePostStepshad byte-for-byte identical implementations: strip the YAML header line (pre-steps:/post-steps:), skip blank lines, and normalise indentation to 6/8 spaces. A sharedwriteStepsSectionhelper now owns this logic:The two callers become one-liners, and future changes to indentation/whitespace handling only need to happen in one place.
Changes Based On
Recent changes from:
pre-stepsto agent job for same-job token minting (with import support) #25242 — feat: addpre-stepsto agent job for same-job token mintingTesting
TestPreStepsGenerationpasses (step order: pre-step < checkout < custom < AI < post)go test ./pkg/workflow/— all 1665-file package tests pass (21s)go vet ./pkg/workflow/...— cleanmake build)Review Focus
Please verify:
writeStepsSectionpreserves the exact indentation behaviour of both original functionslines[1:])Automated by Code Simplifier Agent — analysing code from the last 24 hours
References: §24120682674
Note
🔒 Integrity filter blocked 2 items
The following items were blocked because they don't meet the GitHub integrity level.
search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter: