Skip to content

fix(vcs): resolve wildcard tags when cloning templates - #14137

Merged
ChiragAgg5k merged 2 commits into
mainfrom
cursor/fix-vcs-tag-pattern-clone-9547
Oct 5, 2026
Merged

ChiragAgg5k merged 2 commits into
mainfrom
cursor/fix-vcs-tag-pattern-clone-9547

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Template deployments clone with a wildcard tag such as 0.1.*. #14022 replaced the GitHub and Origin lookup (git ls-remote --tags | tail -n 1 | awk) with a direct git fetch origin refs/tags/<version>. Git rejects that refspec (fatal: invalid refspec 'refs/tags/0.1.*'), and the deployment fails.

A version containing *, ?, or [ cannot be a tag name, so the shared clone command resolves it the same way that lookup did: the last tag git ls-remote --tags lists for the pattern. --refs drops the peeled ^{} line of an annotated tag, so the name that is fetched is the tag itself. Exact tag names, including ones that start with a dash, are still fetched as refs/tags/<name>. If nothing matches, the clone exits with fatal: no tag matching <pattern>.

Fixes CLOUD-3R60

Test Plan

  • composer test in packages/vcs (unit suite): 128 tests, 474 assertions, 1 skipped.
  • bin/monorepo check vcs: Rector, Pint, and PHPStan passed.
  • New coverage in CloneCommandTest: 0.1.* checks out 0.1.2 (the last listed tag; 0.1.10 is newer and sorts earlier, and 0.1.2 is annotated), an exact tag still checks out that tag, and a pattern with no match fails.

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?
Open in Web Open in Cursor 

Closes #14138

Template versions such as 0.1.* are not refspecs. PR #14022 fetches
refs/tags/<version> directly, so those clones fail. Resolve a glob to the
last tag git ls-remote lists for it, the same tag the old GitHub and Origin
lookup selected, and keep exact tag names on the direct fetch.

Co-authored-by: Chirag Aggarwal <[email protected]>
@ghost

ghost commented Oct 5, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

Adds wildcard-tag resolution to the shared Git clone command, selecting the last matching remote tag before fetching and checking it out. Exact tags retain their existing fetch path, unmatched patterns return an explicit error, and namespaced tag names are preserved. Local-repository tests cover wildcard selection, namespaced tags, exact tags, and unmatched patterns.

Latest changes: The newest commits preserve the full tag-name suffix after refs/tags/ and add a regression test for namespaced wildcard tags.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 2
File Change
packages/vcs/src/Adapter/Git.php Resolves tag globs before fetching, preserving namespaced tag names and reporting unmatched patterns.
packages/vcs/tests/CloneCommandTest.php Adds local tag checkout and error coverage, including annotated and namespaced wildcard matches.

Reviewed the commits since fcbd1e2 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Tier A · Looks good to merge. Summary

Comment thread packages/vcs/src/Adapter/Git.php Resolved
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → cursor/fix-vcs-tag-pattern-clone-9547 (after).

Metric Before After Change
🚀 Requests/sec 198.11 203.14 ⚪ +2.5%
⏱️ Latency P50 86.63 ms 85.67 ms ⚪ -1.1%
⏱️ Latency P95 204.9 ms 196.45 ms ⚪ -4.1%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 85.67 196.45 12,711 203.14 -8.45
Account 166.06 335.29 669 11.15 -17.6
TablesDB 84.2 158.54 6,913 112 -5.03
Storage 75.67 168.71 3,345 56.27 -2.9
Functions 120.84 241 1,784 30.69 +8.37

Top API waits (after)

API request Max wait (ms)
account.name.update 583.09
functions.delete 554.01
account.prefs.update 530.51
functions.variables.update 436.23
tablesdb.rows.create 403.68

git ls-remote prints refs/tags/release/0.1.2. The third slash-separated
field is only release, so the fetch misses the tag. Take the full name
after refs/tags/ and cover release/0.1.* in the tag-pattern clone test.

Co-authored-by: Chirag Aggarwal <[email protected]>

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k
ChiragAgg5k merged commit c25bd10 into main Oct 5, 2026
54 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the cursor/fix-vcs-tag-pattern-clone-9547 branch October 5, 2026 15:20
abnegate added a commit that referenced this pull request Oct 6, 2026
Brings in #14130 (route physical collection reads, schema checks, cache
purges and transaction commits through the databases handle), #14120's
merge commit, #14137 (VCS tag globs) and #14139 (project SMTP failures
finish the mail job).

Conflicts were resolved by keeping the database 8.0 forms the train
already uses (ColumnType cases, Capability checks via supports(),
Attribute::fromArray for checkAttribute, supportsSpatial/
supportsRelationships helpers) while taking main's databases-handle
routing, so dedicated databases get their own adapter's capabilities
and schema. The spatial capability check moves after the database
lookup because it now needs that database's adapter.

Documents Create/Update keep the train's RelationshipValues, which
already reads stored related documents through the databases handle;
main's inline permission walk is superseded by it.

Transactions increment/decrement now build their Counter from the
databases handle, since main renamed the handler parameter and the
counted collection's schema lives on that handle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve wildcard tags when cloning templates

3 participants