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

fix(datasource/helm): Digests are blank on Gitlab #24280

Merged

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Sep 6, 2023

Changes

Ensures that newDigest is not set to null when it is left blank in the index.yaml.

Context

In #23432 support was added for digests. This introduces a regression when used in combination with the Helm repository on Gitlab. As a result packages hosted in the Gitlab Helm repository are no longer updated.

In the index.yaml generated by Gitlabs Helm Repository the digest is left blank. For example:

apiVersion: v2
entries:
  blank-digest:
  - apiVersion: v2
    created: '2023-09-05T13:25:19.046604000Z'
    description: A Helm chart with a blank digest
    digest:
    name: blank-digest
    urls:
    - https://charts.helm.sh/stable/packages/ambassador-2.7.0.tgz
    version: 2.7.0

As a result newDigest: release.digest will set the newDigest to null

result[name] = {
homepage: latestRelease.home,
sourceUrl,
releases: releases.map((release) => ({
version: release.version,
releaseTimestamp: release.created ?? null,
newDigest: release.digest,
})),

and this causes the update to be removed in workers/repository/process/lookup/index.ts.

// Strip out any non-changed ones
res.updates = res.updates
.filter(
(update) => update.newValue !== null || config.currentValue === null
)
.filter((update) => update.newDigest !== null)

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

In renovatebot#23432 support was added for digests. This introduces a regression
when used in combination with the Helm repository on Gitlab.

In the `index.yaml` generated by Gitlabs Helm Repository the digest is left
blank. For example:

```
apiVersion: v2
entries:
  blank-digest:
  - apiVersion: v2
    created: '2023-09-05T13:25:19.046604000Z'
    description: A Helm chart with a blank digest
    digest:
    name: blank-digest
    urls:
    - https://charts.helm.sh/stable/packages/ambassador-2.7.0.tgz
    version: 2.7.0
```

As a result `newDigest: release.digest` will set the `newDigest`
to `null` and this causes the update to be removed in
`workers/repository/process/lookup/index.ts`.
@mpkorstanje mpkorstanje marked this pull request as ready for review September 6, 2023 18:56
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM

lib/modules/datasource/helm/index.spec.ts Outdated Show resolved Hide resolved
viceice
viceice previously approved these changes Sep 7, 2023
auto-merge was automatically disabled September 7, 2023 17:13

Head branch was pushed to by a user without write access

@viceice viceice added this pull request to the merge queue Sep 7, 2023
Merged via the queue into renovatebot:main with commit 4b616c2 Sep 7, 2023
38 of 52 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 36.87.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mpkorstanje mpkorstanje deleted the fix/datasource-helm-without-digest branch September 7, 2023 19:25
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants