-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Description
The generateCreateAwInfo() function in pkg/workflow/compiler_yaml.go is 155 lines long, making it difficult to understand and test. The function builds the aw_info.json structure with multiple concerns mixed together.
Current State
- File:
pkg/workflow/compiler_yaml.go - Function:
generateCreateAwInfo()(lines 348-502) - Size: 155 lines (exceeds 100-200 line guideline)
- Complexity: Mixes engine config, network config, and metadata building
Suggested Changes
Extract three helper functions to separate concerns:
-
buildEngineInfo()- Extract engine configuration building (~50 lines)- Model name, version, provider
- Engine-specific settings
- Tool configurations
-
buildNetworkInfo()- Extract network configuration (~30 lines)- Allowed domains
- Network permissions
- Access restrictions
-
buildRunMetadata()- Extract metadata collection (~40 lines)- GitHub context (repo, run ID, actor)
- Workflow metadata
- Runtime information
Files Affected
pkg/workflow/compiler_yaml.go- RefactorgenerateCreateAwInfo()functionpkg/workflow/compiler_yaml_test.go- Add tests for new helper functions
Success Criteria
- Each helper function is 30-50 lines
-
generateCreateAwInfo()orchestrates, doesn't implement - All existing tests pass (currently 1,113 test lines)
- Test coverage maintained at 1.89:1 ratio
-
aw_info.jsonstructure remains unchanged
Source
Extracted from Daily Compiler Code Quality Report - 2026-02-02
Quote from report:
Extract helper functions in
compiler_yaml.go
- Issue:
generateCreateAwInfo()is 155 lines- Focus areas:
- Engine configuration building (50 lines →
buildEngineInfo())- Network configuration (30 lines →
buildNetworkInfo())- Metadata collection (40 lines →
buildRunMetadata())
Priority
Medium - Second priority recommendation from compiler quality analysis. Improves readability of YAML generation code.
Benefits
- Clearer separation: Each helper handles one concern
- Easier testing: Can test engine, network, and metadata building independently
- Better maintainability: Changes to one area don't affect others
- Follows guidelines: Reduces function length to acceptable range
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 16, 2026, 9:16 AM UTC