fix(platform): allow dots in repo names when parsing remote URLs - #1078
Merged
Merged
Conversation
The repo capture group in `parseGitHubRemote` and `parseAzureDevOpsRemote` used `[^/.]+?`, which excluded `.` and so failed on any repo whose name contained a dot (which both GitHub and Azure DevOps permit). The failure surfaced to users as `Could not detect platform: Could not parse GitHub remote URL: ...` from `squad watch`. Widen the repo capture to `[^/]+?` in all four regexes (HTTPS + SSH for both GitHub and ADO, plus legacy `*.visualstudio.com`). The trailing `(?:\.git)?$` plus the non-greedy quantifier still strip a trailing `.git` correctly. Adds regression coverage in `test/platform-adapter.test.ts` for repos named like `JADE.xlighthousepipelines`, `foo.bar.baz`, and the `.github` community-health repo convention, on both HTTPS and SSH for GitHub, dev.azure.com, and visualstudio.com. Closes bradygaster#1077
tamirdresher
approved these changes
May 4, 2026
tamirdresher
left a comment
Collaborator
There was a problem hiding this comment.
LGTM - reviewed and approved for merge.
Collaborator
|
@bradygaster This PR is approved and ready to merge, but the 'Squad Main Guard' CI check hasn't been triggered. Could you re-run CI or merge this? Thanks! |
Owner
|
goodness i need to turn my agents back on, sorry i missed this. |
bradygaster
pushed a commit
that referenced
this pull request
Jun 5, 2026
Closes the v0.9.4 sync-back debt per Picard's release plan (Phase 0). Brings in: - PR #1078 dot-repo parser fix (vejadu) - Lockfile integrity check exclusion fix - 0.9.4 CHANGELOG entry - --sync flag in template-sync tests - 31 main-only additions (skill.ts, agent-spawn.ts, fact-checking skill, challenger agent template, 10 scripts, 6 workflows, etc.) Conflict resolution per Worf's analysis (14 conflicts confirmed): - 11 standard conflicts: favor dev (200 commits ahead with state-backend rewrite + feature work) - .changeset/watch-p0-p1-fixes.md: accept main's deletion (stale, already consumed by 0.9.4 release bot) - test/scripts/security-review.test.ts: accept dev's deletion (PR #1000/ #1001 intentional CI cleanup); scripts/security-review.mjs preserved - docs/.../state-backends.md: take dev's 25KB authored version over main's 8KB PR #1023 restore (dev is comprehensive superset; main is older content rehydrated) Lockfile regenerated cleanly. npm run lint passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #1077.
parseGitHubRemoteandparseAzureDevOpsRemoteinpackages/squad-sdk/src/platform/detect.tsused([^/.]+?)for the repo capture group, which excludes.. As a result, any repo whose name contains a dot (which both GitHub and Azure DevOps permit) failed to parse and surfaced to users asCould not detect platform: Could not parse GitHub remote URL: <url>when runningsquad watch.This PR widens the repo capture from
[^/.]+?to[^/]+?in all four regexes (HTTPS + SSH GitHub, HTTPS + SSH dev.azure.com, and legacy*.visualstudio.com). The trailing(?:\.git)?$plus the non-greedy quantifier still correctly strip a trailing.git.Repro before the fix
After the fix, the URL parses to
{ owner: 'myorg', repo: 'JADE.xlighthousepipelines' }and watch proceeds normally.Cases covered by the new tests
In
test/platform-adapter.test.ts(regression block in each ofparseGitHubRemoteandparseAzureDevOpsRemote):https://github.com/myorg/JADE.xlighthousepipelines.gitmyorg, repo=JADE.xlighthousepipelineshttps://github.com/myorg/JADE.xlighthousepipelinesmyorg, repo=JADE.xlighthousepipelinesgit@github.com:myorg/foo.bar.baz.gitmyorg, repo=foo.bar.bazgit@github.com:myorg/foo.bar.bazmyorg, repo=foo.bar.bazhttps://github.com/myorg/.github.gitmyorg, repo=.githubhttps://dev.azure.com/org/proj/_git/repo.with.dotsorg, project=proj, repo=repo.with.dotshttps://dev.azure.com/org/proj/_git/repo.with.dots.gitorg, project=proj, repo=repo.with.dotsgit@ssh.dev.azure.com:v3/org/proj/repo.with.dots.gitorg, project=proj, repo=repo.with.dotshttps://contoso.visualstudio.com/proj/_git/repo.with.dots.gitcontoso, project=proj, repo=repo.with.dotsThe org-subdomain capture in the legacy
*.visualstudio.comregex intentionally keeps the no-dot constraint — the literal.visualstudio.comanchor needs it.Test plan
npx vitest run test/platform-adapter.test.ts— 129 passed (9 new)npm run linterrors confirmed to be unrelated (they're@bradygaster/squad-sdkmodule-resolution errors that requirenpm run buildfirst; same errors reproduce onupstream/mainwithout these changes)🤖 Generated with Claude Code