Conversation
|
@dsyme when a user prompts CCA to generate a new AW, we should generate a warning if the generated AW uses secrets or uncommon actions. This is why we need to support the scenario where no lock file already exists. |
There was a problem hiding this comment.
Pull request overview
This PR updates the CLI approval flag naming and adjusts safe-update behavior so first-time compiles (no prior manifest) don’t trigger safe-update enforcement.
Changes:
- Renames the CLI flag
--approve-updatesto--approveacross compile/run/upgrade and updates related tests. - Skips safe update enforcement when no prior manifest exists, establishing the initial lockfile as the baseline.
- Updates safe-update remediation messaging and integration/unit test expectations accordingly.
Show a summary per file
| File | Description |
|---|---|
cmd/gh-aw/main.go |
Renames compile/run flag to --approve and tweaks help text. |
pkg/cli/upgrade_command.go |
Renames upgrade flag to --approve and adjusts logging. |
pkg/workflow/safe_update_enforcement.go |
Skips enforcement when manifest is nil; updates remediation text to --approve. |
pkg/workflow/safe_update_enforcement_test.go |
Updates unit tests for new first-compile behavior and new flag name in guidance. |
pkg/cli/compile_safe_update_integration_test.go |
Updates integration tests to expect no first-compile warnings; replaces --approve-updates with --approve. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 3
…cement on first compile - Rename --approve-updates flag to --approve in compile, run, and upgrade commands - Change first-compile behavior: skip enforcement when no prior manifest exists instead of flagging all new secrets/actions (baseline is created silently) - Update remediation message to reference --approve instead of --approve-updates - Update all tests to reflect new first-compile behavior
c5330fc to
366ab3e
Compare
|
@pelikhan Got it, these changes were on my machine and seemed like they had not been correctly applied, but they're actually the reverse of the updates you made
How about the case where a lock file without a manifest already exists? This is the case for all repo-assist installs. We were getting a lot of crazy warnings on updates to repo-assist that seemed too much. |
|
Turn it off for now, needs more refinement. |
…or legacy lock files without manifest
Distinguish between two nil-manifest cases:
- No lock file exists (new workflow): pass &GHAWManifest{} (empty non-nil) to
EnforceSafeUpdate so all new secrets/actions are flagged for review
- Lock file exists without a gh-aw-manifest section (legacy): pass nil to
EnforceSafeUpdate which skips enforcement
This restores SECURITY REVIEW REQUIRED warnings on first compilation while
still allowing legacy lock files to upgrade without false positives.
🧪 Test Quality Sentinel ReportTest Quality Score: 80/100✅ Excellent
Test Classification DetailsView All Test Classifications (5 tests)
Observations
|
- Add --approve flag to compile, run, and upgrade command options in
cli.md; explain safe update mode enforcement behavior and when to use it
- Document protected-files object form ({ policy, exclude }) in
safe-outputs-pull-requests.md; covers how to exempt specific files
(e.g. AGENTS.md) from the default protected set without disabling
all protection
From PRs: #26350 (--approve rename), #26339 (protected-files exclude)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Two related fixes that were present in the working tree but not included in any previous PR.
1. Rename
--approve-updates→--approveThe
--approve-updatesflag has been renamed to--approveacross all three commands that use it:gh aw compilegh aw rungh aw upgrade2. Skip safe update enforcement on first compile
Previously, when no prior manifest existed (first compilation of a workflow), the compiler would treat it as an empty baseline and flag all new secrets and custom actions with a
SECURITY REVIEW REQUIREDwarning.This was overly aggressive: on first compile there is no prior state to compare against, so there is nothing to "enforce". The new behavior skips enforcement entirely when no manifest exists — the newly generated lock file creates the baseline, and enforcement kicks in on subsequent compilations when actual changes are detected.
Files changed
cmd/gh-aw/main.go— rename flag in compile and run commands; minor help text fixpkg/cli/upgrade_command.go— rename flag in upgrade commandpkg/workflow/safe_update_enforcement.go— skip enforcement when manifest is nil; update remediation messagepkg/workflow/safe_update_enforcement_test.go— update test expectationspkg/cli/compile_safe_update_integration_test.go— update integration test expectations and--approve-updates→--approve