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

ensure packageManager is correctly set for yarn #343

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

taylormadore
Copy link
Contributor

@taylormadore taylormadore commented Oct 9, 2023

This change depends on #338

STONEBLD-1776

Since we will rely on corepack to download and configure
the correct version of yarn for a request, ensure that
packageManager is defined in package.json.

Use either yarnPath from .yarnrc, packageManager, or a
combination of the two to set the correct yarn version.

Raise exceptions for the following cases:

  • packageManager is already set, but we can't parse it
  • neither yarnPath or packageManager is set (or parseable)
  • the versions specified by yarnPath and packageManager
    are different

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • n/a Docs updated (if applicable)
  • n/a Docs links in the code are still valid (if docs were updated)

@taylormadore taylormadore changed the title WIP: ensure packageManager is correctly set for yarn ensure packageManager is correctly set for yarn Oct 10, 2023
@taylormadore taylormadore marked this pull request as ready for review October 10, 2023 20:07
Copy link
Contributor

@chmeliik chmeliik left a comment

Choose a reason for hiding this comment

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

Nice work 🎉

I didn't realize how important it was to compare the versions as semver.VersionInfo until I saw the +sha case

cachi2/core/package_managers/yarn/main.py Outdated Show resolved Hide resolved
cachi2/core/package_managers/yarn/main.py Outdated Show resolved Hide resolved
tests/unit/package_managers/yarn/test_main.py Outdated Show resolved Hide resolved
cachi2/core/package_managers/yarn/project.py Show resolved Hide resolved
@taylormadore taylormadore force-pushed the configure-yarn branch 2 times, most recently from cf96dfe to 9d87887 Compare October 11, 2023 15:00
Copy link
Contributor

@chmeliik chmeliik left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@brunoapimentel brunoapimentel left a comment

Choose a reason for hiding this comment

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

Left a minor comment, but otherwise LGTM

STONEBLD-1776

Since we will rely on corepack to download and configure
the correct version of yarn for a request, ensure that
packageManager is defined in package.json.

Use either yarnPath from .yarnrc, packageManager, or a
combination of the two to set the correct yarn version.

Raise exceptions for the following cases:
  - packageManager is already set, but we can't parse it
  - neither yarnPath or packageManager is set (or parseable)
  - the versions specified by yarnPath and packageManager
    are different

Signed-off-by: Taylor Madore <[email protected]>
@taylormadore
Copy link
Contributor Author

Rebased on main

@taylormadore taylormadore added this pull request to the merge queue Oct 16, 2023
Merged via the queue into containerbuildsystem:main with commit 4acb288 Oct 16, 2023
15 checks passed
@taylormadore taylormadore deleted the configure-yarn branch October 16, 2023 16:17
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.

3 participants