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

Restrict user from using yarn v4 #44

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

fluxxBot
Copy link
Collaborator

@fluxxBot fluxxBot commented Feb 10, 2025

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

depends on:

  1. Restrict user from using yarn v4 jfrog-cli-core#1347

@fluxxBot fluxxBot requested a review from bhanurp February 10, 2025 12:30
Copy link

github-actions bot commented Feb 10, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@fluxxBot
Copy link
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

@fluxxBot
Copy link
Collaborator Author

  1. Added error message when user trying to upgrade to v4 in yarn
  2. Allowed user to change the version irrespective of which version being currently used
  3. Allowed user to check version irrespective of which version being currently used
  4. Added check when a user tries to fetch config get which returns undefined in the newer yarn version
  5. Prevents user from switching to version v4 of yarn

@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label Feb 11, 2025
artifactory/commands/yarn/yarn.go Outdated Show resolved Hide resolved
artifactory/commands/yarn/yarn.go Outdated Show resolved Hide resolved
artifactory/commands/yarn/yarn.go Outdated Show resolved Hide resolved
artifactory/commands/yarn/yarn.go Outdated Show resolved Hide resolved
artifactory/commands/yarn/yarn.go Outdated Show resolved Hide resolved
artifactory/commands/yarn/yarn.go Outdated Show resolved Hide resolved
artifactory/commands/yarn/yarn.go Outdated Show resolved Hide resolved
artifactory/commands/yarn/yarn.go Show resolved Hide resolved
args []string
expected bool
}{
{[]string{"set", "version", "1.22.10"}, true},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since minimum supported yarn version in 2.X.X, when version is set to anything below that should fail. Is that happening ? Could you please add a case and check if not

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

above test is written only to skip version check when switching back and forth from an unsupported version, say switching back to lower versions from v4, currently you can switch back to a lower unsupported version say 1.x.x but you won't be able to switch back from it

artifactory/commands/yarn/yarn.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test Approve running integration tests on a pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants