Files
renovate/lib/modules/manager
Go Takagi 09ba737f09 feat(manager/swift): support SSH URLs in Package.swift (#42297)
* feat(manager/swift): support SSH URLs in Package.swift extraction and artifact matching

Swift packages can use SSH URLs (e.g. `git@github.com:owner/repo.git`) for
dependencies, but the Swift manager only supported HTTPS URLs. This caused
SSH-based dependencies to be silently ignored during extraction, and
Package.resolved pin matching to fail when protocols differed.

- Convert SCP-style SSH and `ssh://` URLs to HTTPS in `parseUrl()` using
  the existing `getHttpUrl()` utility before platform detection
- Enhance `normalizeUrl()` in artifacts to use `parseGitUrl()` for
  protocol-agnostic URL comparison (falls back to basic normalization
  when parsed components are incomplete)

* test(manager/swift): add edge case tests to improve coverage

- Add test for unparseable SSH URL in extraction
- Add test for host-only URL fallback in artifact matching

* fix(manager/swift): remove redundant .git stripping in normalizeUrl

parseGitUrl() already strips the .git suffix from full_name,
so the additional regex replacement is unnecessary.

* test(manager/swift): add ssh:// protocol test for artifact matching

Cover the ssh://git@github.com/... URL format in addition to the
existing git@ SCP-style test for Package.resolved pin matching.

* refactor(manager/swift): use trimTrailingSlash helper in normalizeUrl

* refactor(manager/swift): always normalize URLs in parseUrl
2026-05-16 10:13:20 +00:00
..