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

GitHub releases datasource prevents updates when pinning is enabled #20160

Closed
devversion opened this issue Feb 1, 2023 · 5 comments · Fixed by #20178
Closed

GitHub releases datasource prevents updates when pinning is enabled #20160

devversion opened this issue Feb 1, 2023 · 5 comments · Fixed by #20178
Labels
status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality

Comments

@devversion
Copy link
Contributor

devversion commented Feb 1, 2023

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us what version of Renovate you run.

34.95.0

If you're self-hosting Renovate, select which platform you are using.

github.com

If you're self-hosting Renovate, tell us what version of the platform you run.

github.com

Was this something which used to work for you, and then stopped?

It used to work, and then stopped

Describe the bug

A very long time ago in Angular repositories we noticed that some Bazel WORKSPACE http_archive dependencies are no longer updated. Some rules were updated, some not.

Today I investigated & debugged this and it turned out to be only for http_archive rules using GitHub release URLs. The GitHub releases datasource seems properly determine the latest version, but the lookup/index.ts file discards the update because the github-releases datasource is not able to compute a getDigest() = null, causing the update to be skipped as per: https://github.com/renovatebot/renovate/blob/main/lib/workers/repository/process/lookup/index.ts#L404

There is no log warning etc. the rule is just never updated silently.

The getDigest method was implemented for the releases data source with: 91e2743.

Issue can be reproduced with build_bazel_rules_nodejs in WORKSPACE in https://github.com/angular/angular

Relevant debug logs

No response

Have you created a minimal reproduction repository?

No reproduction, but I have linked to a public repo where it occurs

@devversion devversion added priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality labels Feb 1, 2023
@devversion
Copy link
Contributor Author

devversion commented Feb 1, 2023

getDigest() returning null means that the update is omitted. The getDigest method arguably is a little unexpected for the github-releases datasource IMO because:

  1. it will never be able to compute a digest if there is no previous digest.
  2. it will always take the current digest if there is no currentValue (seems confusing to me).

It seems like the current getDigest logic is kind of respecting user input (i.e. a manual initial digest) to figure out which release artifacts should be incorporated for "new digest" updates. This logic does not work if there is no digest currently.

I would be happy to help improve this. I was already investigating/experimenting a lot, but don't know what solution the team prefers here. A release can contain X artifacts, and only via a specific artifact URL, a single artifact could be used for the digest computation

@viceice
Copy link
Member

viceice commented Feb 1, 2023

@devversion
Copy link
Contributor Author

devversion commented Feb 2, 2023

Thanks @viceice - yeah seems very related. Using the underlying commit of a tag as digest seems reasonable to me. I don't know if we can preserve the current behavior in github-releases if we'd choose a more simpler digest computation. I haven't seen a similar input-dependant digest compution as introduced with 91e2743. I will think a bit more about it.

devversion added a commit to devversion/renovate that referenced this issue Feb 2, 2023
This fixes the issue where updates are silently omitted
due to the new digest not being computable.

Improving the situation as in: renovatebot#20160.
devversion added a commit to devversion/renovate that referenced this issue Feb 2, 2023
… underlying Git tag

Currently the `github-releases` datasource `getDigest` method is rather
magical and depends/requires an existing digest and version. This makes
it difficult to use in some situations where pinning is enabled but no
initial digest is explicitly known. In such cases, Renovate just silently
stops updating: see. renovatebot#20160.

Additionally, some managers like `bazel` never pass a `digest` because
they handle the digest on their own. i.e. for Bazel updates with github
releases, the actual artifact checksum is used as digest and needs to
use an algorithm as determined by the manager.

The current approach of `getDigest` involves consulting the current
digest and iterating through the releases of the `currentValue` to
figure out which artifact is used for the digest. The artifact is then
mapped back to the new release (with some trickery to also ignore
version names in the filename..). This is somewhat reasonable but the
data source generally does not have a clear insight into what GitHub
artifact(s) are used by the manager. Or, alternatively, a manager might
not even want the digest of an individual artifact. e.g. as seen in:
renovatebot#19550

