Skip to content

[Blueprint] Support .git repository URLs - #3541

Merged
adamziel merged 1 commit into
trunkfrom
codex/support-git-dot-suffix
Apr 28, 2026
Merged

[Blueprint] Support .git repository URLs#3541
adamziel merged 1 commit into
trunkfrom
codex/support-git-dot-suffix

Conversation

@adamziel

@adamziel adamziel commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes the unreasonable limitation Playground had for git:directory resources where the .git suffix in the URL wasn't accepted. This PR makes it easier for the user and accepts either form: with, or without the .git suffix.

Tests

  • Added Blueprint compile regression tests for GitHub .git URLs with whitespace/trailing slashes, GitLab .git URLs, and self-hosted .git URLs.
  • git diff --check
  • Not run locally: focused Nx tests could not start because Nx modules are not installed in this checkout.
@adamziel
adamziel force-pushed the codex/support-git-dot-suffix branch from 1d7b10d to 191e063 Compare April 28, 2026 11:44
@adamziel adamziel changed the title [codex] Support .git repository URLs Apr 28, 2026
@adamziel
adamziel marked this pull request as ready for review April 28, 2026 12:27
@adamziel
adamziel requested review from a team, ashfame and Copilot April 28, 2026 12:27
@adamziel
adamziel merged commit c957ab2 into trunk Apr 28, 2026
46 of 47 checks passed
@adamziel
adamziel deleted the codex/support-git-dot-suffix branch April 28, 2026 12:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 .git suffix (and normalize whitespace/trailing slashes) when compiling git:directory resources.
  • Normalize input before validating Git repository URLs, and update URL regexes accordingly.
  • Add regression tests and update docs to reflect .git support.

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.

Comment thread packages/playground/blueprints/src/lib/v1/compile.ts
Comment thread packages/playground/blueprints/src/lib/v1/compile.ts

- 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.

Copilot AI Apr 28, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
- 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.
Copilot uses AI. Check for mistakes.
adamziel added a commit that referenced this pull request Apr 28, 2026
## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants