Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Composer Package Archive Private Repo Over SSH

Gavin Gration
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 31, 2024

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.

1 answer

0 votes
Gavin Gration
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 2, 2024

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. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events