Skip to content

chore: fix cyclic dependency in repo caused by generate-lib script changes #7603

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 8 commits into from
Sep 7, 2023

Conversation

bradzacher
Copy link
Member

Overview

In #7535 I made a change to the script so that it used our utils package to type an ESLint call.
This actually introduced a nx cyclic dependency crash into the repo - but it looks like this crash was never seen due to caching or something I guess?

However on a fresh machine if you ran yarn, then it'll cause yarn to attempt to do a fresh build after an install and then nx would fail with

NX Could not execute command because the task graph has a circular dependency rule-schema-to-typescript-types:build --> type-utils:build --> utils:build --> scope-manager:build --> utils:build

cc @JamesHenry - this behaviour is super weird!

This PR moves the script to the repo-tools folder so that it's an isolated leaf, fixing the cyclic dependency.

@bradzacher bradzacher added the repo maintenance things to do with maintenance of the repo, and not with code/docs label Sep 5, 2023
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @bradzacher!

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.

@netlify
Copy link

netlify bot commented Sep 5, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/64f91a3b3e09390d067e94a7
😎 Deploy Preview https://deploy-preview-7603--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: 90 (🔴 down 9 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (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 site configuration.

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changes Sep 5, 2023
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.

Heh, I just started gettin this too - thanks for the fix. I'll defer to @JamesHenry as the Nx wiz.

(assuming the lockfile is fixed ofc)

@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 Sep 5, 2023
@JoshuaKGoldberg
Copy link
Member

or actually, @bradzacher this feels like a good thing to get in asap - I'm happy to just get it in sooner

@bradzacher
Copy link
Member Author

Yeah we can land it sooner then cycle back with James to investigate why this wasn't caught sooner by nx.

I'm not going to be able to get to my laptop for around 2 hours - if you wanted it asap feel free to pull and fix the lock file for me :)

@JoshuaKGoldberg
Copy link
Member

Well I'm stumped...

Internal Error: @typescript-eslint/typescript-eslint@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
    at V0.getCandidates (/Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:435:5145)
    at kf.getCandidates (/Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:391:1264)
    at /Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:439:8033
    at df (/Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:390:11070)
    at ge (/Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:439:8013)
    at async Promise.allSettled (index 0)
    at async io (/Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:390:10398)
    at async /Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:439:8545
    at async ti.startProgressPromise (/Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:390:47579)
    at async je.resolveEverything (/Users/josh/.cache/node/corepack/yarn/3.6.3/yarn.js:439:6573)

@bradzacher
Copy link
Member Author

Nuke a bitch and try again? That's my standard workflow for fixing yarn problems heh

@JoshuaKGoldberg
Copy link
Member

No juice :(

armano2
armano2 previously approved these changes Sep 6, 2023
@bradzacher bradzacher dismissed stale reviews from armano2 and JoshuaKGoldberg via 4bec329 September 6, 2023 00:40
@nx-cloud
Copy link

nx-cloud bot commented Sep 6, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 3e10dad. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


🟥 Failed Commands
nx build website
✅ Successfully ran 39 targets

Sent with 💌 from NxCloud.

@bradzacher
Copy link
Member Author

okay so I now have a fresh and clean yarn working.
I had to migrate our patches off of patch-package and onto yarn patch (which is now built into yarn2).

@bradzacher
Copy link
Member Author

bradzacher commented Sep 7, 2023

GH statuses didn't update - but there was a netlify build flake.
Retried the deploy and it worked fine
https://app.netlify.com/sites/typescript-eslint/deploys/64f91a3b3e09390d067e94a7
(the netlify comment updated though...)

@bradzacher bradzacher merged commit 1ed0733 into main Sep 7, 2023
@bradzacher bradzacher deleted the fix-generate-lib-cyclic-dep branch September 7, 2023 00:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants