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

Allow authentication with registry.npmjs.com #94

Merged
merged 4 commits into from
Jan 9, 2018

Conversation

Ianfeather
Copy link
Contributor

@Ianfeather Ianfeather commented Oct 16, 2017

This adds functionality for #93

Making config.uplink an object and including auth as a property would be a little nicer imo, but it would be a breaking change and I'm not sure this warrants that change.

Could you give me some pointers on how to run the tests? Do I need to run them within the container? Currently when I run them locally they're almost all returned as pending. Let me know and i'll add tests for this functionality.

cc @dgautsch

@dgautsch dgautsch self-assigned this Oct 19, 2017
@dgautsch
Copy link
Collaborator

Looks good so far, can you add update the unit tests? @jdxcode does the package.json need to be updated? Doesn't npm publish handle that?

@Ianfeather
Copy link
Contributor Author

Hey @dgautsch, thanks for getting back to me. Regarding the unit tests:

Could you give me some pointers on how to run the tests? Do I need to run them within the container? Currently when I run them locally they're almost all returned as pending. Let me know and i'll add tests for this functionality.

I'm more than happy to help fix up existing tests too, but at the moment I have a totally unstable set of tests locally so I assume I'm running them incorrectly. Thanks.

@jdx
Copy link
Owner

jdx commented Oct 19, 2017

I definitely wouldn't change the version in a PR. I recommend using npm version or the np tool to do that when you publish a release. Either of those will create a git tag at the same time.

@Ianfeather
Copy link
Contributor Author

@dgautsch @jdxcode If you could tell me how I can run the tests locally I can add unit tests and land this patch?

@dgautsch
Copy link
Collaborator

dgautsch commented Nov 13, 2017

@Ianfeather hi Ian, apologies for the slow response, I was hoping jd would jump in here because the s3 tests are going to fail, looks like they're running through his personal amazon cloud. Running tests is done from the command line via npm test. For now lets add tests for the file system until S3 is figured out. Let me know if you hit issues.

@jdx
Copy link
Owner

jdx commented Nov 13, 2017

running locally you just need to set the AWS env vars to a valid S3 bucket. Running on circle is a different story, however. I'm not sure how to enable the public to run the tests without potentially exposing the credentials

package.json Outdated
@@ -1,7 +1,7 @@
{
"name": "npm-register",
"description": "Your own private npm registry and backup server",
"version": "2.5.2",
"version": "2.6.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Ianfeather revert this file, I will make sure it's updated when we republish.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

@Ianfeather
Copy link
Contributor Author

@jdxcode Thanks, that should give me enough to get going.

Would you be interested in an update which mocks s3 for the unit tests? You could potentially have a couple of integration tests that run separately to the core unit tests and actually hit an s3 bucket

@jdx
Copy link
Owner

jdx commented Nov 14, 2017

that sounds like a good idea, I wonder if there is something like nock for s3 that would be useful here

@Ianfeather
Copy link
Contributor Author

Ianfeather commented Nov 14, 2017

There's this https://www.npmjs.com/package/mock-aws-s3, I've never used it though.

I'll circle back to that in a different PR

@Ianfeather
Copy link
Contributor Author

I added test documentation in #95

@Ianfeather
Copy link
Contributor Author

@dgautsch This now has tests and all are passing locally.

There are commits that are in this and also in #95 - I'd recommend merging 95 if you can first, then i'll rebase this branch. I think they're both good to land though.

Let me know what you think from here.

@dgautsch
Copy link
Collaborator

dgautsch commented Nov 21, 2017 via email

@Ianfeather Ianfeather force-pushed the npm-auth-config branch 2 times, most recently from fdb6fe3 to dc3f09a Compare November 21, 2017 22:58
@dgautsch
Copy link
Collaborator

@Ianfeather There are a couple conflicts, can you resolve?

@codecov
Copy link

codecov bot commented Dec 27, 2017

Codecov Report

Merging #94 into master will increase coverage by 0.16%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   89.46%   89.63%   +0.16%     
==========================================
  Files          27       27              
  Lines         427      434       +7     
==========================================
+ Hits          382      389       +7     
  Misses         45       45
Impacted Files Coverage Δ
lib/config.js 100% <ø> (ø) ⬆️
lib/npm.js 75.47% <100%> (+3.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 262e563...df47615. Read the comment docs.

@Ianfeather
Copy link
Contributor Author

I think this might finally be ready to go! Integration tests pass locally

@Ianfeather
Copy link
Contributor Author

@dgautsch @jdxcode Are you ok to land this patch now?

@jdx
Copy link
Owner

jdx commented Jan 5, 2018

👍

@Ianfeather
Copy link
Contributor Author

@dgautsch Sorry to bug you. Are you happy to merge and publish this new version?

@dgautsch dgautsch merged commit d1c5aae into jdx:master Jan 9, 2018
@dgautsch
Copy link
Collaborator

dgautsch commented Jan 9, 2018 via email

@jdx
Copy link
Owner

jdx commented Jan 9, 2018

you should have it @dgautsch!

@Ianfeather
Copy link
Contributor Author

Fantastic, thanks both of you

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

3 participants