semantic-release / travis-deploy-once

🚫Test multiple node versions on Travis. Deploy once. If all of them pass.
MIT License
33 stars 7 forks source link

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

Closed SimenB closed 6 years ago

SimenB commented 6 years ago

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: https://github.com/pwmckenna/node-travis-ci/pull/22, so that https://github.com/semantic-release/condition-travis/pull/101 is unblocked

pvdlg commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

SimenB commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

I can change the title of the pr