Skip to content

ci: only git fetch HEAD unless more is needed#5938

Closed
serhalp wants to merge 2 commits into
mainfrom
ci/git-checkout-only-head
Closed

ci: only git fetch HEAD unless more is needed#5938
serhalp wants to merge 2 commits into
mainfrom
ci/git-checkout-only-head

Conversation

@serhalp
Copy link
Copy Markdown
Member

@serhalp serhalp commented Dec 11, 2024

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!

@serhalp serhalp force-pushed the ci/git-checkout-only-head branch from 3c260c5 to ba991f3 Compare December 11, 2024 16:31
@serhalp serhalp force-pushed the ci/git-checkout-only-head branch from ba991f3 to b9daa55 Compare December 11, 2024 19:18
@github-actions
Copy link
Copy Markdown
Contributor

This pull request adds or modifies JavaScript (.js, .cjs, .mjs) files.
Consider converting them to TypeScript.

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 })
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Learning: what's this change for?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... or at least I thought I did but it didn't actually fix it. I don't think the undefined thing is working 😢.

@github-actions github-actions Bot added the stale label Feb 10, 2025
@mrstork mrstork closed this Jun 12, 2025
@mrstork mrstork deleted the ci/git-checkout-only-head branch June 12, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants