ci: only git fetch HEAD unless more is needed#5938
Conversation
3c260c5 to
ba991f3
Compare
ba991f3 to
b9daa55
Compare
|
This pull request adds or modifies JavaScript ( |
| const output = await new Fixture('./fixtures/basereldir').withFlags({ baseRelDir: false }).runWithConfig() | ||
| const output = await new Fixture('./fixtures/basereldir') | ||
| .withFlags({ baseRelDir: false }) | ||
| .withEnv({ COMMIT_REF: 'abcdefabcdefabcdefabcdef', CACHED_COMMIT_REF: undefined }) |
There was a problem hiding this comment.
Learning: what's this change for?
There was a problem hiding this comment.
Sorry, I explained this in the separate commit but not in the PR!
This is one of those funny things about testing a build system on another build system :). It seems this snapshot test was unintentionally relying on some CI env vars related to the git checkout of the netlify/build repo, when it was intending to be testing something related to a test fixture repo's git env vars.
When I changed the git checkout setup in our CI, it changed this snapshot test's result a bit. So I updated the test to explicitly pass the env it's expecting.
I would imagine if we changed all these tests to not inherit the outer env at all it would break a lot of things...
There was a problem hiding this comment.
... or at least I thought I did but it didn't actually fix it. I don't think the undefined thing is working 😢.
Summary
Each CI job is fetching ~2000 git tags and branches plus the full history. It only takes 10s but it could be taking 1s instead!