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

Update yarn version check #3588

Merged
merged 1 commit into from
Oct 26, 2022
Merged

Update yarn version check #3588

merged 1 commit into from
Oct 26, 2022

Conversation

yads
Copy link
Contributor

@yads yads commented Oct 24, 2022

Ensure version check is run inside the project workspace, i.e. the directory with package.json

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature (please, look at the "Scope of the project" section in the README.md file)
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

a project with multiple sub projects, but no root package.json/yarn.lock/.yarnrc.yml that uses yarn berry will fail to detect project using yarn berry. E.G.

WORKSPACE
proj1/
  package.json
  yarn.lock
  BUILD
proj2/
  .yarn/...
  package.json
  yarn.lock
  .yarnrc.yml
  BUILD

WORKSPACE having the following:

yarn_install(
    name = "proj1_npm",
    package_json = "@//proj1:package.json",
    yarn_lock = "@//proj1:yarn.lock",
)

yarn_install(
    name = "proj2_npm",
    package_json = "@//proj2:package.json",
    yarn_lock = "@//proj2:yarn.lock",
    data = [
        "@//proj2:.yarnrc.yml",
        "@//proj2:.yarn/releases/yarn-3.2.4.cjs",
    ]
)

Will detect yarn1 for proj2 and fail trying to use yarn1 command line options
Issue Number: N/A

What is the new behavior?

Both proj1 and proj2 will use the correct version of yarn for that project

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Ensure version check is run inside the project workspace, i.e. the directory with package.json
@google-cla
Copy link

google-cla bot commented Oct 24, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@yads yads marked this pull request as ready for review October 25, 2022 16:50
Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

awesome, thanks for explaining the problem and the fix :)

@alexeagle alexeagle merged commit 3bf5fdd into bazelbuild:stable Oct 26, 2022
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.

None yet

2 participants