Skip to content

fix(plugins): keep ports when matching git remotes to integration instances - #3399

Merged
jschwxrz merged 3 commits into
generalaction:mainfrom
Kulraj69:fix-forgejo-port-host-check
Nov 2, 2026
Merged

jschwxrz merged 3 commits into
generalaction:mainfrom
Kulraj69:fix-forgejo-port-host-check

Conversation

@Kulraj69

@Kulraj69 Kulraj69 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Description

When a git remote URL (SSH or HTTPS) includes an explicit port, checkRemoteHostMatchesInstance now compares it against the integration instance's port instead of splitting the host on the first : and losing the port. A new splitHostPort helper parses host, port, and protocol from SCP-style, SSH, and HTTPS remotes, including IPv6 literals; remotes without an explicit port match on hostname only, so existing behavior is unchanged.

Related issues

Fixes #3395

Testing

  • 8 new tests in hosted-instance.test.ts and repository-remote.test.ts cover remotes with and without ports across SCP-style, SSH, and HTTPS URLs, plus IPv6 literals.
  • Full @emdash/plugins suite: 677 passed, 1 skipped, 0 failed.
  • tsc --noEmit currently crashes with an internal compiler error; the identical crash occurs on a clean checkout, so it is pre-existing and unrelated to this change.

AI assistance

This change was researched, implemented and tested with AI assistance acting on my behalf, and reviewed before submission.

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Updates checkRemoteHostMatchesInstance to compare retained remote ports with the configured instance port.

  • Remote hosts match their configured instance by hostname and explicit port.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "Add tests for remote repository resoluti..." · Reviewed by Greptile

@jschwxrz

jschwxrz commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

lgtm! thank you!

@jschwxrz
jschwxrz merged commit 5922811 into generalaction:main Nov 2, 2026
7 checks passed
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.

[bug]: host check fails for instances on a non-default port

2 participants