opendevstack / ods-pipeline

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

Consult artifact repository in artifact check #715

Closed michaelsauter closed 1 year ago

michaelsauter commented 1 year ago

Artifacts may be downloaded in the start task from repository A, but should be uploaded to repository B in the finish task. In this case, Contains erroneously returned true before this change. Contains should only return true if the artifacts were downloaded from the same repository earlier. When the repositories differ, the task must fetch a manifest from the target repository before checking the manifest.

Tasks:

michaelsauter commented 1 year ago

I do not see true issues, but it feels a bit too subtle to me to have the artifactsDir being the empty string be interpreted in that way. Nonetheless could be merged as is so I am approving.

I do agree that the empty string feels wrong. I briefly tried a solution that would just return a manifest and one could pass a function what to do with each artifact but I did not like how it turned out. So I took the shortest path :)

Long-term, my current thinking is that there should be a way to just get the manifest, and then have a separate function that allows to download the files connected to a manifest. How does that sound to you? If you agree, we can create a refactoring issue to track this.