Skip to content

Support npm operations using native npm client with .npmrc via --run-native flag #2952

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

Merged
merged 2 commits into from
May 14, 2025

Conversation

fluxxBot
Copy link
Collaborator

@fluxxBot fluxxBot commented Apr 13, 2025

  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

This PR introduces a new implementation for the npm publish command that supports both the existing and the updated approach.

  1. A new flag --run-native has been added to opt into the updated publish flow.
  2. When this flag is used, we now rely on the native npm client to perform the operation, rather than using rt upload command.
  3. This updated flow respects the user’s local .npmrc configuration, unlike the older approach which depended on jf config.
  4. The older flow was implemented in a single file. To improve maintainability and separation of concerns, the logic is now split across dedicated handlers:
    a. npmpublish: Uses the npm client.
    b. artifactoryupload: Retains the original behavior using Artifactory upload (rt).
    c. npminstall: Uses the user provided npmrc.
    d. artifactoryinstall: Creates our own npmrc from jf npm-config command.
  5. Two new interfaces Publisher and Installer is introduced in there respective strategy, abstracting the logic to switch between the two implementations based on the flag provided.

depends on:

  1. cli-core - Added config arg extractor and search result to build info converter for npm jfrog-cli-core#1374
  2. cli-artifactory - Added new npm publish and install implementation jfrog-cli-artifactory#63

@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label Apr 13, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 13, 2025
@fluxxBot fluxxBot added feature request New feature or request new feature Automatically generated release notes and removed feature request New feature or request labels Apr 15, 2025
@fluxxBot fluxxBot changed the title New npm publish implementation Support npm publish using native npm client with .npmrc via --use-npmrc flag Apr 15, 2025
@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label Apr 15, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 15, 2025
@fluxxBot fluxxBot requested a review from bhanurp April 15, 2025 06:45
@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label Apr 21, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Apr 21, 2025
@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label May 7, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label May 7, 2025
@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label May 7, 2025
@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label May 12, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label May 12, 2025
@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label May 13, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label May 13, 2025
@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label May 13, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label May 13, 2025
@fluxxBot fluxxBot requested a review from bhanurp May 13, 2025 10:49
@fluxxBot fluxxBot changed the title Support npm operations using native npm client with .npmrc via --client-native flag Support npm operations using native npm client with .npmrc via --run-native flag May 13, 2025
Copy link
Collaborator

@bhanurp bhanurp left a comment

Choose a reason for hiding this comment

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

test with specific version artifactory for macos failures

@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label May 14, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label May 14, 2025
@fluxxBot fluxxBot added the safe to test Approve running integration tests on a pull request label May 14, 2025
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label May 14, 2025
@fluxxBot fluxxBot merged commit 7791b03 into jfrog:dev May 14, 2025
53 of 66 checks passed
@fluxxBot fluxxBot added the ignore for release Automatically generated release notes label May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore for release Automatically generated release notes new feature Automatically generated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants