[Blueprints] Share Git repository URL detection logic - #3858
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Extracts the Blueprint v1 Git repository URL heuristic into a shared helper (seemsLikeGitRepoUrl) so it can be reused by Blueprint v2 without changing v1 behavior.
Changes:
- Added a shared
seemsLikeGitRepoUrl()helper undersrc/lib/ - Updated the v1 compiler to use the shared helper (and removed the inline implementation)
- Added unit tests covering accepted/rejected URL shapes and normalization
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/playground/blueprints/src/lib/is-git-repo-url.ts | Introduces shared allowlist-style Git repo URL heuristic used by compilers |
| packages/playground/blueprints/src/lib/v1/compile.ts | Switches v1 compilation logic to call the shared helper and removes the local function |
| packages/playground/blueprints/src/tests/is-git-repo-url.spec.ts | Adds test coverage for the new shared helper and its normalization behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adamziel
force-pushed
the
add/shared-git-repo-url-helper
branch
from
July 1, 2026 22:13
e7d860c to
dd24323
Compare
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.
What it does
Moves the Blueprint v1 plugin URL heuristic into a shared internal helper:
seemsLikeGitRepoUrl().The v1 compiler still treats these as Git repositories:
Rationale
Blueprint v2 compilation also needs to distinguish Git repository URLs from direct download URLs and WordPress.org slugs.
Keeping the heuristic inside
v1/compile.tswould force the v2 compiler to duplicate it or reach into v1 internals. This PR makes the logic reusable without changing v1 behavior.Implementation
Adds
src/lib/is-git-repo-url.tsand updatesv1/compile.tsto callseemsLikeGitRepoUrl().The helper intentionally keeps the existing allowlist-style behavior. It is not a general Git remote parser.
Testing instructions
Part of #2592.