A more concrete and predictable digest of a GitHub release is the underlying SHA
of the release. This prevents cases where the release tag is changed to another version.
The individual managers are responsible for deciding whether the SHA is
relevant or not, or if they want to use an individual artifact. The
managers known the best since they have access to the URL. like seen in
`bazel`.

The problem that was solved with the current `getDigest` implementation
can be solved long-term with:
https://github.com/renovatebot/renovate/issues/6422.

BREAKING CHANGE: Regex Manager configurations relying on the
`github-release` data-source with digests will have different digest
semantics. The digest will always correspond to the underlying Git SHA
of the release/version.

Fixes renovatebot#20160.
devversion added a commit to devversion/renovate that referenced this issue Feb 2, 2023
… underlying Git tag

Currently the `github-releases` datasource `getDigest` method is rather
magical and depends/requires an existing digest and version. This makes
it difficult to use in some situations where pinning is enabled but no
initial digest is explicitly known. In such cases, Renovate just silently
stops updating: see. renovatebot#20160.

Additionally, some managers like `bazel` never pass a `digest` because
they handle the digest on their own. i.e. for Bazel updates with github
releases, the actual artifact checksum is used as digest and needs to
use an algorithm as determined by the manager.

The current approach of `getDigest` involves consulting the current
digest and iterating through the releases of the `currentValue` to
figure out which artifact is used for the digest. The artifact is then
mapped back to the new release (with some trickery to also ignore
version names in the filename..). This is somewhat reasonable but the
data source generally does not have a clear insight into what GitHub
artifact(s) are used by the manager. Or, alternatively, a manager might
not even want the digest of an individual artifact. e.g. as seen in:
renovatebot#19550

A more concrete and predictable digest of a GitHub release is the underlying SHA
of the release. This prevents cases where the release tag is changed to another version.
The individual managers are responsible for deciding whether the SHA is
relevant or not, or if they want to use an individual artifact. The
managers known the best since they have access to the URL. like seen in
`bazel`.

The problem that was solved with the current `getDigest` implementation
can be solved long-term with:
https://github.com/renovatebot/renovate/issues/6422.

BREAKING CHANGE: Regex Manager configurations relying on the
`github-release` data-source with digests will have different digest
semantics. The digest will always correspond to the underlying Git SHA
of the release/version.

Fixes renovatebot#20160.
devversion added a commit to devversion/renovate that referenced this issue Feb 2, 2023
This fixes the issue where updates are silently omitted
due to the new digest not being computable.

Improving the situation as in: renovatebot#20160.
devversion added a commit to devversion/renovate that referenced this issue Feb 2, 2023
… underlying Git tag

Currently the `github-releases` datasource `getDigest` method is rather
magical and depends/requires an existing digest and version. This makes
it difficult to use in some situations where pinning is enabled but no
initial digest is explicitly known. In such cases, Renovate just silently
stops updating: see. renovatebot#20160.

Additionally, some managers like `bazel` never pass a `digest` because
they handle the digest on their own. i.e. for Bazel updates with github
releases, the actual artifact checksum is used as digest and needs to
use an algorithm as determined by the manager.

The current approach of `getDigest` involves consulting the current
digest and iterating through the releases of the `currentValue` to
figure out which artifact is used for the digest. The artifact is then
mapped back to the new release (with some trickery to also ignore
version names in the filename..). This is somewhat reasonable but the
data source generally does not have a clear insight into what GitHub
artifact(s) are used by the manager. Or, alternatively, a manager might
not even want the digest of an individual artifact. e.g. as seen in:
renovatebot#19550

A more concrete and predictable digest of a GitHub release is the underlying SHA
of the release. This prevents cases where the release tag is changed to another version.
The individual managers are responsible for deciding whether the SHA is
relevant or not, or if they want to use an individual artifact. The
managers known the best since they have access to the URL. like seen in
`bazel`.

The problem that was solved with the current `getDigest` implementation
can be solved long-term with:
https://github.com/renovatebot/renovate/issues/6422.

BREAKING CHANGE: Regex Manager configurations relying on the
`github-release` data-source with digests will have different digest
semantics. The digest will always correspond to the underlying Git SHA
of the release/version.

