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

.prebuildrc upload token ignored #263

Open
bsrdjan opened this issue Oct 1, 2019 · 8 comments
Open

.prebuildrc upload token ignored #263

bsrdjan opened this issue Oct 1, 2019 · 8 comments

Comments

@bsrdjan
Copy link

bsrdjan commented Oct 1, 2019

The upload token works from command line:

$ prebuild -v 
9.1.0
$ prebuild -r napi -u a36078672b2028a70b80f270dafc3266b610f829                                                              
prebuild info begin Prebuild version 9.1.0
prebuild info build Preparing to prebuild node-rfc@1.0.0-rc11 for napi 3 on darwin-x64 using node-gyp
prebuild info build prebuilds/node-rfc-v1.0.0-rc11-napi-v3-darwin-x64.tar.gz exists, skipping build
prebuild info build Uploading 1 prebuilds(s) to GitHub releases
prebuild info build Found 3 prebuild(s) on Github
prebuild info build -> node-rfc-v1.0.0-rc11-napi-v3-darwin-x64.tar.gz
prebuild info build -> node-rfc-v1.0.0-rc11-napi-v3-linux-x64.tar.gz
prebuild info build -> node-rfc-v1.0.0-rc11-napi-v3-win32-x64.tar.gz
prebuild info build Uploaded 0 new prebuild(s) to GitHub

but ignored from .prebuildrc:

$ cat .prebuildrc
upload=a36078672b2028a70b80f270dafc3266b610f829

$ prebuild -r napi -u                                                                                                           prebuild info begin Prebuild version 9.1.0
prebuild info build Preparing to prebuild node-rfc@1.0.0-rc11 for napi 3 on darwin-x64 using node-gyp
prebuild info build prebuilds/node-rfc-v1.0.0-rc11-napi-v3-darwin-x64.tar.gz exists, skipping build
prebuild info build Uploading 1 prebuilds(s) to GitHub releases
prebuild ERR! build Error: Error from GitHub: Bad credentials
prebuild ERR! build     at createError (/Users/d037732/src/NG-APPS/node-rfc/node_modules/ghutils/ghutils.js:36:10)
prebuild ERR! build     at responseHandler (/Users/d037732/src/NG-APPS/node-rfc/node_modules/ghutils/ghutils.js:26:23)
prebuild ERR! build     at BufferList.request.pipe.bl [as _callback] (/Users/d037732/src/NG-APPS/node-rfc/node_modules/jsonist/jsonist.js:61:7)
prebuild ERR! build     at BufferList.end (/Users/d037732/src/NG-APPS/node-rfc/node_modules/bl/bl.js:113:10)
prebuild ERR! build     at DestroyableTransform.onend (/Users/d037732/src/NG-APPS/node-rfc/node_modules/readable-stream/lib/_stream_readable.js:523:10)
prebuild ERR! build     at Object.onceWrapper (events.js:286:20)
prebuild ERR! build     at DestroyableTransform.emit (events.js:203:15)
prebuild ERR! build     at /Users/d037732/src/NG-APPS/node-rfc/node_modules/readable-stream/lib/_stream_readable.js:965:16
prebuild ERR! build     at process._tickCallback (internal/process/next_tick.js:61:11)

Is my configuration wrong or something else?

@vweevers
Copy link
Member

vweevers commented Oct 1, 2019

The problem there is that the -u in prebuild -r napi -u is short for --upload and thus overrides the rc value.

So prebuild -r napi should work in this case, but you should be aware that upload=.. in rc currently has a side effect: prebuild takes that as an upload command (i.e. even when you don't want to upload).

@bsrdjan
Copy link
Author

bsrdjan commented Oct 1, 2019

Would it make sense to have the token=xxx in rc instead of upload=xxx (as a new option eventually?), so than only token read from rc, without triggering uploads?

@vweevers
Copy link
Member

vweevers commented Oct 1, 2019

Yes, it would! It's been suggested before (#131 (comment)).

A PR is welcome. Not sure if we can do it without a breaking change.

@bsrdjan
Copy link
Author

bsrdjan commented Oct 1, 2019

As a new option (token=xxx), why not?

@vweevers
Copy link
Member

vweevers commented Oct 1, 2019

Right, as a new option would not be breaking 👍

@magicdawn
Copy link

I came into a situation that

with .prebuildrc has upload=<some-token>
And prebuild --upload-all , I want to upload all, according to doc

Then rc.upload = token & rc['upload-all'] = true
Then with this code

prebuild/rc.js

Lines 71 to 73 in edb81c4

if (rc['upload-all']) {
rc.upload = rc['upload-all']
}

token value is discard, and set to true.
Then cause

image

@magicdawn
Copy link

I think we should not mess commands & flags
What I thought

make upload / upload-all as sub commands would be great.

prebuild upload -t <token>
prebuild upload-all -t <token>

@magicdawn
Copy link

And the upload-all operation can not continue from previous abort, may caused by network
image

Expect behavior:
if exists, output a message, and skip it

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

No branches or pull requests

3 participants