Repository navigation
fix(vcs): resolve wildcard tags when cloning templates - #14137
Conversation
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]>
🟢 Tier S · Ready to mergeAdds 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.
📂 Walkthrough · 2
Reviewed the commits since |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
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]>
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]>
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 directgit 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 taggit ls-remote --tagslists for the pattern.--refsdrops 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 asrefs/tags/<name>. If nothing matches, the clone exits withfatal: no tag matching <pattern>.Fixes CLOUD-3R60
Test Plan
composer testinpackages/vcs(unit suite): 128 tests, 474 assertions, 1 skipped.bin/monorepo check vcs: Rector, Pint, and PHPStan passed.CloneCommandTest:0.1.*checks out0.1.2(the last listed tag;0.1.10is newer and sorts earlier, and0.1.2is annotated), an exact tag still checks out that tag, and a pattern with no match fails.Related PRs and Issues
Checklist
Closes #14138