Bitbucket Server, reviewers from CODEOWNERS by email error is not an user #38960
-
How are you running Renovate?Self-hosted Renovate If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.Bitbucket v8.19.20, Renovate 41.163.1 Please tell us more about your question or problemWhen using Bitbucket Server and reviewers from CODEOWNERS, if a code owner is specified with email address, renovate gets the user slug by email (rif. )Then the PR is updated the Logs attached. Error like with renovate: export TOKEN=<token>
export EMAIL=<email>
export BITBUCKET_HOST=<bitbucket host>
export PROJECT=<project>
export REPO=<repo>
export PR=<pr_number>
# Get the slug of the user
export USER=$(curl -H "Authorization: Bearer $TOKEN" "https://$BITBUCKET_HOST/rest/api/1.0/users?export SLUG=$(curl -H "Authorization: Bearer $TOKEN" https://$BITBUCKET_HOST/rest/api/1.0/users?filter=$EMAIL | jq -r '.values[0].slug')
# Get required parameters from PR
export VERSION=$(curl -H "Authorization: Bearer $TOKEN" -v https://$BITBUCKET_HOST/rest/api/1.0/projects/$PROJECT/repos/$REPO/pull-requests/$PR | jq -r '.version')
export TITLE=$(curl -H "Authorization: Bearer $TOKEN" -v https://$BITBUCKET_HOST/rest/api/1.0/projects/$PROJECT/repos/$REPO/pull-requests/$PR | jq -r '.title')
# Update PR
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -v https://$BITBUCKET_HOST/rest/api/1.0/projects/$PROJECT/repos/$REPO/pull-requests/$PR -d "{\"version\":$VERSION,\"title\":\"$TITLE\",\"reviewers\":[{\"user\":{\"name\":\"$USER\"}}]}"And I'll get the following HTTP 409 error: Works if name is used instead of slug: # Get the name of the user
export USER=$(curl -H "Authorization: Bearer $TOKEN" "https://$BITBUCKET_HOST/rest/api/1.0/users?export SLUG=$(curl -H "Authorization: Bearer $TOKEN" https://$BITBUCKET_HOST/rest/api/1.0/users?filter=$EMAIL | jq -r '.values[0].slug')
# Update PR
curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -v https://$BITBUCKET_HOST/rest/api/1.0/projects/$PROJECT/repos/$REPO/pull-requests/$PR -d "{\"version\":$VERSION,\"title\":\"$TITLE\",\"reviewers\":[{\"user\":{\"name\":\"$USER\"}}]}"Logs (if relevant)Logs |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
|
If I understand it correctly, this issue only occurs when The atlassian-python-api SDK also uses |
Beta Was this translation helpful? Give feedback.
-
|
I have the same issue with Atlassian Bitbucket v9.4.15 and Renovate/43.3.4 Look the renovate debug
By the way, if PUT is performed by curl to BB API with the email into body works perfectly ❓Could this discussion turn into an issue? |
Beta Was this translation helpful? Give feedback.
-
|
Fix PR -> #41002 |
Beta Was this translation helpful? Give feedback.
Fix PR -> #41002