Draft
refactor: split compiler_yaml.go (1262 lines) into focused modules#45494
Conversation
8 tasks
Extract distinct functional domains from the 1262-line compiler_yaml.go into 4 new focused files: - compiler_yaml_normalize.go: YAML text normalization utilities (normalizeBlankLines, countLeadingSpaces, blockScalarHeaderIndentForLine) - compiler_yaml_header.go: YAML header/metadata emission (generateWorkflowHeader, effectiveStrictMode, effectiveSafeUpdate) - compiler_yaml_prompt.go: Prompt assembly and chunking (generatePrompt, splitContentIntoChunks, extractPromptChunksFromMarkdown, writePromptBashStep, resolveWorkspaceRoot) - compiler_yaml_steps.go: Individual step generation (generatePreSteps, generatePostSteps, generatePreAgentSteps, writeStepsSection, generateCreateAwInfo, generateOutputCollectionStep) compiler_yaml.go trimmed to top-level orchestration only: (buildJobsAndValidate, generateYAML, generateWorkflowBody) All tests pass. No behavior changes. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor pkg/workflow/compiler_yaml.go into focused modules
refactor: split compiler_yaml.go (1262 lines) into focused modules
Jul 14, 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.
pkg/workflow/compiler_yaml.gohad grown to 1262 lines across 5 unrelated functional domains, exceeding the 800-line threshold and making the file hard to navigate and maintain.Changes
Extracted into 4 new files, leaving
compiler_yaml.goas a thin orchestration layer:compiler_yaml.gobuildJobsAndValidate,generateYAML,generateWorkflowBodycompiler_yaml_normalize.gocompiler_yaml_header.gogenerateWorkflowHeader,effectiveStrictMode,effectiveSafeUpdatecompiler_yaml_prompt.gocompiler_yaml_steps.gogenerateCreateAwInfo, output collectionAll functions remain in the same package with identical signatures — purely a file-boundary split with no behavior changes.