Fixes renovatebot#20160.
@devversion
Copy link
Contributor Author

I've created a draft proposal PR to replace this digest logic: #20178. I've done it as a breaking change because that feels like the best to me (a draft to discuss this further)

devversion added a commit to devversion/renovate that referenced this issue Feb 3, 2023
This fixes the issue where updates are silently omitted
due to the new digest not being computable.

Improving the situation as in: renovatebot#20160.
devversion added a commit to devversion/renovate that referenced this issue Feb 9, 2023
…t` logic

In the previous commit, the `github-releases` datasource has been
renamed to `github-release-attachments`. The `github-releases` datasource
`getDigest` method was rather magical and depended/required an existing
digest and version. This makes it difficult to use in some situations
where pinning is enabled but no initial digest is explicitly known. In
such cases, Renovate just silently stoped updating: see. renovatebot#20160.

Additionally, some managers like `bazel` never pass a `digest` because
they handle the digest on their own. i.e. for Bazel updates with github
releases, the actual artifact checksum is used as digest and needs to
use an algorithm as determined by the manager.

The current approach of `getDigest` involved consulting the current
digest and iterating through the releases of the `currentValue` to
figure out which artifact/attachcment is used for the digest. The artifact
is then mapped back to the new release (with some trickery to also ignore
version names in the filename..). This is somewhat reasonable but the
data source generally does not have a clear insight into what GitHub
artifact(s) are used by the manager. Or, alternatively, a manager might
not even want the digest of an individual artifact. e.g. as seen in:
renovatebot#19550

To solve this, the existing datasource with this attachment logic is
was moved into `github-release-attachments`, while the more general
`github-releases` datasource is updated to use the underlying Git tag
for digest computation of a release entry.

BREAKING CHANGE: Regex Manager configurations relying on the
`github-release` data-source with digests will have different digest
semantics. The digest will always correspond to the underlying Git SHA
of the release/version now. The old behavior can be preserved by
switching to the `github-release-attachments` datasource.

Fixes renovatebot#20160. Fixes renovatebot#19552.
devversion added a commit to devversion/renovate that referenced this issue Feb 9, 2023
…t` logic

In the previous commit, the `github-releases` datasource has been
renamed to `github-release-attachments`. The `github-releases` datasource
`getDigest` method was rather magical and depended/required an existing
digest and version. This makes it difficult to use in some situations
where pinning is enabled but no initial digest is explicitly known. In
such cases, Renovate just silently stoped updating: see. renovatebot#20160.

Additionally, some managers like `bazel` never pass a `digest` because
they handle the digest on their own. i.e. for Bazel updates with github
releases, the actual artifact checksum is used as digest and needs to
use an algorithm as determined by the manager.

The current approach of `getDigest` involved consulting the current
digest and iterating through the releases of the `currentValue` to
figure out which artifact/attachcment is used for the digest. The artifact
is then mapped back to the new release (with some trickery to also ignore
version names in the filename..). This is somewhat reasonable but the
data source generally does not have a clear insight into what GitHub
artifact(s) are used by the manager. Or, alternatively, a manager might
not even want the digest of an individual artifact. e.g. as seen in:
renovatebot#19550

To solve this, the existing datasource with this attachment logic is
was moved into `github-release-attachments`, while the more general
`github-releases` datasource is updated to use the underlying Git tag
for digest computation of a release entry.

BREAKING CHANGE: Regex Manager configurations relying on the
`github-release` data-source with digests will have different digest
semantics. The digest will always correspond to the underlying Git SHA
of the release/version now. The old behavior can be preserved by
switching to the `github-release-attachments` datasource.

