See https://www.drupal.org/pift-ci-job/1749547

Failed to execute git clone --no-checkout '/var/www/.composer/cache/vcs/-var-lib-drupalci-vcsRepoDir/' 'modules/contrib/lingotek' --dissociate --reference '/var/www/.composer/cache/vcs/-var-lib-drupalci-vcsRepoDir/' && cd 'modules/contrib/lingotek' && git remote set-url origin '/var/lib/drupalci/vcsRepoDir' && git remote add composer '/var/lib/drupalci/vcsRepoDir'

Cloning into 'modules/contrib/lingotek'...
fatal: reference repository '/var/www/.composer/cache/vcs/-var-lib-drupalci-vcsRepoDir/' is shallow

The patch being tested adds a require-dev dependency on a non-ready D9 module (paragraph_asymmetric_widget), and drupalci fails for 9.1.x
Same patch works for 8.9.x

Comments

penyaskito created an issue. See original summary.

penyaskito’s picture

Status: Active » Closed (won't fix)

Per @mixologic comment on Slack:

Before it was clone core, and then ‘composer require’ the project to get all of its dependencies, but that doesnt work if core is ^9 and your project is not yet 9 compatible and the patch may actually be adding support for ^9.

So recently it changed to git clone core, composer install and then git clone contrib to ‘vcsRepoDir’. If the build is either a feature branch or if the patch changes composer.json, we assume that the maintainer’s composer.json is fully compatible with composer. So, then composer adds it as a local vcs repo, and we composer require the local repo to get the deps.

In my case, as my contrib module had a dependency on a module which has no ^9 available release/branch, composer tried to change the current branch of my module (in vcsRepoDir) because it cant find a way to satisfy the dependency. As that is a shallow copy, this error appeared.

As the CI would fail anyway, I think it's not needed to fix this. I would like a more friendly error message on what's going on, but for detecting something like that means implementing composer logic itself. Which I don't think is worth the effort nor DrupalCI purpose at all. Closing as won't fix.

Thanks a lot @mixologic for the drupalci internals explanation and helping me understanding the issue, and hoping someone will find this issue in case the error occurs again :-)