Skip to content

fix(platform): allow dots in repo names when parsing remote URLs - #1078

Merged
bradygaster merged 1 commit into
bradygaster:mainfrom
vejadu:fix/parse-remote-allow-dots
May 12, 2026
Merged

fix(platform): allow dots in repo names when parsing remote URLs#1078
bradygaster merged 1 commit into
bradygaster:mainfrom
vejadu:fix/parse-remote-allow-dots

Conversation

@vejadu

@vejadu vejadu commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1077.

parseGitHubRemote and parseAzureDevOpsRemote in packages/squad-sdk/src/platform/detect.ts used ([^/.]+?) 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 as Could not detect platform: Could not parse GitHub remote URL: <url> when running squad 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

git init
git remote add origin https://github.com/myorg/JADE.xlighthousepipelines.git
npx @bradygaster/squad-cli watch
# → Could not detect platform: Could not parse GitHub remote URL: https://github.com/myorg/JADE.xlighthousepipelines.git

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 of parseGitHubRemote and parseAzureDevOpsRemote):

URL Parsed
https://github.com/myorg/JADE.xlighthousepipelines.git owner=myorg, repo=JADE.xlighthousepipelines
https://github.com/myorg/JADE.xlighthousepipelines owner=myorg, repo=JADE.xlighthousepipelines
git@github.com:myorg/foo.bar.baz.git owner=myorg, repo=foo.bar.baz
git@github.com:myorg/foo.bar.baz owner=myorg, repo=foo.bar.baz
https://github.com/myorg/.github.git owner=myorg, repo=.github
https://dev.azure.com/org/proj/_git/repo.with.dots org=org, project=proj, repo=repo.with.dots
https://dev.azure.com/org/proj/_git/repo.with.dots.git org=org, project=proj, repo=repo.with.dots
git@ssh.dev.azure.com:v3/org/proj/repo.with.dots.git org=org, project=proj, repo=repo.with.dots
https://contoso.visualstudio.com/proj/_git/repo.with.dots.git org=contoso, project=proj, repo=repo.with.dots

The org-subdomain capture in the legacy *.visualstudio.com regex intentionally keeps the no-dot constraint — the literal .visualstudio.com anchor needs it.

Test plan

  • npx vitest run test/platform-adapter.test.ts — 129 passed (9 new)
  • All previously passing cases still pass (no behavior change for repos without dots)
  • Pre-existing npm run lint errors confirmed to be unrelated (they're @bradygaster/squad-sdk module-resolution errors that require npm run build first; same errors reproduce on upstream/main without these changes)

🤖 Generated with Claude Code

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 tamirdresher left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - reviewed and approved for merge.

@tamirdresher

Copy link
Copy Markdown
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!

@bradygaster

Copy link
Copy Markdown
Owner

goodness i need to turn my agents back on, sorry i missed this.

@bradygaster bradygaster added the skip-changelog Skip changelog enforcement for this PR label May 12, 2026
@bradygaster
bradygaster merged commit fa2f977 into bradygaster:main May 12, 2026
12 of 13 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Skip changelog enforcement for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants