Uh oh!
There was an error while loading. Please reload this page.
Report adapter capabilities and prove public repositories reach anonymous clients - #134
Conversation
… anonymous clients Consumers ask the adapter what a provider can do - create or delete repositories, hand out archive URLs, render comment images, host public repositories - instead of calling into a missing endpoint just to catch it throwing. The shared suite now also proves publicness end to end: a public repository has to answer the anonymous git ref advertisement request that git clone opens with, and a private one has to refuse it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
supportsRepositoryArchives(), supportsCommentImages(), supportsPublicRepositories(), the anonymous public-access test and the non-Origin README marks now land through #134; Origin keeps only its own overrides here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Greptile SummaryThe pull request adds provider capability-reporting methods, introduces an end-to-end anonymous smart-HTTP test for public repositories, supplies provider-specific clone URLs, and updates the support table.
Confidence Score: 4/5The pull request should not merge until comment-image capability reporting reflects each provider; the test resource-cleanup gap is additionally worth correcting. All adapters currently inherit a true comment-image capability even though the new contract says providers without suitable proxying require a text fallback, and the new two-repository test can leak its first resource when the second creation fails. Files Needing Attention: src/VCS/Adapter/Git.php, tests/VCS/Base.php Important Files Changed
Prompt To Fix All With AI### Issue 1
src/VCS/Adapter/Git.php:138-141
**Comment-image support is misreported**
When a consumer checks `supportsCommentImages()` for GitLab, Bitbucket, Gitea, Gogs, or Forgejo, every adapter inherits `true` even though the method contract says providers without suitable image proxying require a text fallback, causing consumers to publish image markup that recipients cannot view.
### Issue 2
tests/VCS/Base.php:516-517
**Partial setup bypasses cleanup**
If public repository creation succeeds but private repository creation fails, execution never enters the `try` block, so the public repository is not discarded and remains in the provider account.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat: report adapter capabilities and pr..." | Re-trigger Greptile |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What
Adds capability methods to the
Gitadapter so consumers can ask what a provider supports instead of calling into a missing endpoint just to catch it throwing:supportsRepositoryCreation()supportsRepositoryDeletion()supportsRepositoryArchives()supportsCommentImages()supportsPublicRepositories()All default to
true; providers that lack a capability override the method.Adds
testPublicRepositoryIsPubliclyAccessibleto the shared suite. Existing tests only asserted theprivateflag the provider reports; this one proves publicness end to end by sending the git smart-HTTP ref advertisement request (GET …/info/refs?service=git-upload-pack, the requestgit cloneopens with) without credentials. A public repository has to answer 200 with a realgit-upload-packadvertisement, and a private one has to refuse the same request — otherwise the public answer would say nothing beyond the server being up. Each adapter test supplies its anonymous clone URL via a new abstractanonymousCloneUrl().Marks GitLab and Bitbucket as supported in the README's adapter table.
Verification
composer lintandcomposer check(PHPStan level 8) pass.🤖 Generated with Claude Code