Repository navigation
[refactor] Unify remote dependency fetch policies - #79431
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully!
|
This comment has been minimized.
This comment has been minimized.
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
There was a problem hiding this comment.
What this change does: It runs six remote dependency fetches through a shared policy table. It preserves their existing failure and warning behavior.
Should fix
- Remove redundant policy flags. The six steps use only two independent policy choices. Three flags repeat those choices, making each entry longer and allowing inconsistent combinations. Derive those flags from
fatalAlwaysandwarnAlways; otherwise, future changes must keep the duplicate settings in sync.
Verdict: Ship after simplifying the policy table.
Lean: -14 lines possible.
Generated by ✂️ Ponytail Reviewer for #79431 · codex · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ⊞ 185
Comment /ponytail to run again
| fatalAlways bool | ||
| warnWhenVerbose bool | ||
| warnAlways bool | ||
| warnBeforeFatal bool |
There was a problem hiding this comment.
All six steps make fatalWhenStrict the inverse of fatalAlways, warnBeforeFatal equal to fatalAlways, and warnWhenVerbose the inverse of warnAlways; keep only fatalAlways and warnAlways and derive the rest to remove redundant settings and invalid combinations.
There was a problem hiding this comment.
Reduced each step to fatalAlways and warnAlways; strict fatality and verbosity behavior are now derived. Commit adb7d977.
There was a problem hiding this comment.
Reviewed the changed remote dependency policy refactor and its regression coverage. I found no actionable correctness, compatibility, security, or performance issues in the changed lines. Existing fatality and warning behavior appears preserved across strict and non-strict modes.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again
Comment MemoryPeek at saved memory (spec-review-history)History |
🏗️ Design Decision Gate — ADR RequiredThis PR makes significant changes to core business logic (>100 new lines) but does not have a linked Architecture Decision Record (ADR). 📄 Draft ADR committed:
🔍 Evidence
📋 What to do next
Once an ADR is linked in the PR body, this gate will re-run and verify the implementation matches the decision. 📋 Michael Nygard ADR Format ReferenceAn ADR must contain these four sections to be considered complete:
All ADRs are stored in References: §44683407338
|
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
🟡 Changes recommended
Replacing warning callbacks with counters leaves activation-warning output and strict/verbose error-detail handling untested, allowing output regressions to pass unnoticed.
1 open issue
What changed in this PR
Centralizes remote dependency fetching in the gh-aw CLI using an ordered policy table, preserving the existing behavior requested in #79392.
Changes:
- Defines explicit failure and warning policies for all six fetch steps.
- Shares error handling while retaining step order, strict-mode behavior, and error wrapping.
- Adds table-driven tests covering strict and verbose modes, warning calls, and early termination.
| File | Description |
|---|---|
pkg/cli/remote_workflow_test.go |
Adds regression coverage for fetch policies and execution order. |
pkg/cli/includes.go |
Extracts the ordered policy table and shared runner; updates behavior comments. |
Review effort: Balanced (adaptive)
| warningCount := 0 | ||
| for i := range steps { | ||
| steps[i].warn = func(error) { | ||
| warningCount++ | ||
| } | ||
| } | ||
|
|
||
| err := runRemoteDependencySteps(steps, strict, verbose) |
There was a problem hiding this comment.
Kept the real warning handlers while counting calls and capturing stderr. The test verifies the activation warning, verbose-only error detail, and no strict-mode output. Commit adb7d977.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /codebase-design and /tdd. The refactor preserves behavior, and the new table-driven test passes (24 subtests, go vet and gofmt clean). Three non-blocking suggestions are inline.
📋 Key Themes & Highlights
Key Themes
- Policy encoding:
warnBeforeFataldepends onwarnWhenVerbose, and the verbosity source is split between the step hook and the runner. - Test gap: warning text and stderr routing are not asserted; only warning counts are.
Positive Highlights
- ✅ Each step declares its label, fatality, and warning policy in one ordered table.
- ✅ Original strict/non-strict and verbose behavior is preserved, and the wrapped error format (
failed to fetch <label>: %w) is unchanged. - ✅ Table-driven coverage checks which later steps run after a failure.
Note: the review used the pr-triage output. Its claim of 288 test cases is incorrect; the table produces 24 subtests.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~7 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| fatalAlways bool | ||
| warnWhenVerbose bool | ||
| warnAlways bool | ||
| warnBeforeFatal bool |
There was a problem hiding this comment.
[/codebase-design] warnBeforeFatal only takes effect when warnWhenVerbose is also set (the runner checks both, line 876), so setting it alone silently does nothing. Every fatalAlways step sets it and no other step does, so it could be derived from fatalAlways. Either way, the five booleans allow invalid combinations and the warning rules are hard to audit.
💡 Possible shape
Keep one explicit fatal policy and one explicit warning policy per step, e.g. fatal: fatalNever | fatalStrict | fatalAlways and warn: warnNever | warnVerbose | warnAlways. A short comment on the struct stating the rules ("always-fatal steps warn before returning in verbose mode; strict-fatal steps do not") would make the table easy to audit.
@copilot please address this.
There was a problem hiding this comment.
Reduced the policy fields to fatalAlways and warnAlways; strict failure and warning behavior are derived, removing invalid combinations. Commit adb7d977.
| warnAlways: true, | ||
| warn: func(err error) { | ||
| fmt.Fprintln(os.Stderr, console.FormatWarningMessage("Failed to fetch runtime-import dependencies; activation may fail")) | ||
| if verbose { |
There was a problem hiding this comment.
[/codebase-design] The runtime-import warning reads verbose from the remoteDependencySteps argument, while the runner reads the same flag from its own argument (line 920). Nothing passes different values today, but the contract is implicit: two sources of truth for one flag.
💡 Suggestion
Pass verbosity into the hook, e.g. warn func(err error, verbose bool), so the runner is the only place verbosity is read. The runtime-import closure then takes verbose as an argument instead of capturing it.
@copilot please address this.
There was a problem hiding this comment.
Warning callbacks now receive verbosity from the runner, so the runtime-import warning no longer captures a second verbosity value. Commit adb7d977.
| steps := remoteDependencySteps(fetchers, verbose) | ||
| warningCount := 0 | ||
| for i := range steps { | ||
| steps[i].warn = func(error) { |
There was a problem hiding this comment.
[/tdd] The test replaces every warn hook with a counter, so warning text and stderr routing are never asserted. The runtime-import message ("activation may fail") and its verbose-only detail line are untested, as is the remoteDependencyWarning formatting.
💡 Suggested test
Keep the counter for the policy assertions and add a focused case that captures stderr (the os.Pipe pattern used around line 1254) for the runtime-import step. Assert the message in non-verbose mode and the error detail in verbose mode, using substrings only so the test is not brittle.
@copilot please address this.
There was a problem hiding this comment.
The real callbacks are preserved and stderr is captured; assertions cover the activation warning, verbose-only error details, and strict-mode silence. Commit adb7d977.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "9b9a60497b5769e479c2adc88c3a94a7415bf457",
"kind": "requested",
"schema_version": "1",
"state": "1d20dc80be93ee07a596f41e0ebe3cdf067a28fa0d5386d2944c16fce9162f51",
"work": [
"13c595bd5b5e7d01e6bac6a98d305a475be623e5ab097d3d8c9d296b845b400e",
"1db9d56fbd2ad9f8aa6741a864e80ce281dcca65782035cc432ad1cd7aa06fe2",
"2e69dc8f16d66e7dc400c07dc3888fecd72ccf0ff37525dc56c475b544441731",
"9d26470c93e051581c3c1d01fc22ccf2687ca0b9181656e51409aa1420bf1b7e",
"cfacefa7dc421417c98662f95db0cc2355d0c6758fc9083c9bc6e58f0e25f46d"
],
"workflow": "pr-sous-chef"
}
|
…y-strict-mode-policy Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged latest |
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "adb7d9773a3ae04c7e5b7d19e5d7621a96ea5a44",
"kind": "requested",
"schema_version": "1",
"state": "6e10c29f87d39507a788f1dbc62886b3f80a92235a3f5afa9a505dc3a8b82290",
"work": [
"0215fa6a7e95d212b943e1dcdbb6a5dd7a082cda1dd71a971263c5c8122eb0a6"
],
"workflow": "pr-sous-chef"
}
|
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|

Strict mode currently affects only some remote dependency fetchers, while other failures always stop processing. This refactor centralizes all six steps and preserves their existing failure and warning behavior.