Skip to content

fix: a failing forge is reported alone, with its reason and its fix - #44

Merged
bspeelm merged 3 commits into
mainfrom
fix/failing-forge-reported-alone
Nov 24, 2026
Merged

bspeelm merged 3 commits into
mainfrom
fix/failing-forge-reported-alone

Conversation

@bspeelm

@bspeelm bspeelm commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

An expired GitLab token emptied every section of the GitHub PRs GitHub had just returned, pullpen config check called that token "signed in", and nothing said why or what to type.

What changes

  • One forge failing no longer hides the other's PRs. A sync pass now shows the rows from the forges that answered; the status line still marks the one that failed. Only a pass every forge answered is cached or counted as "synced".
  • A rejected token says why and what to run. A 401 keeps the forge's own reason (Error::Rejected), and where the token came from decides the fix: pullpen setup <host> for a stored token, gh/glab auth login for a borrowed login, the variable name for an environment token.
  • pullpen config check asks the forge. It reports signed in (as whom), rejected (with reason and fix), or not checked (forge unreachable), instead of only finding that a token exists.
  • pullpen setup <host> signs in to one configured forge again and asks nothing else (ADR-030).

Proof

Claim Test
A failing forge does not hide the other's PRs, says why and what to run, and a partial list is not cached live::tests::one_forge_failing_does_not_hide_the_others_prs
A 401 keeps the forge's reason a_rejected_token_keeps_the_forges_reason
The fix depends on where the token came from the_fix_names_where_the_token_came_from
A rejected token fails the check with its fix a_token_the_forge_rejects_fails_the_check_with_its_fix
An unreachable forge is not called signed in an_unreachable_forge_is_not_called_signed_in
setup <host> asks nothing else and stores the new token renewing_one_host_asks_nothing_else_and_stores_the_new_token
An unconfigured host is refused renewing_a_host_that_is_not_configured_says_so

The first test was written before the fix and failed:

---- live::tests::one_forge_failing_does_not_hide_the_others_prs stdout ----
panicked at crates/pullpen/src/live/tests.rs:133:23:
GitHub answered, so its PR is shown
test result: FAILED. 0 passed; 1 failed

make check after the last commit:

binary:   8850784 bytes (budget 10485760)
code:     11286 lines (budget 11500)
comments: 1172 lines, 10.3% of code (budget 30%)
prose:    2518 lines, 22.3% of code (budget 75%)

Run against the release binary:

$ PULLPEN_GITLAB_TOKEN=bogus pullpen config check    # exit 1
✓ github.com: signed in as …
✗ gitlab.com: token rejected (Invalid token)
    fix: replace the token in $PULLPEN_GITLAB_TOKEN

$ pullpen setup gitlab.example
pullpen is not set up for gitlab.example; `pullpen setup` adds a forge

In the TUI with the same bogus token, the status line read E gitlab.com rejected the token: Invalid token · replace the token in $PULLPEN_GITLAB_TOKEN, GitHub's sections filled, and no cache file was written.

Unverified

  • pullpen setup <host> end to end on a real terminal with a real expired token: covered by its tests only.
  • GitLab's 401 body for an expired token on its GraphQL endpoint. The error_description shape was observed on REST; a bogus token on GraphQL returned "Invalid token".

Not in this change

  • The status line holds one error at a time, so with both forges down only the last shows ✗. Fixing it needs a design change in design/tui.js first.
  • docs/north-star.md and docs/PLAN.md §10 still say pullpen stores no credentials, stale since ADR-012.

🤖 Generated with Claude Code

bspeelm and others added 3 commits November 24, 2026 15:38
A sync pass sent a section's rows only when every forge had answered, so
an expired GitLab token emptied sections of PRs GitHub had just returned.
The rows from the forges that answered are now shown, and the status line
still marks the one that failed. Only a pass every forge answered is
cached or counted as "synced".

Proved by live::tests::one_forge_failing_does_not_hide_the_others_prs,
which failed before this change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A 401 became "not signed in", with the forge's reason thrown away, and
`pullpen config check` called a token "signed in" because it existed.

The forge's reason is now kept (Error::Rejected), the place the token came
from decides the fix, and both reach the status line. `config check` asks
each forge whose token it is, and separates signed in, rejected and
unreachable.

Proved by a_rejected_token_keeps_the_forges_reason,
the_fix_names_where_the_token_came_from,
a_token_the_forge_rejects_fails_the_check_with_its_fix,
an_unreachable_forge_is_not_called_signed_in and
one_forge_failing_does_not_hide_the_others_prs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The fix for an expired stored token was the whole first-run walk. With a
host, setup asks only that forge's sign-in question and saves only the
credentials (ADR-030). It is the command the status line and
`pullpen config check` name when a forge rejects a stored token.

Proved by renewing_one_host_asks_nothing_else_and_stores_the_new_token
and renewing_a_host_that_is_not_configured_says_so.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@bspeelm
bspeelm enabled auto-merge (squash) November 24, 2026 20:43
@bspeelm
bspeelm merged commit 284dc87 into main Nov 24, 2026
15 checks passed
@bspeelm
bspeelm deleted the fix/failing-forge-reported-alone branch November 24, 2026 20:45
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