GeezerVison is showing github.com — fix(forgejo): SSH host-alias remotes find their fj login by shivamhwp · Pull Request #38990 · pingdotgg/t3code
Conversation
Refs #38359
A checkout whose remote is an SSH host alias (origin myforge:owner/repo.git) sent the alias to the Forgejo CLI as the host. The remote matched no HTTP(S) URL, so the fj login that keys.json maps to the alias was rejected and tea ran instead. tea isn't installed, so the Issues page showed the "install fj or tea" message even with a working fj login.
An SSH remote whose host is the alias now selects the fj login that keys.json aliases to it. An exact web-host login still wins over an alias login, so logins that share an SSH host keep their exact web-host choice. Other remotes are unchanged.
Tests: vp test run packages/source-control-forgejo passes at this commit (7 files, 84 tests). The new case in ForgejoSourceControlProvider.test.ts (the SSH config alias test) fails on the base commit with expected 'tea' to equal 'fj' and passes with this change. A regression assertion in "does not choose a default Forgejo login across ambiguous SSH server ports" covers two logins that share an SSH host.
Repo check: check:changed against origin/main passes at this commit: format, lint, knip, typecheck of 11 packages, and the tests beside the change.
Not shown: the web Issues page before and after. The reproduction is the mocked unit test, with no real Forgejo, fj binary or ~/.ssh/config.
Not shown: the reporter's desktop app (macOS). It was not run.
Not shown: Forgejo logins that serve plain HTTP through an SSH alias. They still default to HTTPS, as before.
Not shown: the misleading "install" message when fj is present but no login matches. It is unchanged here.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
A checkout whose remote is an SSH host alias (`myforge:owner/repo.git`) sent
the alias as the Forgejo host. The remote matched no HTTP(S) URL, so the fj
login mapped by keys.json aliases was rejected and tea ran instead, which
reported that Forgejo CLI was not installed.
An SSH remote whose host is the alias now selects the fj login that aliases
it. An exact web-host login still wins over an alias login.
Co-Authored-By: Claude Haiku 5.5 <[email protected]>
coderabbitai
Bot
commented
Nov 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
Forgejo login matching now prioritizes exact web-host matches over SSH aliases. Remote discovery accepts matching HTTP(S) and SSH fetch URLs, and marks synthesized remotes as SSH when matches are SSH-only.
Changes: Forgejo Remote Resolution
| Layer / File(s) |
Summary |
Login host matching packages/source-control-forgejo/src/server/ForgejoCli.ts, packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts |
Login matching checks exact web-host matches first, then retries with SSH aliases if no exact match exists. A test verifies that the exact-host login is selected when another login shares its SSH alias. |
SSH remote discovery packages/source-control-forgejo/src/server/ForgejoCli.ts, packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts |
Host-based discovery accepts matching SSH fetch URLs as well as HTTP(S) URLs. When matches are SSH-only, synthesized remotes are marked as SSH. Tests check API requests for an SSH-config alias, a direct SSH hostname, and an IPv6 SSH host, and verify that the requests do not invoke tea. |
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related issues
Possibly related PRs
Suggested labels: bugfix
Suggested reviewers: juliusmarminge, bmmmm
Merge Risk: Minimal · up to e611b
-
SSH host-alias remotes now select the matching fj login instead of falling back to tea. Exact web-host logins keep priority, and other remotes are unchanged. No merge-blocking risk is visible. It was tested only with mocked unit tests, not against a real Forgejo and SSH-config setup.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: SSH host-alias remotes now resolve to the matching fj login. It follows a conventional commit format and matches the PR objective and the description's problem stateme… |
| Description check |
 |
