support source_template.<repo>.spec.ref.branch for dev workflows

Closes #1760 (closed)

This MR extends the tools that generate OCI artifacts for Helm-based units relying on GitRepositories, to allow them to work when in a development day-to-day activity we want to target a branch of the GitRepository (something we typically do, for instance, to test evolutions of sylva-capi-cluster).

This evolution was already desirable, but was made more important to implement after the merge of !3072 (merged) two days ago, which introduces testing of the OCI values overlay and hence requires playing a part of the OCI artifact building code for the helm-template-yamllint, and hence broke that job when branch is used in source_templates.

This MR:

  • does not change what we did in the past for source_templates relying on a tag
  • for source_templates relying on a branch, it fabricates a fake chart version combining the branch name and the current pipeline
    • adding the pipeline id allows to have an up-to-date OCI artifact each time a new pipeline is created
    • (without the pipeline id, a new pipeline after a change of the branch, would result in a different content and a failure to re-push the OCI artifact because of the checks done elsewhere in these tools to avoid overwriting an existing artifact with different content)

Example:

Edited by Thomas Morin

Merge request reports

Loading