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

Feature request: add pipeline artifacts endpoint

Sander Mol December 16, 2022

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.
December 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

Sander Mol December 21, 2022

Thank you for finding this issue.

 

A workaround might be to use Bitbucket Downloads, as shared in https://community.atlassian.com/t5/Bitbucket-questions/How-to-use-build-artifact-from-one-pipeline-into-another/qaq-p/2025317#M81669.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 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