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

fix(gatsby-telemetry): Read installedGatsbyVersion correctly for workspaces #31196

Merged

Conversation

sidharthachatterjee
Copy link
Contributor

For yarn workspaces (when process.cwd()) is not the parent directory where node_modules includes gatsby, the current code is unable to read the installed gatsby version. This attempts to fix that.

Remember that main for the gatsby package is cache-dir/commonjs/gatsby-browser-entry.js so we need to strip out three segments to be able to resolve to root

Co drafted with the wonderful @jamo

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 3, 2021
@sidharthachatterjee sidharthachatterjee force-pushed the jarmo/ch30087/understand-why-so-many-machines-are-logged branch from 338ba86 to f514204 Compare May 3, 2021 13:33
@jamo
Copy link
Contributor

jamo commented May 3, 2021

I released this as [email protected]+f514204bc5 and test with yarn workspaces works.

We would need to backport this to v2 to get the widest distribution of this hotfix.

@jamo
Copy link
Contributor

jamo commented May 3, 2021

Seems that e2e_tests_pnp is failing but I guess it's ok 😬

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

Thanks!

@pieh pieh merged commit af12b66 into master May 4, 2021
@pieh pieh deleted the jarmo/ch30087/understand-why-so-many-machines-are-logged branch May 4, 2021 07:25
@LekoArts LekoArts added topic: telemetry* and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 4, 2021
pieh pushed a commit that referenced this pull request May 4, 2021
…spaces (#31196)

* Read Gatsby version correctly

* Simplify logic

Co-authored-by: Jarmo Isotalo <[email protected]>
(cherry picked from commit af12b66)
pieh pushed a commit that referenced this pull request May 4, 2021
…spaces (#31196) (#31208)

* Read Gatsby version correctly

* Simplify logic

Co-authored-by: Jarmo Isotalo <[email protected]>
(cherry picked from commit af12b66)

Co-authored-by: Sidhartha Chatterjee <[email protected]>
vladar pushed a commit that referenced this pull request May 4, 2021
…spaces (#31196)

* Read Gatsby version correctly

* Simplify logic

Co-authored-by: Jarmo Isotalo <[email protected]>
(cherry picked from commit af12b66)
vladar pushed a commit that referenced this pull request May 4, 2021
…spaces (#31196) (#31244)

* Read Gatsby version correctly

* Simplify logic

Co-authored-by: Jarmo Isotalo <[email protected]>
(cherry picked from commit af12b66)

Co-authored-by: Sidhartha Chatterjee <[email protected]>
@vladar
Copy link
Contributor

vladar commented May 4, 2021

Published in [email protected]

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.

5 participants