Skip to content

fix(sources): match repositories by host and path across transports - #12

Merged
im-tyler merged 1 commit into
mainfrom
fix/source-locator-aliases
Oct 21, 2026
Merged

im-tyler merged 1 commit into
mainfrom
fix/source-locator-aliases

Conversation

@im-tyler

Copy link
Copy Markdown
Contributor

A self-hosted forge usually serves SSH and HTTP on different ports, so ssh://git@h:2222/o/r (the app's git:) and http://h:3000/o/r (forge credential / webhook payload) canonicalized apart. Effects: a verified push woke no app ("no app is connected to this repository yet"), and the forge credential was refused as a scope mismatch, leaving only the server poll timer to deploy.

Matching now goes through source.SameRepository (case-folded host + path, no scheme or port) in:

  • routing lookup (RoutesFor)
  • relay re-verification (gitAppMatch)
  • provider scope (Policy) and lookup (CredentialRefFor)

Unchanged: source IDs and webhook URLs (still keyed on the full canonical URL); the forge API base is still derived from the credential's HTTP(S) address, never an SSH port. A webhook only wakes the app's own poll, so a broader match cannot admit anything.

Tests: TestSameRepositoryIgnoresTransport, TestRoutingMatchesAcrossTransports, TestProviderPolicyAcceptsSSHSourceOnAnotherPort, plus a CredentialRefFor case.

Companion: useteploy/teploy-cli#48.

🤖 Generated with Claude Code

A self-hosted forge usually serves SSH and HTTP on different ports, so
ssh://git@h:2222/o/r and http://h:3000/o/r canonicalized apart: the
relay woke no app and the forge credential was refused as a scope
mismatch. Matching (routing, relay re-verification, provider scope and
lookup) now uses host+path; source IDs keep the full canonical URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@im-tyler
im-tyler merged commit 187b4ed into main Oct 21, 2026
3 checks passed
@im-tyler
im-tyler deleted the fix/source-locator-aliases branch October 21, 2026 22:17
@im-tyler im-tyler mentioned this pull request Oct 21, 2026
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