The description follows the template. It has a problem statement, a change summary, a scope note with an issue reference (Refs #38359), and a verification section with concrete test commands and resul… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the main change: SSH host-alias remotes now resolve to the matching fj login. It follows a conventional commit format and matches the PR objective and the description's problem statement.
Full details: Description check
-
Explanation
The description follows the template. It has a problem statement, a change summary, a scope note with an issue reference (Refs #38359), and a verification section with concrete test commands and results. It also lists what was not checked. It does not use the template's headings exactly, and the Problem, Change, and Scope sections are not labeled as such. The author's verification also lists a local hook bypass (--no-verify) only in the comments, not the description, and the Scope section does not say why an issue is needed beyond the linked issue. These gaps are minor.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between cb77e2b and e611b12.
Files selected for processing: 2
-
packages/source-control-forgejo/src/server/ForgejoCli.ts
packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The automated pipeline stopped on this pull request and will not merge it:
the fix is written and reviewed, but proving it needs something no worker has:
- Permanent blocker: The reported reproduction requires macOS desktop outside the device pool, which is unavailable to this worker. Neither the base failure nor the head success was observed.
- Exact web-host login priority, plain-HTTP alias handling, and genuinely unmatched-login diagnostics were not exercised.
It stays open for a person to finish or close.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
[Haiku 5.5][Claude Code] on behalf of shivam.
Handing #38359 to Julius, who opened #39671 (docs: cover plain-HTTP Forgejo servers and SSH-alias remotes). This PR's code is unchanged since 0c8375d. The head moved to 9094001 only through Julius's merge of origin/main.
Reproduced
- Unit level, base commit
7b4478895da: the SSH config alias case fails with expected 'tea' to equal 'fj'. The tea fallback ran, which matches the reported "install fj or tea" message.
- With this change, the same case passes, and the existing ambiguous-SSH-port test covers two logins sharing an SSH host.
- Not reproduced in the web app. Both scenario attempts were cancelled, and the alias only reaches the Issues page as the host when the project's identity was never refined to its web URL. A normal add-project path never produces that state.
- Device: none. No macOS desktop run and no real Forgejo, fj binary or
~/.ssh/config.
Tested at 0c8375d, same diff at 9094001
vp test run packages/source-control-forgejo on Boat: 7 files, 84 tests, passed.
check:changed against origin/main on Boat: format, lint, knip, typecheck of 11 packages, and tests beside the change (52 tests) all passed.
- The local pre-commit hook could not load
vite.config.ts here (no node_modules on corex), so the commit used --no-verify. The same files passed the full check on Boat.
Still open
- A web Issues before-and-after capture.
- The reporter's setup. Julius's question about the group header host and how fj was installed is unanswered.
- macOS desktop app, the reporter's app.
- Forgejo plain-HTTP logins reached through an SSH alias still default to HTTPS, as before.
- The "install" message when fj is present but no login matches is unchanged.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Thanks for this. Before a bug fix is taken further, the bug is reproduced on current main, and here it did not appear.
I ran the steps from #38359 against current main (9292b03) with a real Forgejo 11 server on HTTPS, fj 0.7.0 signed in with a token, and no tea installed. fj's keys.json mapped the alias myforge to the server's web host, an SSH Host myforge entry pointed at Forgejo's SSH port, and the checkout's origin was myforge:owner/repo.git. I added it as a project in the web client and opened Issues.
The Issues page listed the repository's issue through the fj login, with no tea fallback and no install message. When the project is added, its Forgejo identity is resolved through that fj login to the server's web address, and the issue tracker uses that web host, not the alias. I couldn't find a path in the app where the alias reaches the explicit-host lookup this PR changes; you flagged the same open question in the description. One difference: I ran the web client on Linux, not the macOS desktop app, but the code involved is all server-side.
The report came from the 2026-11-17 nightly, and several Forgejo and issue-tracker fixes have landed since. If you still see the install message on a current build, a note on how the project was added and what host the Forgejo group header shows would help us find the path that keeps the alias.
Closing this pull request. If it still happens for you, please open an issue with the exact steps, what you see, and the version and platform you are on; a fix is picked up from there.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:M
30-99 changed lines (additions + deletions).
takeover:blocked
Takeover blocked; reason in the PR body
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|