Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

fix(package): depend on fork of travis-ci to get Travis Enterprise support #27

Closed
wants to merge 1 commit into from
Closed

fix(package): depend on fork of travis-ci to get Travis Enterprise support #27

wants to merge 1 commit into from

Conversation

SimenB
Copy link
Contributor

@SimenB SimenB commented Dec 1, 2017

Depending on an unreleased version allows us to support Travis Enterprise

I realise this is probably not acceptable, but I though that maybe 😀

What I want is this: pwmckenna/node-travis-ci#22, so that semantic-release/condition-travis#101 is unblocked

package.json Outdated
@@ -15,7 +15,7 @@
"chalk": "^2.1.0",
"p-retry": "^1.0.0",
"semver": "^5.4.1",
"travis-ci": "^2.1.1"
"travis-ci": "github:pwmckenna/node-travis-ci#39ad0c315e53bc360850994ebaf01f73dc14a18e"
Copy link
Member

Choose a reason for hiding this comment

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

I’d like to not install from github if possible. But if they merged your PR but didn’t release it yet, you can release it as @simenb/travis-ci for the time being? And once the travis-ci is released with your changes, deprecate your own package and make another pull request for travis-deploy-once to depend on the main package again :)

@pvdlg
Copy link
Member

pvdlg commented Dec 2, 2017

I think there is no need for this PR. When pwmckenna/node-travis-ci#22 get released it's probably going to be a minor release, so it would be updated automatically without any change.

If it doesn't get release, then in the package.json of your own application you can override sub-dependencies: https://stackoverflow.com/a/17423915

So you could set it to force travis-deploy-once to depend on travis-ci version github:pwmckenna/node-travis-ci#39ad0c315e53bc360850994ebaf01f73dc14a18e instead of ^2.1.1

@SimenB
Copy link
Contributor Author

SimenB commented Dec 2, 2017

My thinking was mostly that merging semantic-release/condition-travis/pull/101 would be weird without actually supporting it here.

I suppose we can add a note in the readme of condition-travis that you have to override travis-ci dependency somehow until release if you want to use it.

@SimenB
Copy link
Contributor Author

SimenB commented Dec 2, 2017

I did what @gr2m suggested and published a fork with the current master if travis-ci.

so it would be updated automatically without any change

I still think updating here would be a good idea, so that consumers don't get fooled by caching or something like that - ensuring that the version of travis-ci actually support what you need it to for you documented features to work seems like a good idea 🙂

@pvdlg
Copy link
Member

pvdlg commented Dec 2, 2017

I still think updating here would be a good idea, so that consumers don't get fooled by caching or something like that.

Works for me.

Did you manage to override the dependency in your package.json?

@SimenB
Copy link
Contributor Author

SimenB commented Dec 2, 2017

Did you manage to override the dependency in your package.json?

I haven't tested, but https://yarnpkg.com/lang/en/docs/selective-version-resolutions/ seems like it should work 🙂

I'll give it a try

@SimenB
Copy link
Contributor Author

SimenB commented Dec 2, 2017

It seems to work, as the build was able to wait for other builds, and I'm now stuck on a new error.

[Semantic release]: Load plugin @semantic-release/github
[Semantic release]: Run automated release from branch master
[Semantic release]: Call plugin verify-conditions
[Semantic release]: Verify authentication for registry https://artifacts.schibsted.io/artifactory/api/npm/npm-local/
[Semantic release]: Wrote NPM_USERNAME, NPM_PASSWORD and NPM_EMAIL to .npmrc.
[Travis Deploy Once]: Aborting attempt 1, because of pending job(s): 29.2.
[Travis Deploy Once]: Aborting attempt 2, because of pending job(s): 29.2.
[Travis Deploy Once]: Success at attempt 3. All 3 jobs passed.
[Travis Deploy Once]: All jobs are successful for this build!
[Semantic release]: Call plugin get-last-release
info attempt registry request try #1 at 08:57:29
http request GET https://artifacts.schibsted.io/artifactory/api/npm/npm-local/@finn-no%2Ftest-semantic-release
http 401 https://artifacts.schibsted.io/artifactory/api/npm/npm-local/@finn-no%2Ftest-semantic-release
[Semantic release]: An error occurred while running semantic-release: { Error: Registry returned 401 for GET on https://artifacts.schibsted.io/artifactory/api/npm/npm-local/@finn-no%2Ftest-semantic-release
    at makeError (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/npm-registry-client/lib/request.js:314:12)
    at RegClient.<anonymous> (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/npm-registry-client/lib/request.js:292:14)
    at Request._callback (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/npm-registry-client/lib/request.js:216:14)
    at Request.self.callback (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/request/request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/request/request.js:1085:12)
  pkgid: '@finn-no/test-semantic-release',
  statusCode: 401,
  code: 'E401' }

Do you have any ideas? Auth against the registry passed before, and I do npm config set always-auth true before calling semantic-release.

I can open up a new issue at https://github.com/semantic-release/npm if that's better

@SimenB
Copy link
Contributor Author

SimenB commented Dec 2, 2017

This is what I added to package.json to make the travis stuff work, btw:

  "resolutions": {
    "**/@semantic-release/condition-travis": "SimenB/condition-travis#db3fd849cdf2ad9162f2acdf5f409f9e82f5ac76",
    "**/travis-ci": "pwmckenna/node-travis-ci#39ad0c315e53bc360850994ebaf01f73dc14a18e"
  }

@pvdlg
Copy link
Member

pvdlg commented Dec 2, 2017

It seems your package is private and the registry user configured doesn't have the permission to access this package.

Or maybe it's the always-auth that is not set properly for some reasons.

Can you create a .npmrc file at the root of your repo and add always-auth = true to it. And commit it to your repo.

@SimenB
Copy link
Contributor Author

SimenB commented Dec 2, 2017

Didn't help 🙁 node -p "require('npm-conf')().get('always-auth');" in the repo returns true. So unless there's some other code than https://github.com/semantic-release/npm/blob/5fb0b09f61ad229e5201d803050fd5fbd51e4937/lib/get-last-release.js#L18-L19 which runs, something is pretty weird

@SimenB
Copy link
Contributor Author

SimenB commented Dec 2, 2017

Something is weird with the auth somehow, as I'm able to do npm info my-pkg right after semantic-release fails and get a 404 instead of a 401.

As can be seen in the log the GET request is against the exact same URI.

[Semantic release]: Call plugin get-last-release
info attempt registry request try #1 at 10:02:16
http request GET https://artifacts.schibsted.io/artifactory/api/npm/npm-virtual/@finn-no%2Ftest-semantic-release
http 401 https://artifacts.schibsted.io/artifactory/api/npm/npm-virtual/@finn-no%2Ftest-semantic-release
[Semantic release]: An error occurred while running semantic-release: { Error: Registry returned 401 for GET on https://artifacts.schibsted.io/artifactory/api/npm/npm-virtual/@finn-no%2Ftest-semantic-release
    at makeError (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/npm-registry-client/lib/request.js:314:12)
    at RegClient.<anonymous> (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/npm-registry-client/lib/request.js:292:14)
    at Request._callback (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/npm-registry-client/lib/request.js:216:14)
    at Request.self.callback (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/request/request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/home/travis/build/simen-bekkhus/test-semantic-release/node_modules/request/request.js:1085:12)
  pkgid: '@finn-no/test-semantic-release',
  statusCode: 401,
  code: 'E401' }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
