infection: PrettyCI failure

I’m opening this issue because I noticed the PrettyCI build is failing. However running pretty (or php-cs-fixer fix --dry-run) locally yields no error.

I think I’ve spotted the root of the problem: the tests/ directory is excluded from the generated archive. But when running a build on PrettyCI I download the archive instead of cloning the repository as it is much master (no git history has to be downloaded). Since the GitHub archive doesn’t contain the tests/ directory the build is now failing.

I’m not 100% certain what to do you yet: using git clone is way slower. I’ll try it out in the coming days and see what’s the best solution. I’ll keep you posted here.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

I remember now why I didn’t go this way: GitHub did not support shallow clone for single commits (https://stackoverflow.com/a/43136160/245552). However I just tried again and it worked! Here is what I did:

git init
git remote add origin <url>
git fetch --depth 1 origin <sha1>
git checkout <sha1>

I tried using Symfony as a reference (because it’s a large repository with a great number of commits):

  • archive download: 5s
  • simple clone: 28s
  • shallow clone on master: 7s
  • shallow clone on a specific commit: ~7s

So that sounds definitely like a good solution! Now I need to verify that it works with tokens for private repositories. Thanks for the help I’ll keep you posted!

Maybe even do a shallow clone? Should be the fastest, I think.

That said, if you clone it make sure you are cloning a single branch not the whole repo

Also a shallow clone ( i think that is what its called), where you don’t clone the branch, but just the latest version of it. Should also be a bit faster, especially for older, longer running projects.