Fixes renovatebot#20160. Fixes renovatebot#19552.
devversion added a commit to devversion/renovate that referenced this issue Feb 9, 2023
…t` logic

In the previous commit, the `github-releases` datasource has been
renamed to `github-release-attachments`. The `github-releases` datasource
`getDigest` method was rather magical and depended/required an existing
digest and version. This makes it difficult to use in some situations
where pinning is enabled but no initial digest is explicitly known. In
such cases, Renovate just silently stoped updating: see. renovatebot#20160.

Additionally, some managers like `bazel` never pass a `digest` because
they handle the digest on their own. i.e. for Bazel updates with github
releases, the actual artifact checksum is used as digest and needs to
use an algorithm as determined by the manager.

The current approach of `getDigest` involved consulting the current
digest and iterating through the releases of the `currentValue` to
figure out which artifact/attachcment is used for the digest. The artifact
is then mapped back to the new release (with some trickery to also ignore
version names in the filename..). This is somewhat reasonable but the
data source generally does not have a clear insight into what GitHub
artifact(s) are used by the manager. Or, alternatively, a manager might
not even want the digest of an individual artifact. e.g. as seen in:
renovatebot#19550

To solve this, the existing datasource with this attachment logic is
was moved into `github-release-attachments`, while the more general
`github-releases` datasource is updated to use the underlying Git tag
for digest computation of a release entry.

BREAKING CHANGE: Regex Manager configurations relying on the
`github-release` data-source with digests will have different digest
semantics. The digest will always correspond to the underlying Git SHA
of the release/version now. The old behavior can be preserved by
switching to the `github-release-attachments` datasource.

Fixes renovatebot#20160. Fixes renovatebot#19552.
devversion added a commit to devversion/renovate that referenced this issue Feb 20, 2023
…t` logic

In the previous commit, the `github-releases` datasource has been
renamed to `github-release-attachments`. The `github-releases` datasource
`getDigest` method was rather magical and depended/required an existing
digest and version. This makes it difficult to use in some situations
where pinning is enabled but no initial digest is explicitly known. In
such cases, Renovate just silently stoped updating: see. renovatebot#20160.

Additionally, some managers like `bazel` never pass a `digest` because
they handle the digest on their own. i.e. for Bazel updates with github
releases, the actual artifact checksum is used as digest and needs to
use an algorithm as determined by the manager.

The current approach of `getDigest` involved consulting the current
digest and iterating through the releases of the `currentValue` to
figure out which artifact/attachcment is used for the digest. The artifact
is then mapped back to the new release (with some trickery to also ignore
version names in the filename..). This is somewhat reasonable but the
data source generally does not have a clear insight into what GitHub
artifact(s) are used by the manager. Or, alternatively, a manager might
not even want the digest of an individual artifact. e.g. as seen in:
renovatebot#19550

To solve this, the existing datasource with this attachment logic is
was moved into `github-release-attachments`, while the more general
`github-releases` datasource is updated to use the underlying Git tag
for digest computation of a release entry.

BREAKING CHANGE: Regex Manager configurations relying on the
`github-release` data-source with digests will have different digest
semantics. The digest will always correspond to the underlying Git SHA
of the release/version now. The old behavior can be preserved by
switching to the `github-release-attachments` datasource.

Fixes renovatebot#20160. Fixes renovatebot#19552.
rarkins pushed a commit that referenced this issue Mar 10, 2023
…t file digest (#20178)

The github-releases datasource has been copied into a new datasource called github-release-attachments.
The github-releases general datasource is updated to use the underlying Git tag of a GitHub release entry for digest computation.

Fixes #20160, Fixes #19552

BREAKING CHANGE: Regex Manager configurations relying on the github-release data-source with digests will have different digest semantics. The digest
will now always correspond to the underlying Git SHA of the release/version. The old behavior can be preserved by switching to the
github-release-attachments datasource.
rarkins pushed a commit that referenced this issue Mar 10, 2023
…t file digest (#20178)

The github-releases datasource has been copied into a new datasource called github-release-attachments.
The github-releases general datasource is updated to use the underlying Git tag of a GitHub release entry for digest computation.

Fixes #20160, Fixes #19552

BREAKING CHANGE: Regex Manager configurations relying on the github-release data-source with digests will have different digest semantics. The digest
will now always correspond to the underlying Git SHA of the release/version. The old behavior can be preserved by switching to the
github-release-attachments datasource.
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 35.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:requirements Full requirements are not yet known, so implementation should not be started type:bug Bug fix of existing functionality
Projects
None yet
3 participants