You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A meta repo that checks out N repos can now open a PR into each repo's own
target branch, instead of a single target-branch applied to all. The base-ref
deepening (prepare-pr-base) uses the per-repo target so the diff base resolves
for each repo, and Stage 3 opens each PR into its resolved target.
New create-pull-request config (collision-free — target-branch stays a literal):
- target-branch: literal fallback (default main), unchanged.
- target-branches: per-alias literal overrides (highest precedence).
- infer-target-from-checkout-ref: opt-in bool; a checkout repo with no explicit
override targets its own repos: ref. self never infers.
Resolution (shared by the compiler's deepening and Stage 3's PR creation, so the
deepened branch always matches the PR base): target-branches[R] > inferred ref >
target-branch > main.
- CreatePrConfig gains target_branches + infer_target_from_checkout_ref +
resolve_target_branch(); ExecutionContext gains repo_refs (populated at Stage 3
and used to resolve per-repo targets).
- prepare-pr-base emits/consumes repeated `--repo-dir <dir> --target-branch
<branch>` pairs (per-dir target); double-quoted ADO-macro dir, single-quoted
literal branch (shellcheck-clean).
- Resolver unit matrix + compile-integration (meta repo, diverse refs) + bundle
multi-target tests; docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@@ -326,7 +327,36 @@ This hybrid approach combines:
326
327
Note: The source branch name is auto-generated from a sanitized version of the PR title plus a unique suffix (e.g., `agent/fix-bug-in-parser-a1b2c3`). This format is human-readable while preventing injection attacks.
327
328
328
329
**Configuration options (front matter):**
329
-
- `target-branch` - Target branch to merge into (default: "main")
330
+
- `target-branch` - Target (base) branch the PR merges into (default: "main"). A
331
+
plain literal branch name, applied to every repo unless overridden below.
332
+
- `target-branches` - Optional map of per-repository target-branch overrides,
333
+
keyed by the repository alias the agent passes to `create-pull-request` (`self`
334
+
or a `checkout:` alias). Highest precedence. Lets a multi-checkout ("meta repo")
335
+
agent open a PR into a different base branch per repo.
336
+
- `infer-target-from-checkout-ref` - Optional bool (default: false). When `true`,
337
+
a checkout repo with no explicit `target-branches` entry targets its own
338
+
`repos: ref` (the branch it was checked out at). `self` and repos without a
339
+
known ref fall back to `target-branch`. It is a separate boolean (not a magic
340
+
`target-branch` value) so a real branch name can never be mistaken for a
341
+
directive.
342
+
343
+
**Per-repo target resolution precedence** (for a repo `R`): `target-branches[R]`
`main`. The same resolution drives both the credentialed base-ref deepening (so
346
+
the branch that is fetched/deepened matches the branch the PR targets) and the
347
+
Stage 3 PR creation. Example (meta repo):
348
+
```yaml
349
+
repos:
350
+
- name: my-org/service # checked out at refs/heads/main
351
+
- name: my-org/docs
352
+
ref: refs/heads/gh-pages
353
+
safe-outputs:
354
+
create-pull-request:
355
+
target-branch: main # self + fallback
356
+
infer-target-from-checkout-ref: true # service → main, docs → gh-pages (from their refs)
357
+
target-branches:
358
+
docs: gh-pages # (redundant here; shown as an explicit override)
359
+
```
330
360
-`draft` - Whether to create the PR as a draft (default: **true**). Set to `false` to publish the PR immediately. **Note:**`auto-complete` is silently skipped on draft PRs — set `draft: false` when using `auto-complete: true`.
331
361
-`auto-complete` - Set auto-complete on the PR (default: false). Requires `draft: false` to take effect.
332
362
-`delete-source-branch` - Delete source branch after merge (default: true)
0 commit comments