Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release jobs are triggered for renovate bot PRs #574

Closed
kravciak opened this issue Oct 29, 2024 · 1 comment · Fixed by #577
Closed

Release jobs are triggered for renovate bot PRs #574

kravciak opened this issue Oct 29, 2024 · 1 comment · Fixed by #577
Assignees
Labels
kind/bug Something isn't working

Comments

@kravciak
Copy link
Contributor

Example PR: chore(deps): update actions/checkout action to v4.2.2

Release job: https://github.com/kubewarden/helm-charts/actions/runs/11551186609
E2E tests: https://github.com/kubewarden/helm-charts/actions/runs/11551207278

@kravciak kravciak added the kind/bug Something isn't working label Oct 29, 2024
@viccuad viccuad self-assigned this Oct 29, 2024
@viccuad viccuad moved this to In Progress in Kubewarden Oct 29, 2024
@viccuad
Copy link
Member

viccuad commented Oct 30, 2024

There's 2 issues in play:

A. chart releaser incorrecly re-releases things with suffic -foo, like RCs, alphas and betas.

  1. chart-releaser is configured with env var CR_SKIP_EXISTING to true, which is the best we can do. This means chart-releaser doesn't publish the built releases, but still creates them under .cr-release-packages.
  2. chart-releaser seems to incorrectly update chart metadata that sits on index.yaml. But weirdly, this only happens for RCs or alphas and betas.

B. We look if there's new charts under .cr-release-packages/ and if there are, we create provenance and push the provenance. This file creation happens regardless of chart-releaser configuration on pushing the releases, so it's a wrong assumption.

Examples

For example, the following PR: #542

  1. Was merged after having released kubewarden-defaults-2.4.0-rc3.
  2. The release job from main says that it updated the index.yaml on the gh-pages branch, https://github.com/kubewarden/helm-charts/actions/runs/10989803081/job/30508724279#step:11:97, overwriting the kubewarden-defaults-2.4.0-rc3 GH release with a new chart that would have contained the PR fix. But actually it didn't.
  3. the fix is correctly shipped in the next release kubewarden-defaults-2.4.0-rc4.

Same for the following PR: #567

  1. Was merged after having released [kubewarden-controller-3.1.0-beta1](https://github.com/kubewarden/helm-charts/releases/tag/kubewarden-controller-3.1.0-beta1).
  2. The release job from main says that it updated the index.yaml on the gh-pages branch,
    https://github.com/kubewarden/helm-charts/actions/runs/11514993120/job/32054746937#step:10:98
    , overwriting the kubewarden-controller-3.1.0-beta1 GH release with a new chart that would have contained the PR fix. But actually it didn't.
  3. On the workflow run, we see the new bogus .cr-release-packages/kubewarden-controller-3.1.0-beta1.tgz file, and incorrectly sign it, push to the OCI registry, create provenance, and push that too.

Merged: #575
https://github.com/kubewarden/helm-charts/actions/runs/11596378269
this resulted in a new kubewarden-controller-3.1.0-rc1 release: 933f1be

Result

A seems incorrect for rcs,alphas,betas. We can open an issue in chart-releaser. This will stop the re-release of those, but doesn't solve our problem with B.

For B, we need to be aware on when do we have a real release at hand, to push to OCI registry on our own. This could be achieved by dropping the usage of the helm/chart-releaser-action GHA, and doing on our own:

for each chart:
  cr package <chart> # create .cr-release-packages/chart.tgz file that we use to know if we need to push, sign, etc
  <check if GH Release or tag exists matching the version of the chart.tgz with helm show, stop here if it does>
  cr upload <chart> # upload chart.tgz to GHA, skipped if CR_SKIP_EXISTING
  cr index # update index.yaml in branch gh-pages. If no cr upload, this means bogus entries

  helm push chart.tgz oci://repo
  cosign sign oci://repo@digest
  <create attestations and push>
end for 

@viccuad viccuad moved this from In Progress to Pending review in Kubewarden Oct 30, 2024
@jvanz jvanz self-assigned this Oct 30, 2024
@jvanz jvanz moved this from Todo to In Progress in Kubewarden Oct 30, 2024
@jvanz jvanz moved this from In Progress to Pending review in Kubewarden Nov 1, 2024
@jvanz jvanz closed this as completed in #577 Nov 6, 2024
@github-project-automation github-project-automation bot moved this from Pending review to Done in Kubewarden Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants