-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Build Tooling: Run packages build before lint #22088
Conversation
Size Change: 0 B Total Size: 821 kB ℹ️ View Unchanged
|
Confirmed expected failure in Travis:
https://travis-ci.com/github/WordPress/gutenberg/jobs/327580972 I'll rebase the branch to drop the commit, but for local testing, it can be "restored" by reverting ab4166f again in the local branch:
|
6989e3d
to
e931307
Compare
In thinking through this, I believe I know why it didn't fail for me locally at the time: from a few months ago I've been having issues with the pre-commit hook and it's not running for me. I guess this is a perfect storm kind of issue: this could only go unrealized to someone that wasn't able to run the pre-commit hook. Now, instead of being ashamed I feel privileged to being able to help uncover the issue :D |
Are you (were you) able to upgrade your copy of Git? |
I've just realized that there is an official repository that maintains the newer versions of git and works in my OS. For some reason, when I last checked, the only option I found was compiling git myself, which I wasn't very fond of. I wish I knew this months ago! I just updated and got my pre-commit hooks back 💪 |
This interesting, thank you for exploring it. It feels like we need a custom resolver for WordPress packages to work on the source rather than using the build files. It would be very similar approach to how unit tests are set up. This PR also explains why I had failures only on Travis in #20905 that tried to add a new rule from the same plugin. |
Related: #21864 (comment)
Related (link requires registration): https://wordpress.slack.com/archives/C5UNMSU4R/p1588614936461800
This pull request seeks to resolve an issue where the
eslint-plugin-import/no-extraneous-dependencies
rule will fail to execute correctly in Travis, leading to false negatives where a missing dependency may be introduced (see #21864 (comment), #22086).Implementation Notes:
From some further debugging, it appears that
eslint-plugin-import
may depend onpackage.json
'smain
field to be resolveable:Prior to these changes, there was no build being run. Each package typically defines it entrypoint as
"main": "build/index.js"
, which does not exist prior to a build in a clean installation.For future consideration: Ideally we don't need to run the build as part of the lint installation step, since it does add some time to the job's runtime. If we can find some other way to satisfy the ESLint plugin's resolver behavior which doesn't require resolving the built file, it would help to reduce the overall Travis build time.
Testing Instructions:
I have temporarily included a revert of the commit ab4166f in order to test these changes.Edit: Removed after verification at #22088 (comment).Testing consists of: