opendevstack / ods-pipeline

Alternative ODS CI/CD pipeline based on Tekton / OpenShift Pipelines
Apache License 2.0
13 stars 5 forks source link

Use pipeline run name as Bitbucket build status key #742

Closed michaelsauter closed 10 months ago

michaelsauter commented 11 months ago

Closes #736.

Tasks:

henrjk commented 11 months ago

I find https://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/ helpful. My understanding is:

  1. The build status is associated with a commit even across repositories (and it appears projects even).
  2. One can distinguish multiple build results by associating them with different keys. For example branch builds could have key 'branch' and integration builds 'integration'. The key could also be used to separate build results for different repositories.
  3. Multiple builds with the same commit/key are not distinguished.

Number 1 appears troubling to me at first glance. On the other hand in practice this could be useful to connect a build status when a commit is deployed for example by a helm umbrella repo when it deploys a commit. Key could be 'DeployTest'. Perhaps I could be convinced that this is desirable.

When shown in summary spots in the UI the build results for a commit with different keys are combined:

Having a single red build taint the overall (summarized) status feels strange to me (so perhaps I am misunderstanding the bitbucket behavior). Assuming the above is correct and deletes a pipeline run for a failed build, because perhaps it is stuck, a new build would have a new PipelineRuns derived key and this could never turn the build summary green.

Perhaps it would make sense to allow the key to be specified in ods.yaml. So that branch builds use an empty key (or git commit-sha) and integration build can use a different key.

henrjk commented 11 months ago

We had a side conversation.

This PR will be helpful for distinguishing pipeline runs in umbrella repositories where the same commit triggers different builds depending on the (target) branch.