Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: remove postinstall steps from CI to speed up prepare-install action #11219

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kirkwaiblinger
Copy link
Member

@kirkwaiblinger kirkwaiblinger commented May 14, 2025

PR Checklist

Overview

Take all of the following with a grain of salt since this is not my area of expertise...

The postinstall script can take a while (locally, at least) since it builds the whole project from scratch. I'm not sure to what extent this is mitigated by nx caching in CI, but, locally, the difference between SKIP_POSTINSTALL=true yarn and yarn is 9 seconds vs 68 seconds... So I'd think that explains the 1 minute prepare-install time mentioned in #11205

For CI steps that need the tasks done by yarn build, nx's dependency graph should still execute the required build steps, meaning that we'll mostly just be shifting running time out of the prepare-install step, and into the main CI job. So, likely not a huge overall speedup for those cases. However, for actions that don't have any upstream build dependencies, like semantic-breaking-changes-pr, I would expect this to be a significant speedup.

I'd be surprised if this didn't break anything if merged to main, tbh. Previously, many of the nx build dependencies weren't accurately declared, and, therefore, several commands depended on the "build everything" task built into yarn install. Note that @aryaemami59 has made quite a few fixes in this area, though! So perhaps things will work.

Merging this would also introduce a downside that CI failures would be harder for community contributors to debug since they would generally not know to do SKIP_POSTINSTALL=true yarn && yarn my-failing-command to replicate the behavior in CI.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @kirkwaiblinger!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented May 14, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit ea54215
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/682510ac494fe10008ed6450
😎 Deploy Preview https://deploy-preview-11219--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

nx-cloud bot commented May 14, 2025

View your CI Pipeline Execution ↗ for commit ea54215.

Command Status Duration Result
nx typecheck ast-spec ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude website --... ✅ Succeeded 4s View ↗
nx run-many --target=clean ✅ Succeeded 10s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-16 12:04:52 UTC

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

💯 💯 yes!

IMO we should merge this ASAP and see what breaks. If I'm understanding the nx philosophy right then all of our scripts should know to run their dependencies first. In a perfect world I think that means we'd be able to eventually delete the postinstall script and have it all automagically inferred. 🔪

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label May 16, 2025
@JamesHenry
Copy link
Member

There were some confusing nx config changes just merged in #11135 which have caused conflicts with this one

@JamesHenry
Copy link
Member

I'll share my thoughts in a loom to try and bring everyone on the same page

@kirkwaiblinger
Copy link
Member Author

In a perfect world I think that means we'd be able to eventually delete the postinstall script and have it all automagically inferred. 🔪

For now, the postinstall script also does a bit of devx setup, in that it installs husky git hooks. So we probably still want it for that? For this PR, I went with SKIP_POSTINSTALL=true instead of SKIP_POSTINSTALL_BUILD=true (which I periodically use locally) because I figured we don't need husky git hooks in CI.

But yeah possibly the part after the SKIP_POSTINSTALL_BUILD condition maybe could go in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants