Skip to content

Make upgrades faster #17898

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

Merged
merged 4 commits into from
May 6, 2025
Merged

Make upgrades faster #17898

merged 4 commits into from
May 6, 2025

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented May 6, 2025

This PR fixes an issue where the upgrade tests were taking too long. This PR fixes that.

Essentially when updating dependencies we did this:

npm install tailwindcss@latest
npm install @tailwindcss/postcss@latest
npm install prettier-plugin-tailwindcss@latest

But this is not ideal, because we are calling out to npm and run each dependency in isolation.

With this PR, we essentially do it all in one go:

npm install tailwindcss@latest @tailwindcss/postcss@latest prettier-plugin-tailwindcss@latest

Test plan

Testing this locally, the results look like this:

Before After
image image

In CI:

Before (with a failure) After
image image

[ci-all]

Before this, we were executing npm / pnpm / ... multiple times, ones per
dependency.
@RobinMalfait RobinMalfait marked this pull request as ready for review May 6, 2025 15:56
@RobinMalfait RobinMalfait requested a review from a team as a code owner May 6, 2025 15:56
].map(async (dependency) => {
if (dependency === 'tailwindcss') {
return dependency
} else if (await pkg(base).has(dependency)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

could you hoist await pkg(base) outside of this call? Then you don't need the promise.all and things get simpler again?

Copy link
Member Author

Choose a reason for hiding this comment

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

Only if we change how pkg works. Right now pkg(base) itself just returns an object with async add(), async has() and async remove() methods.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could also make it sync

+ use a default map as a cache for reading the package.json file
@RobinMalfait RobinMalfait merged commit 449dfcf into main May 6, 2025
21 checks passed
@RobinMalfait RobinMalfait deleted the fix/improve-ci-upgrade-tests branch May 6, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants