Repository navigation
chore: absorb vcs into packages/vcs - #13932
Conversation
Add server-side branch prefix search
fix: include status code and response body in GitHub token error
fix: pass HTTP status code as exception code
Adds a way to get a presigned/downloadable URL for a repository archive across all adapters. - GitHub: captures the native 302 redirect to the signed codeload URL - Gitea/Forgejo/Gogs & GitLab: build a directly-downloadable archive URL with the short-lived access token embedded as a query param, so it works without object storage - adds a followRedirects flag to Adapter::call() so the GitHub redirect can be captured instead of followed Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…-ref path - encode ref in GitHub/Gitea archive URLs (preserve slashes for nested branches) - map GitHub 401/403 to a clear access-denied error - document the opt-in @throws on the base getRepositoryPresignedUrl - test the Gitea default-branch resolution (no-ref) path Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
feat: presigned URL to download repository archive
Add listTags($owner, $repositoryName, $search) to every Git adapter, mirroring listBranches. Returns bare tag names, optionally filtered by a shell glob (fnmatch) via a shared matchGlob helper on the Git base class, so a resolved tag feeds straight into getRepositoryPresignedUrl. - GitHub: single git/matching-refs/tags call, then glob-filter - GitLab/Gitea: paginate the tags endpoint, then glob-filter - Gogs: non-paginated override (mirrors its listBranches override) - Forgejo inherits from Gitea Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
# Conflicts: # composer.lock
# Conflicts: # composer.json # composer.lock
# Conflicts: # composer.lock
# Conflicts: # composer.lock
# Conflicts: # composer.lock
# Conflicts: # composer.lock
# Conflicts: # composer.lock
# Conflicts: # composer.lock
# Conflicts: # composer.lock
🟢 Tier S · Ready to merge
This PR moves VCS into Latest changes: The newest commit updates the adapter guide’s source and test directory tree for the flattened VCS package layout.
📂 Walkthrough · 15
Reviewed the commits since |
# Conflicts: # composer.lock
Summary
Moves
utopia-php/vcsintopackages/vcs, so Appwrite loads it directly. Wave 3 of #13828, followingrfc/monorepo.md. The mirror head is the5.5.1release Appwrite already locks (f8b0c717), so there is no version gap.Add 'packages/vcs/' from commit 'f8b0c717…'chore(vcs): mirror plumbingmirror.ymlpoints at this repository'smirror-redirect.yml; README banner refreshed. No banned filesrefactor: load vcs from packages/replaceentries; dropsutopia-php/vcs: 5.5.*and thehttps://github.com/utopia-php/vcsvcsrepository entry; step A of the standard shape (below); PHPStan baseline; RFC phase 8 bulletrefactor(vcs): replace utopia-php/fetch with clientstyle(vcs): strip trailing whitespace…git diff --checkStep A
src/VCS/*,Utopia\VCS\→src/VCSsrc/*,Utopia\VCS\→src/tests/Unit/*,Utopia\Tests\Unittests/*,Utopia\VCS\Teststests/E2E/*,Utopia\Tests\E2EUtopia\VCS\Tests\E2Ephpstan.neon../../phpstan.neon(level 5)srcandtests, keeps theadhocore/jwtstubrector.phpsrc/is the release byte for byte apart from the path move and Pint formatting (empty{}bodies andfn (spacing); Rector changes nothing insrc, sorector.phpneeds no skips. Intests/, Rector rewrites onedirname(__DIR__)incredentials.php.The provider tier already lived in
tests/E2E/. GitHub and Bitbucket skip withoutTESTS_GITHUB_*/TESTS_BITBUCKET_*credentials; Gitea, Forgejo, Gogs and GitLab run against the package'sdocker-compose.ymlon offset ports. Nothing in the unit tier calls a provider.Nothing new to hoist:
adhocore/jwtis already in the rootrequire, andutopia-php/cacheis inpackages/. The upstream repository has noLICENSEfile (the manifest says MIT); left as released.fetch → client
src/never usedUtopia\Fetch: the adapters call cURL directly, andutopia-php/fetchwas a stale runtime requirement. The only users were three request-catcher and git-smart-HTTP helpers intests/E2E/Base.php. Commit 4 moves them toUtopia\ClientwithUtopia\Psr7requests, dropsutopia-php/fetchfrom the packagerequire, and addsutopia-php/client: ^0.5andutopia-php/psr7: ^0.2.1torequire-dev(only the tests use them).new Client()new Client(new CurlAdapter())withTimeout(15)withFollowRedirects(), max 50 (see below)fetch(url:, method: 'GET')RequestFactory::createRequest(Method::GET, …)fetch(…, query: [...])RequestFactory::query(Method::GET, …, [...])text()(string) getBody()The 5-hop cap does not carry over.
withFollowRedirects(maxHops:)exists only onpackages/clienthead (#13910), not in the releasedclient0.5.1 that the package's registry-resolved CI job installs, so any cap argument either fails there or is stripped by Rector. The three requests go to the local request catcher and self-hosted git servers, where the cap never comes into play. Onceclient0.6.0 is released, the cap can be restored with^0.6andmaxHops: 5.No
srcrequest-building logic changed, so there are no new unit tests.utopia-php/fetchleaves the package manifest. It stays in the root lock only because the still-vendoredutopia-php/auditrequires it.Validation
bin/monorepo validatebin/monorepo check vcsbin/monorepo test vcs(registry-resolved), unit tierbin/monorepo test vcs, e2e tierphpunit --testsuite packages --filter 'Utopia\\VCS'igbinary, sopackages/cache's codec providers error, as onmain)phpunit tests/unit/VcsUtopia\VCSplustests/unit/VcsUtopia\VCS\Adapter\Git\GitHub→packages/vcs/src/Adapter/Git/GitHub.php;vendor/utopia-php/vcsgonecomposer update --lockutopia-php/vcs(−60 lines plus the content hash)composer validate --no-check-publishutopia-php/platformexact-constraint warning only)bin/monorepo split vcs --dry-rune3743a38, fast-forwards from the mirror headf8b0c717git diff --checkBaseline: 1,087 findings (level 5 in the monorepo, max here). 970 are in
src, nearly all offset access, arguments and casts on the decodedmixedprovider responses across the six Git adapters. 117 are in the tests, mostly the same response handling in the e2eBase. Listed under phase 8 in the RFC.Merge and follow-up
Merge with a merge commit. A squash drops the
git-subtree-*annotation and orphans the package from its mirror.The mirror already has the canonical
mainruleset (id12522958: no force push, PRs required, no deletion; split app4016286always bypasses), so the absorb ran with--skip-ruleset. There is no classic branch protection onmain.After merge:
Splitpushes toutopia-php/vcspackages/vcsfromutopia-php/monorepoclient0.6.0tests/E2E/Base.phpNothing is ported here. Anything still wanted gets re-opened against
packages/vcs/src/(paths lost theVCS/segment).🤖 Generated with Claude Code