[daily-compiler-quality] Code Quality Audit: compiler.go, compiler_jobs.go, compiler_yaml.go #26743
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it expired on 2026-04-17T21:50:29.265Z.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
Automated quality analysis of the three primary workflow compiler files at commit
f2bfc73. All scores are out of 100 across 5 dimensions.Scores at a Glance
compiler.gocompiler_jobs.gocompiler_yaml.goAll three files rate Good (70–79 range).
Function Size Violations (50-line guideline)
validateWorkflowDatabuildCustomJobsgeneratePromptgenerateWorkflowHeadergenerateCreateAwInfogenerateAndValidateYAMLCompileWorkflowDataKey Findings per File
compiler.go— Score: 77/100Strengths:
formatCompilerError()wrapper provides structured, IDE-navigable error messagesany,slices.Contains,deferfor timingIssues:
validateWorkflowData(348 lines) is a God Method — 22 sequential validator calls in a single flat functionreturn errat L143, L303 bypassesformatCompilerError, surfaces unformatted errors.invalid.ymlwrite logic in 3 separate error branches ingenerateAndValidateYAMLTop recommendation: Create a
ValidationPipelinewith[]ValidationStep— each step under 50 lines, independently testable.compiler_jobs.go— Score: 74/100Strengths:
fmt.Errorfcalls, all using%wwith rich contextensureConclusionIsLastJobis a correct, well-designed topological safety netIssues:
buildCustomJobs(334 lines) is a single loop extracting 12+ job properties with ~80 lines of near-identical marshal+indent codeisActivationJobNeededalways returnstrue— dead code that misleads callersreturn errat L759 provides no context about which job/secret triggered the errorTop recommendation: Extract
extractCustomJobConfig(jobName, configMap) (*Job, error)and amarshalIndentedYAML(value, indent, prefix)helper to eliminate the repetitive marshal patterns.compiler_yaml.go— Score: 74/100Strengths:
strings.Builder, single-pass body-before-header to collect secretsIssues:
generatePrompt(231 lines) handles 6 distinct concerns — import inlining, runtime-import macros, expression extraction, merging, known-needs augmentation, step emissionb, _ := json.Marshal(allowedDomains)silently produces[]on failuregenerateYAML,generatePrompt,generatePreSteps,generatePostSteps,generatePreAgentSteps,generateCreateAwInfo,generateOutputCollectionStepTop recommendation: Split
generatePromptintocollectPromptSources(),extractPromptExpressions(), andemitPromptSteps().Cross-Cutting Strengths
interface{}— all files useanyconsistentlyCross-Cutting Issues
formatCompilerError(), others use barereturn errmap[string]anytype assertion pattern appears ~30+ times incompiler_jobs.gowithout a helperPriority Refactoring Targets
validateWorkflowDatainto grouped sub-validators:validatePermissionsConfig,validateSafeOutputsConfig,validateConcurrencyConfig,validateNetworkConfig,validateToolsConfigbuildCustomJobs: extractextractCustomJobConfig()+marshalIndentedYAML()helpergeneratePromptinto 3 focused functions (<50 lines each)isActivationJobNeededalways returnstrueBeta Was this translation helpful? Give feedback.
All reactions