Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Feature request: add pipeline artifacts endpoint

Edited

Goal

I want to have a Bitbucket API endpoint that allows me get information about the created artifacts of a pipeline

Use-case

Pull Requests pipelines can create artifacts that are approved as-is. If this artifact is deployed on merge (branches: production), I'd expect this exact artifact to be deployed.

If this artifact is created through external dependencies, these dependencies can change between the Pull Request pipeline and the actual deploy-on-merge.

To not have unexpected changes, you would want to pull the exact artifact of the approved pipeline and use that to deploy.

This is the recommended strategy of Terraform using `-out plan` artifacts (see https://developer.hashicorp.com/terraform/tutorials/automation/automate-terraform?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS#terraform-plan-out-tfplan-input-false)

Recommended implementation

Can be split in two requests. One to get artifact information and one endpoint to actually (down)load the content.

Endpoint: https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/artifacts

Response body:

PaginatedObject: {
values: Array<Artifact Object> {
      uuid: string
      step_uuid: string
      path: string
      file_size_byte: number
     created_on: string
   }
}

Endpoint: https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/artifacts/{artifact_uuid}/content

 

This relates to your internal API: https://bitbucket.org/!api/internal/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/artifacts

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 20, 2022

Hi Sander,

Thank you for the detailed use case and suggestion. We have an existing feature request about this in our issue tracker:

The request has been closed and it is not in our roadmap at the moment, as it had a low number of votes and comments. However, I would suggest posting a comment there to express your interest, as our product managers continue to monitor even closed requests.

Kind regards,
Theodora

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 23, 2022

Hi Sander,

You are very welcome and you are right, I have added the workaround in the feature request.

If you need anything further, please feel free to reach out!

Kind regards,
Theodora

Like Sander Mol likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events