Add features.awf-diagnostic-logs to enable AWF failure diagnostics artifact collection#26699
Add features.awf-diagnostic-logs to enable AWF failure diagnostics artifact collection#26699
features.awf-diagnostic-logs to enable AWF failure diagnostics artifact collection#26699Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/dc6c9098-00e2-4748-a781-c32e4bc85d50 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
features.awf-diagnostic-logs to enable AWF failure diagnostics artifact collection
There was a problem hiding this comment.
Pull request overview
Adds a new workflow frontmatter feature flag (features.awf-diagnostic-logs) that, when enabled, appends --diagnostic-logs to AWF runtime arguments so failed container startups can emit actionable Docker diagnostics into the firewall audit artifacts.
Changes:
- Introduces a new typed feature flag constant for
awf-diagnostic-logsand asserts it in constants tests. - Updates the AWF argument builder to conditionally append
--diagnostic-logswhen the feature is enabled. - Adds unit coverage for default/enabled behavior and documents the new frontmatter flag in reference docs and the glossary.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/awf_helpers.go | Conditionally appends --diagnostic-logs to AWF args based on the new feature flag. |
| pkg/workflow/awf_helpers_test.go | Adds unit test coverage for presence/absence of --diagnostic-logs. |
| pkg/constants/feature_constants.go | Defines the new awf-diagnostic-logs feature flag constant with usage docs. |
| pkg/constants/constants_test.go | Extends feature-flag constant assertions to include the new flag. |
| docs/src/content/docs/reference/glossary.md | Adds awf-diagnostic-logs to the list of common features: flags. |
| docs/src/content/docs/reference/frontmatter.md | Documents features.awf-diagnostic-logs with intent and example usage. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 2
| t.Run("does not include --diagnostic-logs when feature flag is absent", func(t *testing.T) { | ||
| config := AWFCommandConfig{ | ||
| EngineName: "copilot", | ||
| WorkflowData: baseWorkflow(nil), | ||
| AllowedDomains: "github.com", | ||
| } |
| // | ||
| // features: | ||
| // awf-diagnostic-logs: true | ||
| AwfDiagnosticLogsFeatureFlag FeatureFlag = "awf-diagnostic-logs" |
🧪 Test Quality Sentinel ReportTest Quality Score: 75/100
Test Classification Details
Flagged Tests — Requires ReviewNo tests require review. All new tests are well-structured and enforce behavioral contracts. ObservationsTest Inflation (cosmetic, not a blocker)
No action is required here. Edge Case Coverage
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: §24527131841
|
AWF already had a
--diagnostic-logsruntime flag, but workflows had no frontmatter-level control to enable it. This change wires that capability intofeatures:so failed container startup cases can emit actionable Docker diagnostics intofirewall-audit-logs/diagnostics.Feature-flag plumbing
awf-diagnostic-logs.features:+ env override behavior already in place).AWF runtime argument generation
--diagnostic-logsonly when:features.awf-diagnostic-logs: trueCoverage
awf-diagnostic-logsis enabledDocumentation
features.awf-diagnostic-logs.