Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

serhalp
Copy link
Contributor

@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
Copy link
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
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
Contributor 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
Contributor 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 😢.

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