Skip to content

refactor: migrate deprecated RequiredSubcommand and GetGeminiAPITarget callsites to canonical forms#44717

Merged
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-migrate-deprecated-calls
Jul 10, 2026
Merged

refactor: migrate deprecated RequiredSubcommand and GetGeminiAPITarget callsites to canonical forms#44717
pelikhan merged 3 commits into
mainfrom
copilot/deep-report-migrate-deprecated-calls

Conversation

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Three deprecated RequiredSubcommand field usages and one stale GetGeminiAPITarget call remained in pkg/workflow after the Gemini→Antigravity rename (80% complete per #44304).

RequiredSubcommandRequiredSubcommands (pip.go, npm.go)

The slice-based field takes precedence in getRequiredSubcommands(). Migrate the three callsites:

// Before
PackageExtractor{CommandNames: []string{"pip", "pip3"}, RequiredSubcommand: "install", TrimSuffixes: "&|;"}
PackageExtractor{CommandNames: []string{"uvx"}, RequiredSubcommand: "", TrimSuffixes: "&|;"}
PackageExtractor{CommandNames: []string{"npx"}, RequiredSubcommand: "", TrimSuffixes: "&|;"}

// After
PackageExtractor{CommandNames: []string{"pip", "pip3"}, RequiredSubcommands: []string{"install"}, TrimSuffixes: "&|;"}
PackageExtractor{CommandNames: []string{"uvx"}, TrimSuffixes: "&|;"}  // empty == zero value, omit
PackageExtractor{CommandNames: []string{"npx"}, TrimSuffixes: "&|;"}  // same

GetGeminiAPITarget warning block (awf_config.go)

Removes the deprecated call at the old line 516–519 that warned when both GEMINI_API_BASE_URL and ANTIGRAVITY_API_BASE_URL were set simultaneously. Since GEMINI_API_BASE_URL is itself deprecated, this warning is no longer useful.

Note: the else if fallback at line 522 (and domains.go:993) intentionally retain GetGeminiAPITarget — they provide backward compatibility for engine: gemini workflows as required by ADR-34693. Substituting GetAntigravityAPITarget there would always return "" for the gemini engine, silently breaking proxy target routing for all existing Gemini workflows.


Generated by 👨‍🍳 PR Sous Chef · 11.3 AIC · ⌖ 6.74 AIC · ⊞ 4.7K ·
Comment /souschef to run again

…t callsites

- pip.go: RequiredSubcommand: "install" → RequiredSubcommands: []string{"install"} (canonical slice form)
- pip.go: remove redundant RequiredSubcommand: "" from uvxExtractor (zero value)
- npm.go: remove redundant RequiredSubcommand: "" from extractNpxFromCommands (zero value)
- awf_config.go: remove deprecated GetGeminiAPITarget warning comparison block (lines 516-519)
  The else-if fallback for gemini engine backward compat is retained per ADR-34693.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate deprecated GetGeminiAPITarget and RequiredSubcommand callsites refactor: migrate deprecated RequiredSubcommand and GetGeminiAPITarget callsites to canonical forms Jul 10, 2026
Copilot AI requested a review from pelikhan July 10, 2026 12:36
@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category refactor
Risk 🟢 Low
Score 36/100 (impact:14 + urgency:12 + quality:10)
Action batch_review (pr-batch:draft-chores)

Migrates deprecated RequiredSubcommand and GetGeminiAPITarget callsites to canonical forms. 3 files, net -6 lines. Review with similar draft chore PRs.

Generated by 🔧 PR Triage Agent · 206.8 AIC · ⌖ 8.74 AIC · ⊞ 5.4K ·

@github-actions

Copy link
Copy Markdown
Contributor

Hey @copilot-swe-agent 👋 — thanks for cleaning up the remaining deprecated RequiredSubcommand and GetGeminiAPITarget callsites in pkg/workflow! The explanation of why the backward-compat GetGeminiAPITarget fallback is intentionally retained (ADR-34693, proxy target routing for existing Gemini workflows) is particularly helpful for reviewers.

One thing that would strengthen this PR:

  • Add tests — the three PackageExtractor callsites that changed (extractNpxFromCommands, extractPipFromCommands, extractUvFromCommands) don’t appear to have test coverage added for the new RequiredSubcommands field. A quick table-driven test confirming pip install, npx <pkg>, and uvx <pkg> still extract correctly under the new field would give reviewers confidence the rename is fully correct.

If you’d like a hand, you can assign this prompt to your coding agent:

Add unit tests for the three PackageExtractor callsites updated in pkg/workflow/pip.go and pkg/workflow/npm.go.
Cover the following scenarios:
1. extractPipFromCommands: input "pip install requests" → should return ["requests"]
2. extractPipFromCommands: input "pip3 install numpy scipy" → should return ["numpy", "scipy"]
3. extractNpxFromCommands: input "npx create-react-app myapp" → should return ["create-react-app"]
4. extractUvFromCommands with uvx: input "uvx ruff check ." → should return ["ruff"]
Place tests in the corresponding _test.go files alongside the existing test patterns in pkg/workflow/.

Generated by ✅ Contribution Check · 103 AIC · ⌖ 9.85 AIC · ⊞ 6.2K ·

@pelikhan pelikhan marked this pull request as ready for review July 10, 2026 14:37
Copilot AI review requested due to automatic review settings July 10, 2026 14:37
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #44717 does not have the 'implementation' label and has only 7 new lines of code in business logic directories (threshold: 100).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes a small cleanup in pkg/workflow by migrating remaining deprecated PackageExtractor.RequiredSubcommand callsites to the canonical RequiredSubcommands form, and by removing an outdated Gemini-vs-Antigravity override warning now that GEMINI_API_BASE_URL is deprecated.

Changes:

  • Update the pip extractor to use RequiredSubcommands: []string{"install"} instead of the deprecated RequiredSubcommand: "install".
  • Remove redundant RequiredSubcommand: "" zero-value initializations from the uvx and npx extractors.
  • Remove the warning block that compared GetGeminiAPITarget vs GetAntigravityAPITarget when both were configured, while preserving Gemini fallback routing for engine: gemini.
Show a summary per file
File Description
pkg/workflow/pip.go Migrates the pip extractor to RequiredSubcommands and drops a no-op empty RequiredSubcommand for uvx.
pkg/workflow/npm.go Drops the no-op empty RequiredSubcommand for npx, relying on zero values.
pkg/workflow/awf_config.go Removes an obsolete Gemini-vs-Antigravity override warning while keeping the Gemini fallback target path intact.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Low

@github-actions github-actions Bot mentioned this pull request Jul 10, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are correct and clean.

  • pip.go: RequiredSubcommand: "install" properly migrated to RequiredSubcommands: []string{"install"}. Semantically equivalent using the canonical field.
  • pip.go, npm.go: Removing empty RequiredSubcommand: "" fields is correct — zero values are implicit in Go structs.
  • awf_config.go: The deprecation warning removal is safe. The else if fallback preserving GetGeminiAPITarget is correct per the backward-compatibility requirement in the PR body (ADR-34693).

No issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 14.8 AIC · ⌖ 4.31 AIC · ⊞ 4.8K

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /codebase-design — changes are clean and behaviour-preserving; approving.

📋 Key Themes & Highlights

Key Themes

  • Correct zero-value omission: Dropping RequiredSubcommand: "" from the npx and uvx extractors is idiomatic Go — zero values should not be explicitly set. ✅
  • Safe canonical migration: RequiredSubcommand: "install"RequiredSubcommands: []string{"install"} for pip is the right direction given the priority logic in getRequiredSubcommands(). ✅
  • Targeted removal in awf_config.go: The deprecated warning block is cleanly excised without disturbing the backward-compat else if fallback, consistent with ADR-34693. ✅

One Follow-up Opportunity (non-blocking)

package_extraction.go doc comments still show many examples using the deprecated RequiredSubcommand field (lines ~25, 37, 47, 67, 77, 84, 117, 127, 134, 224, 234). These are outside this PR's scope but could mislead future contributors. A follow-up to update those examples to RequiredSubcommands would complete the migration.

Positive Highlights

  • ✅ PR description is clear and traces the rationale thoroughly, including the intentional retention of the backward-compat fallback.
  • ✅ Existing test suite covers the migrated paths — no behaviour change means no new tests required here.
  • ✅ Minimal diff footprint (7 additions / 13 deletions) for the scope of change.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 19.9 AIC · ⌖ 4.43 AIC · ⊞ 6.6K
Comment /matt to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking observations

The three callsite migrations (RequiredSubcommandRequiredSubcommands, empty-string removal) are semantically correct — getRequiredSubcommands() has proper fallback logic and behavior is preserved.

Findings

1. Deleted warning had a bug — fixed by deletion rather than correction (awf_config.go): The removed log block printed geminiTarget twice instead of showing both geminiTarget and antigravityTarget. The PR drops the diagnostic entirely instead of fixing the format string. If operators can still configure both env vars simultaneously, this silently suppresses a useful misconfiguration warning.

2. Test file not migrated (package_extraction_test.go): Tests for pip still use the deprecated RequiredSubcommand field, meaning the new RequiredSubcommands code path is not exercised. Low risk since the fallback logic is trivial, but a complete migration should update the tests too.

🔎 Code quality review by PR Code Quality Reviewer · 39.2 AIC · ⌖ 4.61 AIC · ⊞ 5.4K
Comment /review to run again

Comments that could not be inline-anchored

pkg/workflow/awf_config.go:13

Removed warning had a latent bug — fix silently drops the diagnostic instead of correcting it.

<details>
<summary>💡 Details</summary>

The deleted block at original lines 516–519 had both %s format args pointing to geminiTarget, so the antigravity target was never shown:

// Bug: second arg should be antigravityTarget, not geminiTarget
awfConfigLog.Printf(&quot;...overriding gemini target %s with antigravity target %s&quot;, geminiTarget, geminiTarget)

Rather than fixing the format s…

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, confirm the branch is up to date, and rerun checks to move this PR toward maintainer review.

Generated by 👨‍🍳 PR Sous Chef · 11.3 AIC · ⌖ 6.74 AIC · ⊞ 4.7K ·
Comment /souschef to run again

@pelikhan pelikhan merged commit 8b51845 into main Jul 10, 2026
1 check failed
@pelikhan pelikhan deleted the copilot/deep-report-migrate-deprecated-calls branch July 10, 2026 15:19
Copilot stopped work on behalf of gh-aw-bot due to an error July 10, 2026 15:20
Copilot AI requested a review from gh-aw-bot July 10, 2026 15:20
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Migrate deprecated GetGeminiAPITarget and RequiredSubcommand callsites to canonical forms

4 participants