Repository navigation
Fix external detection job setup for codex and pi workflows #40954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
724a83d
ee5548b
89860a7
3776602
1728b47
51df7e5
435ba64
45eefd4
4ca9043
d21d3e5
0f16c3a
36faad9
175ba79
fc85abf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -281,9 +281,13 @@ func (c *Compiler) buildDetectionJobSteps(data *WorkflowData) []string { | |
| // Step 1: Pull AWF container images - the detection engine runs inside AWF (firewall), | ||
| // so pre-pulling the containers speeds up execution and avoids on-demand pulls. | ||
| // | ||
| // For Codex detection, MCP setup generation already emits this step, so skip here | ||
| // to avoid duplicate step IDs/names in the detection job. | ||
| if c.getThreatDetectionEngineID(data) != "codex" { | ||
| // For the inline Codex detection path (gh-aw-detection feature disabled), MCP setup | ||
| // generation already emits this step via generateDownloadDockerImagesStep, so skip here | ||
| // to avoid duplicate step names in the detection job. | ||
| // For the external detector path (gh-aw-detection: true), MCP setup is not called for | ||
| // the detection job, so the download step must be emitted here unconditionally. | ||
| usingExternalDetector := isFeatureEnabled(constants.GHAWDetectionFeatureFlag, data) | ||
| if c.getThreatDetectionEngineID(data) != "codex" || usingExternalDetector { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good defensive condition:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Smoke test: Clear comment explaining the external detector path. 👍 |
||
| steps = append(steps, c.buildPullAWFContainersStep(data)...) | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice—deriving
usingExternalDetectorfrom the feature flag makes the codex-skip condition explicit and self-documenting.