-
Notifications
You must be signed in to change notification settings - Fork 304
component-update: fails to fetch tags from private BitBucket repositories #582
Comments
@stephenmathieson is this a private component? If so, have you configured your globals? Can you run with DEBUG=* and provide the output? Leaving a note for myself to verify that this isn't a problem with BitBucket's lack of support for Git trees, could be related to componentjs/remotes.js#14 (diff) |
yup it's private. I've got my credentials setup, but still seeing this. I'll look more in depth in a bit
|
here's output with all of the debug stuff: https://gist.github.com/stephenmathieson/b4c065fb3e32fe491f2d. no mention of bitbucket at all :/ |
@stephenmathieson yeah, it's pretty difficult for me to tell if this has anything to do with the bitbucket remote. It's worth noting that if the BitBucket repo you are trying to use doesn't conform to semver and use release tags, it's possible this could be causing the issue. It is very strange that the error message from debug != the error message from your original post, I'm not too sure what's going on with that. Out of curiousity, can you confirm that the BitBucket repo (private) you are looking for is not being treated as local in your Gist? i.e. "some-bitbucket-user/some-bitbucket-component" whatever that was, is it in the Gist at all? Additionally, try navigating to this URL directly and seeing if you get any JSON (in browser, logged in as a user who has access to that repo):
As an example, this is what it should look like in a public repo
The error that you are getting in your original post is only possible if you get a 404 from https://api.bitbucket.org/1.0/repositories/some-bitbucket-user/some-bitbucket-component/tags Relevant code here for reference: https://github.com/component/remotes.js/blob/master/lib/remotes/bitbucket.js#L46 |
haha, yeah, some-bitbucket-user isn't the actual username :p the actual error is displayed on lines 724-736 the API will 403 without credentials:
but with credentials, we'll get back:
EDIT: typo |
btw, it looks like we're never hitting the API at all: https://gist.github.com/stephenmathieson/b4c065fb3e32fe491f2d#file-gistfile1-txt-L471 |
So that line 471 should be using bitbucket but instead it's using Github? |
yup |
Interesting. The way it works right now is that it is cascading, that is, component checks locally first, then reaches out to github, and if it doesn't find it, it should then go to the next remote (only BitBucket). This is because we cannot explicitly tell component which repo belongs to which remote via component.json (the spec doesn't support this but it has been discussed, I can't find the thread though). See: https://github.com/component/remotes.js/blob/master/lib/remotes.js#L98 It looks like for some reason, in this case, it's throwing an err for Github and then never trying for BitBucket. I will definitely spend some more time with this and see what's up |
maybe change the order in the component.json:
But I think then you can't use private gihub repos. |
At some point ong and I discussed having the user specify remotes in their dependencies. It could also be a list of remotes in the component.json, or something similar.
I like your previous example where remote order is specified via component.json though, that's a good idea. I would ideally combine the two ideas, so that people can still prefix their deps to optimize speed and accuracy of downloads, and avoid issues of failed lookups. Because of how component/remotes.js is constructed, it's fairly simple to add any remote that has a decent API. I was working on CodePlex for a while but their API is godawful. Post 1.0 I would like to try to add all known remotes :-) that would keep Component relevant as well, "the package manager that works across all Git hosting platforms", etc |
running
component-update
on a project with BitBucket deps fails:The text was updated successfully, but these errors were encountered: