Skip to content

[task] Extract generation functions from compiler.go to yaml_generation.go #2275

@github-actions

Description

@github-actions

Objective

Extract 20 YAML generation functions from the oversized pkg/workflow/compiler.go (3,472 lines) into a new dedicated file pkg/workflow/yaml_generation.go.

Context

Part of issue #2273. The compiler.go file is too large and mixes multiple responsibilities. This task focuses on extracting generation functions to improve code organization and maintainability.

Functions to Extract

Move these 20 generation functions from compiler.go to new yaml_generation.go:

  • generateJobName
  • generateYAML
  • generateMainJobSteps
  • generateUploadAgentLogs
  • generateUploadAssets
  • generateLogParsing
  • generateErrorValidation
  • generateUploadAwInfo
  • generateUploadPrompt
  • generateExtractAccessLogs
  • generateUploadAccessLogs
  • generateUploadMCPLogs
  • generatePrompt
  • generateCacheMemoryPromptStep
  • generateSafeOutputsPromptStep
  • generatePostSteps
  • generateEngineExecutionSteps
  • generateAgentVersionCapture
  • generateCreateAwInfo
  • generateOutputCollectionStep
  • convertGoPatternToJavaScript
  • convertErrorPatternsToJavaScript

Approach

  1. Create new file pkg/workflow/yaml_generation.go
  2. Move all 20 generation functions from compiler.go to yaml_generation.go
  3. Ensure all receiver methods remain on *Compiler type
  4. Update imports as needed
  5. Verify no broken references

Files to Modify

  • Create: pkg/workflow/yaml_generation.go
  • Update: pkg/workflow/compiler.go (remove moved functions)

Acceptance Criteria

AI generated by Plan Command for #2273

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions