Skip to content

integration: Wire auto-rebuild hook on restack commands#1174

Open
ed-irl wants to merge 4 commits into
ed-irl/integration-handlerfrom
ed-irl/integration-cli
Open

integration: Wire auto-rebuild hook on restack commands#1174
ed-irl wants to merge 4 commits into
ed-irl/integration-handlerfrom
ed-irl/integration-cli

Conversation

@ed-irl

@ed-irl ed-irl commented May 19, 2026

Copy link
Copy Markdown
Collaborator

The four restack commands (branch, stack, upstack, repo) now invoke
IntegrationHandler.MaybeRebuild after a successful restack, so a restack
that moves a tracked tip automatically rebuilds the integration branch
when one is configured. Each command's Run gains an IntegrationHandler
parameter and returns early on restack failure before the hook runs.

The integration_auto_rebuild test script covers the end-to-end flow:
amending a tip drifts its hash, the post-restack hook detects the drift
and rebuilds, and a subsequent restack finds no drift and skips the
rebuild.

merge_wt_test.go now sets git user.name/user.email in its scripts so
the merge tests commit successfully in a config-less environment.

Adds an Added changelog entry.

Part of #1244

@ed-irl

ed-irl commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

@ed-irl ed-irl force-pushed the ed-irl/integration-cli branch from e828daf to 2d4078d Compare June 2, 2026 20:08
@ed-irl ed-irl force-pushed the ed-irl/integration-handler branch 3 times, most recently from 9b2df5f to 579bd8f Compare June 2, 2026 20:25
@ed-irl ed-irl force-pushed the ed-irl/integration-cli branch from 2d4078d to 73d812f Compare June 2, 2026 22:20
@ed-irl ed-irl force-pushed the ed-irl/integration-handler branch from 579bd8f to 96ee66a Compare June 8, 2026 11:15
@ed-irl ed-irl force-pushed the ed-irl/integration-cli branch from e34e5ac to 8fa5e62 Compare June 8, 2026 11:15
@ed-irl ed-irl force-pushed the ed-irl/integration-handler branch from 96ee66a to b8affd4 Compare June 12, 2026 20:08
@ed-irl ed-irl force-pushed the ed-irl/integration-cli branch from 8fa5e62 to cf6c41c Compare June 12, 2026 20:08
@ed-irl ed-irl force-pushed the ed-irl/integration-handler branch from b8affd4 to 874ae48 Compare June 13, 2026 13:40
@ed-irl ed-irl force-pushed the ed-irl/integration-cli branch from cf6c41c to 792dee0 Compare June 13, 2026 13:40
@ed-irl ed-irl force-pushed the ed-irl/integration-handler branch from 874ae48 to 2ea1183 Compare June 15, 2026 09:53
@ed-irl ed-irl force-pushed the ed-irl/integration-cli branch from 792dee0 to 5e16a7e Compare June 15, 2026 09:53
@ed-irl ed-irl force-pushed the ed-irl/integration-handler branch from 2ea1183 to 23ee46e Compare June 19, 2026 01:07
@ed-irl ed-irl changed the title integration: Wire gs integration command tree integration: Wire auto-rebuild hook on restack commands Jun 19, 2026
@ed-irl ed-irl force-pushed the ed-irl/integration-cli branch from a879484 to 3d5e823 Compare June 19, 2026 01:07
ed-irl and others added 3 commits June 23, 2026 11:43
Adds the gs integration command tree (alias gs int) backed by the
integration.Handler:

  - show: print configuration and per-tip drift (default subcommand)
  - create: configure the singleton integration branch
  - delete: clear the configuration (leaves the git branch alone)
  - checkout (alias gs intco): switch to the integration branch
  - rebuild: regenerate the branch; --push also submits
  - submit (alias gs ints): force-with-lease push, no PR created
  - tip add/remove/list: manage the tip set
    (add and remove accept multiple branches in one invocation)

A new IntegrationHandler interface in the root package exposes the
handler operations to subcommands and to forthcoming auto-rebuild
hooks. The Kong wiring includes a singleton provider and an
integrationTips completion predictor.

gs branch track now refuses the integration branch name. The
track.Store interface gains Integration(ctx) to support this; the real
state.Store already satisfies it.

End-to-end test scripts cover each command and the cross-cutting
behaviors:

  - integration_create
  - integration_checkout
  - integration_delete
  - integration_rebuild
  - integration_submit
  - integration_tip_add (with variadic args and error cases)
  - integration_tip_rename (gs branch rename rewrites integration tips)
  - integration_branch_cmds_excluded (gs ls hides, gs branch track refuses)
  - integration_conflict_sequential (conflict + git merge --continue +
    gs intrb resume)

Ships the user guide at doc/src/guide/integration.md (wired into
mkdocs nav), regenerated CLI reference, help fixtures, an Added
changelog entry, and the shorthand index.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant