refactor(threat-detection): extract shared external detector WorkflowData setup into helper#46142
Merged
pelikhan merged 5 commits intoJul 17, 2026
Merged
Conversation
7 tasks
…icate threat detection setup Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor threat-detection WorkflowData setup to eliminate duplicates
refactor(threat-detection): extract shared external detector WorkflowData setup into helper
Jul 17, 2026
pelikhan
marked this pull request as ready for review
July 17, 2026 06:54
Collaborator
|
@copilot merge main and recompile |
Contributor
There was a problem hiding this comment.
Pull request overview
Extracts shared external-detector WorkflowData initialization to prevent configuration divergence.
Changes:
- Adds a shared helper for tools, engine config, environment, and API target setup.
- Updates installation and execution paths to use the helper.
- Includes unrelated generated workflow metadata and scheduling changes.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/threat_detection_helpers.go |
Adds shared external-detector setup helper. |
pkg/workflow/threat_detection_external.go |
Replaces duplicated setup logic. |
.github/workflows/skillet.lock.yml |
Updates generated action metadata. |
.github/workflows/release.lock.yml |
Updates generated action metadata. |
.github/workflows/hourly-ci-cleaner.lock.yml |
Updates generated action metadata. |
.github/workflows/avenger.lock.yml |
Updates generated action metadata. |
.github/workflows/agentic-auto-upgrade.yml |
Changes the weekly execution schedule. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Medium
| on: | ||
| schedule: | ||
| - cron: "11 4 * * 6" # Weekly (auto-upgrade) | ||
| - cron: "21 3 * * 5" # Weekly (auto-upgrade) |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
🤖 PR Triage
Rationale: Behavior-preserving refactor extracting shared WorkflowData helper in threat-detection. CI partially passing. Batch with similar Go refactors.
|
…eat-detection-workflowdata-setup Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
pelikhan
deleted the
copilot/duplicate-threat-detection-workflowdata-setup
branch
July 17, 2026 11:18
This was referenced Jul 17, 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.
The synthetic
WorkflowDataconstruction for the external-detector path was duplicated verbatim acrossbuildInstallDetectionEngineForExternalDetectorStepandbuildExternalDetectorExecutionStep, making env/APITarget propagation logic a divergence risk.Changes
threat_detection_helpers.go— NewbuildExternalDetectorWorkflowData(data, engineID)helper centralizes the shared setup:buildThreatDetectionWorkflowDataTools = {"bash": ["*"]}canReuseThreatDetectionEngineConfigForExternalDetectormergeThreatDetectionEngineEnvAPITargetinheritance from main engine configthreat_detection_external.go— BothbuildInstallDetectionEngineForExternalDetectorStepandbuildExternalDetectorExecutionStepreplace their ~12-line setup blocks with a single call. The execution step layers its step-specific additions (NetworkPermissions, Mounts) on top: