Repository navigation
Issue #174 - #177
Issue #174#177
Conversation
Introduce orchestrator.yaml's github_repo key (orc_github_repo reader, validated owner/repo, fail-closed) and thread it through as GH_REPO: `orc up` exports it into the tmux session env before any pane exists; every scripted gh call site in watch.sh, orc-seed-merge-watch.sh, and orc-worktree.sh's PR creation is pinned with --repo; the merge/review watchers and the seed helper refuse to poll/seed at all when it's unset rather than guessing at the wrong repo. `orc init` derives a default from the target's own git origin remote and round-trips it through --force resync. Closes #174.
|
REQUEST-CHANGES 1.
|
1. bin/orc: GH_REPO now reaches pane 0. tmux new-session creates the
session AND spawns pane 0's shell in the same step, so a
`set-environment` call issued afterward updates the session's
environment table too late for pane 0 -- only panes spawned by a
later split-window picked it up (the existing test only ever
checked one of those, pane 0.4, so it passed regardless). Pass
`-e GH_REPO=...` directly on the `new-session` invocation instead,
confirmed empirically to cover pane 0 as well as every later split
pane. Wrapped the (possibly empty) -e args in the
`${arr[@]+"${arr[@]}"}` idiom -- bash 3.2 (macOS's system bash, which
these scripts run under) throws "unbound variable" on a plain
`"${arr[@]}"` expansion of an empty array under `set -u`.
2. lib/watch.sh: reworded the once-per-watcher-start GH_REPO-unset log
line in both merge_watch_check/review_watch_check. The old wording
("...until orchestrator.yaml's github_repo is configured") implied a
live yaml edit alone would be picked up; these watchers only read
GH_REPO from their own process env at session start and never
re-parse the yaml, so a misconfigured room stayed silently dead
forever once the dedup flag suppressed further warnings. Now says
explicitly that a room restart ('orc up' again after killing the
session) is required.
Tests: added a pane-0 GH_REPO check in tests/orc.test.sh (the exact gap
agy's review pointed at) and a message-content assertion in
tests/watch.test.sh for both watchers. Full suite green (33 files, 0
failures).
|
APPROVE Probe List (Round 2):
Both |
There was a problem hiding this comment.
Pull request overview
Implements Issue #174 by introducing a github_repo orchestrator.yaml scalar that is exported as GH_REPO, and then pinning scripted gh invocations to that repo (via --repo "$GH_REPO"), with watcher/seed paths failing closed when the repo is not configured.
Changes:
- Add
github_repoconfig plumbing (orc_github_repo,orc initrender/round-trip,orc upexport into tmux session env). - Pin watcher
ghcalls inlib/watch.shand add fail-closed behavior whenGH_REPOis unset (with once-per-process warnings). - Add/extend test coverage to assert fail-closed behavior and
--repopinning across watcher, seeding, and worktree flows.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/watch.test.sh | Sets a default GH_REPO for legacy tests; adds fail-closed + --repo pinning assertions. |
| tests/orc.test.sh | Adds validation tests for orc_github_repo; asserts orc up propagates GH_REPO into tmux panes and warns when unset/invalid. |
| tests/orc-worktree.test.sh | Verifies gh pr create is pinned when GH_REPO is set and unchanged when unset. |
| tests/orc-seed-merge-watch.test.sh | Ensures seeding refuses to write state when GH_REPO is unset (avoids poisoning idempotent guard). |
| tests/orc-init.test.sh | Ensures orc init renders github_repo from explicit answers and auto-derives from git origin when possible. |
| tests/orc-init-force.test.sh | Ensures --force answers round-trip and re-derive behavior includes github_repo. |
| templates/orchestrator.yaml | Documents new github_repo key and its operational effect on scripted gh calls. |
| orchestrator.yaml | Sets github_repo for this repo. |
| lib/watch.sh | Pins gh calls with --repo "$GH_REPO" and fails closed when unset (logs once per watcher start). |
| lib/orc-worktree.sh | Adds optional --repo "$GH_REPO" pinning for gh pr create. |
| lib/orc-seed-merge-watch.sh | Refuses to seed when GH_REPO is unset to keep seeding retryable. |
| lib/orc-config.sh | Adds orc_github_repo reader/validator for github_repo. |
| bin/orc | Exports GH_REPO from validated config into the tmux session environment (tmux new-session -e). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #174.