This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use NPMRC_DATA to write .npmrc file in auto-indexing job for Typescript #53529
Open
keynmol
wants to merge
5
commits into
main
Choose a base branch
from
npmrc-data-for-auto-inference
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3a0125a
Use NPMRC_DATA to write .npmrc file in auto-indexing job for Typescript
keynmol a25b02b
Request NPMRC_DATA env variable
keynmol 2e48614
Add NPMRC_DATA to the docs
keynmol 6033c92
Add NPMRC_DATA env var to tests
keynmol 3907752
Don't capitalise npm
keynmol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that Yarn supports this? Looking at the comments here: yarnpkg/yarn#871 as well as this SO answer: https://stackoverflow.com/a/72365311/2682729 -- Yarn seems to require a different .yarnrc file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm reading the PR you linked it falls back to .npmrc if it can't find its own file?
Also JFrog suggest that Yarn explicitly works: https://jfrog.com/help/r/jfrog-artifactory-documentation/using-yarn
The way I'm reading it is that you can use either, and Yarn obviously prefers its own thing, but it should support whatever is in
.npmrc
as wellThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JFrog's docs suggest that auth information in .npmrc should work
The issue you mentioned suggests that the registry address itself only works from .yarnc
Looks a bit messy, but may be we should get this into the hands of customers and see if it works for them? If not can always add
YARNRC_DATA
for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but some commenters point out that it doesn't work, at least in some situations (e.g. this comment: yarnpkg/yarn#871 (comment)). I can't figure out the details though, whether it's "just" user error or not...
Could you add a link to the docs in the Lua code where the .npmrc is being written, indicating that it is meant to work for Yarn too?
It seems like the data is the same, the only difference is the format, right? So would it make sense to unconditionally write the
.yarnrc
file too, just in case?Also, in terms of a feedback loop, I think it will not be fun to debug if a customer runs into this... If we'd like to merge this soon because of code freeze, I'm OK with merging this...
FWIW, in the past, I've used the free Artifactory trial to actually test out this kind of situation. It's pretty cumbersome, but it gave greater confidence in things working as expected. And as cumbersome as it was, it was still faster than iterating with a customer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see what you mean now.
Took a look at the docs for Yarn itself - seems like we can't get away with same data:
I will amend the docs to only mention npm, and address Yarn separately (there's an issue with Executors UI I need to fix beforehand)