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
bitbucket cloud: no provider.user has been set #416
Comments
can reproduce locally :
|
there is a bug with bitbucket cloud where it checks for the url when it should not, @jwennerberg can you try adding the api url to git_provider like this : spec:
git_provider:
secret:
key: token
name: bitbucket-cloud-token
user: jwennerb
url: https://api.bitbucket.org/2.0
url: https://bitbucket.org/jwennerb/hello-go (i have another issue with a status and token having some issues setting the statuses but i am not sure they are related to my setup or a breakage) (we need to fix the e2e tests since they seem to silently passthru) |
Adding the api url solved parts of it at least. I get further. I seem to have a permissions issue now.
Do we have documentation on the permissions needed for the 'app password'? The Pull Request gets updated in Bitbucket but throws:
|
Yep, trying to figuring this out at the moment, it seems that things has a bit changed lately and the new generated token needs more permissions to set statuses,
|
it's pretty weird what is happening, I have two accounts one attached to my work account @redhat.com and one personal one for testing, if i create a token for the personal one with theses rights : and try to set a status with that token on a commit via the bitbucket API : % curl -u user:token -d @/tmp/a.json https://api.bitbucket.org/2.0/repositories/user/pac/commit/2b0ad01549a171867b8b02edc149af7006317011/statuses/build/ -H 'Content-Type: application/json' -f
curl: (22) The requested URL returned error: 401 I get a 401 If i try the same thing on my work account, create a token and try with curl : % curl -u cboudjna:token-d @/tmp/a.json https://api.bitbucket.org/2.0/repositories/cboudjna/foobar/commit/9a2fd2dc71dcde68ead5c69e99a9f5c6d6e2c0c4/statuses/build/ -H 'Content-Type: application/json' -f
{"key": "MY-BUILD", "description": "passed", "repository": {"links": {"self": {"href": "https://api.bitbucket.org/2.0/repositories/cboudjna/foobar"}, "html": {"href": "https://bitbucket.org/cboudjna/foobar"}, "avatar": {"href": "https://bytebucket.org/ravatar/%7Be736ae44-aae5-4534-874e-11946fc13fe7%7D?ts=default"}}, "type": "repository", "name": "foobar", "full_name": "cboudjna/foobar", "uuid": "{e736ae44-aae5-4534-874e-11946fc13fe7}"}, "url": "https://dashboard.kind.pipelines.devcluster.openshift.com", "links": {"commit": {"href": "https://api.bitbucket.org/2.0/repositories/cboudjna/foobar/commit/9a2fd2dc71dcde68ead5c69e99a9f5c6d6e2c0c4"}, "self": {"href": "https://api.bitbucket.org/2.0/repositories/cboudjna/foobar/commit/9a2fd2dc71dcde68ead5c69e99a9f5c6d6e2c0c4/statuses/build/MY-BUILD"}}, "refname": null, "state": "SUCCESSFUL", "created_on": "2022-02-17T15:28:30.400870+00:00", "commit": {"hash": "9a2fd2dc71dcde68ead5c69e99a9f5c6d6e2c0c4", "type": "commit", "links": {"self": {"href": "https://api.bitbucket.org/2.0/repositories/cboudjna/foobar/commit/9a2fd2dc71dcde68ead5c69e99a9f5c6d6e2c0c4"}, "html": {"href": "https://bitbucket.org/cboudjna/foobar/commits/9a2fd2dc71dcde68ead5c69e99a9f5c6d6e2c0c4"}}}, "updated_on": "2022-02-17T15:47:50.143956+00:00", "type": "build", "name": ""} I can properly set the status as it should be, I do have a atlassian product attached to my work account (Bitbucket Data Center), I wonder if they started to restrict API call for free users (big 😞 if that's the case) |
I also confirmed the permissions issue on my end. It's working now, but then that's probably because I also use my work account. |
great let me add this to the documentation then. (it's perhaps an issue with my test account as well) |
When we run in bitbucket cloud we don't need to set a api url and documented as is. Don't bail out on one. The other providers who need an api url will anyway check for it in SetClient and bail out if not set properly. This was introduced as a side effect when running the tests since we were constructing the tests with GitProvider struct set and we check in the code when it's not nil. Fix the test fixture to not passing the strucs unless we have a URL or user passed. Closes openshift-pipelines#416 Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
thanks @jwennerberg i have added your screenshot on #418 |
there is report that pac is not working with bitbucket cloud, with error :
repo crd:
we need to investigate
The text was updated successfully, but these errors were encountered: