feat(adopt): non-interactive --include ancestors for remote adoption#756
feat(adopt): non-interactive --include ancestors for remote adoption#756simsinght wants to merge 2 commits into
Conversation
🔃 FlexReview StatusCommon Owner:
Review SLO: |
There was a problem hiding this comment.
Code Review
This pull request introduces a new --include ancestors flag to the av adopt command, enabling non-interactive adoption of a remote branch and its ancestors. It includes updates to the command-line documentation, enhances the mock GitHub GraphQL server in end-to-end tests to support querying pull requests by number, and adds corresponding test coverage. The feedback suggests registering a shell completion function for the new --include flag to improve the CLI user experience.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| adoptCmd.Flags().StringVar( | ||
| &adoptFlags.Include, "include", "", | ||
| "with --remote, non-interactively adopt the named branch and related branches\n(ancestors)", | ||
| ) |
There was a problem hiding this comment.
To improve the CLI user experience, we can register a shell completion function for the new --include flag. Since the only valid value currently is ancestors (defined in adoptIncludeValues), we can provide this directly to Cobra's shell completion mechanism.
adoptCmd.Flags().StringVar(
&adoptFlags.Include, "include", "",
"with --remote, non-interactively adopt the named branch and related branches\n(ancestors)",
)
_ = adoptCmd.RegisterFlagCompletionFunc(
"include",
func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return adoptIncludeValues, cobra.ShellCompDirectiveNoFileComp
},
)av adopt --remote opens an interactive picker, which is awkward for scripts and agents mirroring a coworker's stack. Add --include ancestors to skip the picker and adopt the named branch plus its ancestors up to the trunk in one shot. --dry-run prints the adoption plan. Also extend the e2e harness: the mock GitHub server now answers the pullRequest(number:) query used to walk parent PRs, and mock-pull accepts base=<ref> and body=<file> so a remote stack with av metadata can be modeled in tests.
f364378 to
0efd2fc
Compare
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
pls 🙏 my Claude needs non-interactive adoption of entire stacks
What
av adopt --remote <branch>always drops into the interactive picker, which is a wall for scripts and agents trying to mirror a coworker's stack locally. This adds an--include ancestorsflag that skips the picker:It adopts the named branch and its ancestor chain up to the trunk without prompting. Bare
--remotestill opens the picker, so this is non-breaking.--includeis a validated string flag (onlyancestorstoday) so it can grow todescendants/stacklater without adding new flags.Tests
Extends the e2e harness, which had no coverage of the remote-adopt path:
pullRequest(number:)query used to walk parent PRsmock-pullacceptsbase=<ref>andbody=<file>so a remote stack with av stack metadata can be modeledNew testscript covers the
--dry-runplan and--includevalidation.Stacked on #755.
🤖 Generated with Claude Code