[Blueprint] Support .git repository URLs - #3541
Conversation
1d7b10d to
191e063
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates Blueprint compilation and documentation to accept repository URLs with a trailing .git suffix (and to tolerate harmless whitespace/trailing slashes), removing the prior requirement to omit .git for git:directory.
Changes:
- Preserve
.gitsuffix (and normalize whitespace/trailing slashes) when compilinggit:directoryresources. - Normalize input before validating Git repository URLs, and update URL regexes accordingly.
- Add regression tests and update docs to reflect
.gitsupport.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/playground/blueprints/src/lib/v1/compile.ts | Preserves .git in compiled URLs; normalizes trailing slashes/whitespace; updates repo URL detection logic. |
| packages/playground/blueprints/src/lib/v1/compile.spec.ts | Adds/updates regression tests asserting .git URLs are preserved and normalized. |
| packages/docs/site/docs/main/guides/github-action-pr-preview.md | Updates guidance to reflect that .git suffix is supported. |
| packages/docs/site/docs/blueprints/04-resources.md | Documents .git-suffix and trailing-slash handling for repository URLs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - When using a branch or tag name for `ref`, you must specify `refType` (e.g. `"refType": "branch"`). Without it, only `HEAD` is reliably resolved. | ||
| - Playground automatically detects providers like GitHub and GitLab. | ||
| - Repository URLs may include or omit a trailing `.git` suffix. Extra trailing slashes are ignored. |
There was a problem hiding this comment.
This reads as a general guarantee for all hosts, but isGitRepoUrl() currently only accepts non-.git URLs for GitHub and GitLab (self-hosted URLs without .git are not recognized). To avoid misleading users, please clarify the scope here (e.g., omit/allow .git for GitHub/GitLab; for other hosts, .git may be required), or expand detection logic if broader support is intended.
| - Repository URLs may include or omit a trailing `.git` suffix. Extra trailing slashes are ignored. | |
| - For GitHub and GitLab URLs, repository URLs may include or omit a trailing `.git` suffix. For other hosts, the `.git` suffix may be required. Extra trailing slashes are ignored. |
## Summary LLMs are getting confused by the current PR Preview button integration guide. This PR attempts to make it easier for them byt: - Clarifying when to use `pull_request_target` for fork PR preview buttons. - Explaining a two-workflow usage patterm - Replacing a workflow example with links to the remote workflow docs. - Update the custom `git:directory` PR-preview example to use the fork head repo, commit SHA, `refType: "commit"`, and a `.git`-suffixed URL now that #3541 has merged. - Add agent-facing `llms.txt` pointers for PR preview setup and `git:directory` repository resources.
Summary
Removes the unreasonable limitation Playground had for
git:directoryresources where the.gitsuffix in the URL wasn't accepted. This PR makes it easier for the user and accepts either form: with, or without the.gitsuffix.Tests
.gitURLs with whitespace/trailing slashes, GitLab.gitURLs, and self-hosted.gitURLs.git diff --check