When requiring a VCS package from a private Bitbucket repo using SSH authentication,
Bitbucket doesn't seem to invoke git archive. This results in the entire repo being cloned.
This behaviour differs from other repo hosting services such as Github where git archive is automatically invoked.
Using the OAuth authentication method apparently resolves this, however, this isn't viable for all use cases. Likewise telling composer to fetch the package over Https also apparently resolves the issue, however, this also isn't ideal.
Is there a reason why git archive isn't automatically invoked? Is this the responsibility of bitbucket when it responds to the composer request? Or does something need updating in composer's btibucket driver code?
If anyone knows more about this your input would be appreciated.
I've figured it out.
The Composer GitHub driver will use the API for both HTTPS and SSH, check the regex here:
https://github.com/composer/composer/blob/main/src/Composer/Repository/Vcs/GitHubDriver.php#L62
The Bitbucket driver on the other hand requires that repositories be specified with the HTTPS schema:
https://github.com/composer/composer/blob/main/src/Composer/Repository/Vcs/GitBitbucketDriver.php#L66C43-L66C48
In either case, automatic git archiving will only work over the respective platform's APIs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.