Skip to content

Rediscover the App installation ID when the target repo changes - #176

Merged
asavs merged 1 commit into
mainfrom
fix/repoint-target-repo
Jul 29, 2026
Merged

asavs merged 1 commit into
mainfrom
fix/repoint-target-repo

Conversation

@asavs

@asavs asavs commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Repointing a configured deployment at a new repository wrote the new REVIEWER_REPO alongside the previous repo's REVIEWER_APP_INSTALLATION_ID, so the daemon minted tokens for the old installation and 404d on every call against the new repo — while the summary reported success.

configure-inner.sh seeded the installation ID from reviewer.env whenever --installation-id was omitted, so the auto-discovery branch never ran. configure.sh could not repoint at all: it never re-prompted for a REVIEWER_REPO that was already set.

Both entry points now treat a changed repo as a repoint — the inherited ID is dropped so it gets rediscovered, an explicit --installation-id still wins, and the summary prints the resolved ID (its absence is why this failed silently).

Also gitignores config/*.bak*: an operator backup of reviewer.env left the checkout dirty, which makes sync-worktree.sh refuse to sync and skip the tick entirely.

Verification

Run against the live VM and the real GitHub API, using an isolated env file:

case before after
repoint to a new repo kept the old ID, reported success rediscovers the correct ID
no repo change — no extra API call, ID preserved
explicit --installation-id — respected, no rediscovery

Known gap

No fixture coverage: the suite is scoped to scripts/reviewer/ and mocks reviewer libs, so a setup-script test does not fit it without a new harness. Verified end-to-end by hand instead — stronger evidence than a mock, but no regression guard. A scripts/tests/ harness for setup scripts would be its own piece of work.

…hanges

Repointing a configured deployment at a new repository wrote the new
REVIEWER_REPO alongside the previous repo's REVIEWER_APP_INSTALLATION_ID:
configure-inner.sh seeded the ID from reviewer.env whenever --installation-id
was omitted, so the auto-discovery branch never ran. The daemon then minted
tokens for the old installation and 404d on every call against the new repo,
while the summary reported success. configure.sh could not repoint at all --
it never re-prompted for a REVIEWER_REPO that was already set.

Both entry points now treat a changed repo as a repoint: the inherited
installation ID is dropped so it gets rediscovered, an explicit
--installation-id still wins, and the summary prints the resolved ID.

Also gitignore config/*.bak*, so an operator backup of reviewer.env no
longer leaves the checkout dirty and makes sync-worktree.sh skip the tick.
@asavs
asavs merged commit f4238d5 into main Jul 29, 2026
1 check passed
@asavs
asavs deleted the fix/repoint-target-repo branch July 29, 2026 06:00
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