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

BitbucketService fails on post tag #1145

Open
frxncodominguez opened this issue Aug 6, 2024 · 0 comments
Open

BitbucketService fails on post tag #1145

frxncodominguez opened this issue Aug 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@frxncodominguez
Copy link

Describe the bug
We run a pipeline to build code from a repository and then publish that tag into the repository. We create a custom stage to be able to publish the tag in the related commit and the curl command execution fails returning 404.
I was checking the bitbucket API documentation and it seems that the URL has changed from the one that runs in the 'postTag' method.

To Reproduce
Steps to reproduce the behavior:

  1. Create stage for post tag
def stagePostTagOnRepository(def context) {
  stage('Post build tag on repository') {
    def bitbucket = ServiceRegistry.instance.get(BitbucketService)
    bitbucket.postTag(context.componentId, context.gitCommit, "0.1")
  }
}
  1. Execute pipeline

Expected behavior
The tag being published in the repository.

Affected version (please complete the following information):

  • OpenShift: 4.x
  • OpenDevStack 4.x

Log Output (ensure to remove any confidential information like tokens, project names, etc.

[Pipeline] sh (Post git tag to branch)
+ curl --fail -sS --request POST --header 'Authorization: Bearer ****' --header 'Content-Type: application/json' --data '{
                                     "force": "true",
                                     "message": "",
                                     "name": "0.2.0",
                                     "startPoint": "xxxx",
                                     "type": LIGHTWEIGHT
                                 }' https://xxxxxxx/api/1.0/projects/xxxxxxx/repos/xxxxxxx/tags
curl: (22) The requested URL returned error: 404 

Additional context
Based on the official documentation, I tried the following URL http://{baseurl}/rest/git/latest/projects/{projectKey}/repos/{repositorySlug}/tags and the tag was published without any problem

@frxncodominguez frxncodominguez added the bug Something isn't working label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant