Skip to content

Add dev environment checks#8450

Merged
tkajtoch merged 4 commits into
elastic:mainfrom
tkajtoch:build/yarn-validate-env
Apr 16, 2025
Merged

Add dev environment checks#8450
tkajtoch merged 4 commits into
elastic:mainfrom
tkajtoch:build/yarn-validate-env

Conversation

@tkajtoch
Copy link
Copy Markdown
Member

@tkajtoch tkajtoch commented Mar 17, 2025

Summary

Resolves #8448

This PR adds Node.js version and OS compatibility checks when running yarn to ensure equal development environments.

Screenshot 2025-03-17 at 17 35 48

QA

  1. Checkout this PR - gh pr checkout 8450
  2. Run yarn
  3. Confirm it successfully installs dependencies and doesn't fail when running the expected Node.js version - run nvm use before yarn
  4. Confirm it fails when running an incorrect Node.js version - run nvm install 18 && nvm use 18 before yarn

@tkajtoch tkajtoch self-assigned this Mar 17, 2025
@tkajtoch tkajtoch requested a review from a team as a code owner March 17, 2025 16:35
@weronikaolejniczak weronikaolejniczak self-requested a review March 17, 2025 16:37
@weronikaolejniczak
Copy link
Copy Markdown
Contributor

@tkajtoch what immediately came to mind is solidarity, might be worth considering! 😄

@weronikaolejniczak
Copy link
Copy Markdown
Contributor

Maybe I'm missing something but isn't it what yarn does out-of-box when there's an nvmrc? 🤔 Could you explain the purpose?
Screenshot 2025-03-17 at 17 41 36

throw new ReportError(MessageName.UNNAMED, message);
}

if (process.platform === 'win32') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typical Windows 💚

@tkajtoch tkajtoch changed the title Add dev environment checks for Add dev environment checks Mar 18, 2025
@tkajtoch tkajtoch force-pushed the build/yarn-validate-env branch from 36fed90 to cf61d1a Compare April 14, 2025 11:05
@tkajtoch tkajtoch added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Apr 14, 2025
@kibanamachine
Copy link
Copy Markdown

Preview staging links for this PR:

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @tkajtoch

@tkajtoch
Copy link
Copy Markdown
Member Author

@weronikaolejniczak Yarn Berry (v2 and above) doesn't check for engines or similar. That's why it's necessary to handle these checks via plugins

Copy link
Copy Markdown
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

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

Tested, works great! Changes LGTM! 🟢

Screenshot 2025-04-16 at 08 17 05

@tkajtoch tkajtoch merged commit 11ee993 into elastic:main Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add development environment checks of Node.js version and OS

4 participants