Skip activation secret validation when environment is configured#26509
Skip activation secret validation when environment is configured#26509
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a7843a88-39e3-430a-b982-450cab6805c4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a7843a88-39e3-430a-b982-450cab6805c4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a7843a88-39e3-430a-b982-450cab6805c4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a7843a88-39e3-430a-b982-450cab6805c4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a7843a88-39e3-430a-b982-450cab6805c4 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the workflow compiler’s activation-job secret validation behavior to skip validation when a top-level GitHub Actions environment is configured.
Changes:
- Skip generating the engine secret validation step when
workflowData.Environmentis set. - Add unit tests asserting validation/outputs are omitted when a top-level environment is present.
- Add cross-engine test coverage to ensure all supported engines follow the new skip behavior.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/engine_helpers.go | Adds environment-based guard to skip default secret validation step generation. |
| pkg/workflow/secret_verification_output_test.go | Adds compilation test ensuring activation outputs and validate-secret step are omitted when environment is set. |
| pkg/workflow/secret_validation_test.go | Adds cross-engine unit test ensuring GetSecretValidationStep returns empty when environment is configured. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
| func BuildDefaultSecretValidationStep(workflowData *WorkflowData, secrets []string, name, docsURL string) GitHubActionStep { | ||
| if workflowData.EngineConfig != nil && workflowData.EngineConfig.Command != "" { | ||
| engineHelpersLog.Printf("Skipping secret validation step: custom command specified (%s)", workflowData.EngineConfig.Command) | ||
| return GitHubActionStep{} | ||
| } | ||
| if workflowData != nil && strings.TrimSpace(workflowData.Environment) != "" { | ||
| engineHelpersLog.Print("Skipping secret validation step: top-level environment is configured") |
There was a problem hiding this comment.
BuildDefaultSecretValidationStep dereferences workflowData (workflowData.EngineConfig) before any nil check. Since the function now explicitly handles nil workflowData for the environment check, calling it with a nil workflowData would panic. Add an early if workflowData == nil { ... } guard (or fold workflowData != nil into the existing EngineConfig check) before accessing workflowData.EngineConfig.
🧪 Test Quality Sentinel ReportTest Quality Score: 80/100✅ Excellent test quality
Test Classification Details
Test Descriptions
Score Breakdown
Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §24482807335
|
|
@copilot review all comments |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f835cc24-6ee6-4012-9776-08ab293cff4d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f835cc24-6ee6-4012-9776-08ab293cff4d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done — I reviewed and addressed the actionable review feedback. I fixed the nil dereference risk in |
make agent-finish) and capture any unrelated pre-existing failures