Add fork-based delivery mode for external repos#509
Merged
Conversation
added 7 commits
May 12, 2026 15:41
Add DeliveryMode field to RepoConfig supporting 'direct' (default, push to origin, merge locally) and 'fork' (push to fork remote, open PR against upstream). Changes: - Add DeliveryMode type with DeliveryModeDirect/DeliveryModeFork constants - Add DeliveryMode and UpstreamRemote fields to RepoConfig (YAML: delivery_mode, upstream_remote) - Extend ValidateAqueductConfig: fork mode requires upstream_remote; empty defaults to direct - Extend EnsurePrimaryClone to accept upstreamURL, add/update 'upstream' remote and fetch - Extend prepareDropletWorktreeWithLogger with baseRemote param: 'upstream' tracks upstream/main - Add fork delivery section to CONTEXT.md via ContextParams.RepoConfig - Create cataractae/fork-delivery/ identity (PERSONA.md, INSTRUCTIONS.md) - Add commented fork-mode examples to aqueduct.yaml and cistern.yaml - Update dispatchRepo to pass baseRemote based on DeliveryMode - Update runner.go to pass RepoConfig to ContextParams and UpstreamRemote to EnsurePrimaryClone Tests: DeliveryMode constants, fork validation, EnsurePrimaryClone upstream, prepareDropletWorktree with baseRemote, CONTEXT.md fork section.
…ee tracking Two reviewer issues addressed: 1. drought_hooks.go hookGitSync hardcodes origin/main — fork-mode repos won't fetch upstream refs or reset _primary to upstream/main, causing stale upstream state. Fix: select primary remote and ref based on DeliveryMode (origin/main for direct, upstream/main for fork). Also fetch origin in fork mode so the fork's own refs stay current for delivery. 2. prepareDropletWorktreeWithLogger new-branch path lacks tracking setup for fork mode, creating inconsistency with the resume path which does set --set-upstream-to=upstream/main. Fix: add --set-upstream-to tracking for fresh worktrees when baseRemote is "upstream". Tests added: - TestHookGitSync_ForkMode_FetchesFromUpstream - TestHookGitSync_ForkMode_NonPrimaryNotReset - TestHookGitSync_DirectMode_ResetsToOriginMain - TestPrepareDropletWorktree_ForkMode_NewBranchTrackingSet - TestPrepareDropletWorktree_DirectMode_NewBranchNoUpstreamTracking - Fixed existing test to use for-each-ref for tracking verification
1. drought_hooks.go: move syncSkillsFromRepo inside _primary block (2-tab indent). Previously at 1-tab indent (for-loop level), visually misleading as it appeared outside the for-loop. Skills only need syncing from _primary, not every worktree. 2. fork-delivery/INSTRUCTIONS.md: convert UPSTREAM_URL to OWNER/REPO format for gh CLI. gh pr create --repo expects OWNER/REPO, not a git URL. Added sed conversion supporting both https:// and git@ URL formats. 3. fork-delivery/INSTRUCTIONS.md: add --repo flag to gh pr view for cross-repo PR lookup. Without it, gh pr view only searches the fork repo, not the upstream where the PR was created.
- README: add fork-mode pipeline variant (fork-delivery cataractae) - README: add Delivery Mode section with config field docs and table - README: add fork-mode repo config example with delivery_mode/upstream_remote - README: update git_sync drought hook description for fork-mode behavior - README: update git_sync positioning note to reference primary remote - README: update delivery cataractae description to mention fork mode - CHANGELOG: add entry for fork-based delivery mode feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes droplet ci-0pbgd.
Adds DeliveryMode field to RepoConfig supporting 'direct' (default) and 'fork' (push to fork, PR against upstream). Fixes 5 reviewer findings including: upstream-aware git sync, worktree tracking, invalid DeliveryMode validation, sed URL conversion for repos with dots, and fork owner prefix for cross-repo PRs.