after_success.2
0.51s$ npm info @finn-no/test-semantic-release --verbose
npm info it worked if it ends with ok
npm verb cli [ '/home/travis/.nvm/versions/node/v8.9.1/bin/node',
npm verb cli   '/home/travis/.nvm/versions/node/v8.9.1/bin/npm',
npm verb cli   'info',
npm verb cli   '@finn-no/test-semantic-release',
npm verb cli   '--verbose' ]
npm info using npm@5.5.1
npm info using node@v8.9.1
npm verb request uri https://artifacts.schibsted.io/artifactory/api/npm/npm-virtual/@finn-no%2ftest-semantic-release
npm verb request always-auth set; sending authorization
npm info attempt registry request try #1 at 10:02:17
npm verb request id 6f52c523e118554b
npm http request GET https://artifacts.schibsted.io/artifactory/api/npm/npm-virtual/@finn-no%2ftest-semantic-release
npm http 404 https://artifacts.schibsted.io/artifactory/api/npm/npm-virtual/@finn-no%2ftest-semantic-release
npm verb headers { 'cache-control': 'no-cache="set-cookie"',
npm verb headers   'content-type': 'application/json',
npm verb headers   date: 'Sat, 02 Dec 2017 10:02:18 GMT',
npm verb headers   server: 'Artifactory/4.16.0',
npm verb headers   'set-cookie': 
npm verb headers    [ 'AWSELB=AFFD496318D47D231011BA167F1CC7394D9EAA8B570669FA02C38F852FD130DB3FDD0B8BA98B9D2543D1E51A647F1B7CBDFE0DCCD0F45003A0E19B8C801EF7115378699C7D;PATH=/;MAX-AGE=420' ],
npm verb headers   'x-artifactory-id': '8b6f07ae0e3c2fd0823547aa8a2eda7f42bf391c',
npm verb headers   'x-artifactory-node-id': 'artifactory_i-02c1757a42341253c_master',
npm verb headers   'content-length': '54',
npm verb headers   connection: 'keep-alive' }
npm verb stack Error: 404 Not Found: @finn-no/test-semantic-release
npm verb stack     at makeError (/home/travis/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:314:12)
npm verb stack     at RegClient.<anonymous> (/home/travis/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:300:14)
npm verb stack     at Request._callback (/home/travis/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:216:14)
npm verb stack     at Request.self.callback (/home/travis/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/request/request.js:186:22)
npm verb stack     at emitTwo (events.js:126:13)
npm verb stack     at Request.emit (events.js:214:7)
npm verb stack     at Request.<anonymous> (/home/travis/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/request/request.js:1163:10)
npm verb stack     at emitOne (events.js:116:13)
npm verb stack     at Request.emit (events.js:211:7)
npm verb stack     at IncomingMessage.<anonymous> (/home/travis/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/request/request.js:1085:12)
npm verb statusCode 404
npm verb pkgid @finn-no/test-semantic-release
npm verb cwd /home/travis/build/simen-bekkhus/test-semantic-release
[0mnpm verb Linux 3.19.0-79-generic
npm verb argv "/home/travis/.nvm/versions/node/v8.9.1/bin/node" "/home/travis/.nvm/versions/node/v8.9.1/bin/npm" "info" "@finn-no/test-semantic-release" "--verbose"
npm verb node v8.9.1
npm verb npm  v5.5.1
npm ERR! code E404
npm ERR! 404 Not Found: @finn-no/test-semantic-release
npm ERR! 404 
npm ERR! 404  '@finn-no/test-semantic-release' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 

@SimenB
Copy link
Contributor Author

SimenB commented Dec 2, 2017

I'll open up a new issue on the npm package as my current issue is not related to this PR

@SimenB
Copy link
Contributor Author

SimenB commented Dec 3, 2017

Ok, figured it out 🙂

Will this be merged? I can override it in my own project, but would be great if I didn't have to!

@pvdlg
Copy link
Member

pvdlg commented Dec 3, 2017

Will this be merged? I can override it in my own project, but would be great if I didn't have to!

Not with a dependency to a specific github commit or branch.

If pwmckenna/node-travis-ci#22 doesn't get released in the next few days/weeks, I'll refactor this plugin to use a solution that support Travis API v3, as the v2 is deprecated and can go away any time.

@SimenB
Copy link
Contributor Author

SimenB commented Dec 3, 2017

I've published a fork though, if you check the commit.

I can change the title of the pr

@SimenB SimenB changed the title fix(package): depend on travis-ci from github fix(package): depend on fork of travis-ci to get Travis Enterprise support Dec 3, 2017
@pvdlg pvdlg mentioned this pull request Dec 11, 2017
@pvdlg pvdlg closed this in #29 Dec 11, 2017
@SimenB SimenB deleted the install-travis-ci-from-github branch December 11, 2017 16:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants