renovate icon indicating copy to clipboard operation
renovate copied to clipboard

fix(datasource/custom): Support digest in custom datasource

Open fstehle opened this issue 1 year ago • 4 comments

Changes

To support digests a datasource has to implement the getDigest method. This PR implements the method returning a null promise. The value itself can be provided in the getReleases method.

Context

Documentation (please check one with an [x])

  • [ ] I have updated the documentation, or
  • [x] 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
  • [x] Both unit tests + ran on a real repository

fstehle avatar Dec 14 '23 16:12 fstehle

why do we need this? that function shouldn't be called when the digest is already returned in releases.

viceice avatar Dec 15 '23 08:12 viceice

Not fond of this solution, tough a better fix would need bigger changes.

Yes, absolutely. Would you suggest to modify supportsDigests in https://github.com/renovatebot/renovate/blob/6884d83a0573ebd40210cf0717c1814afd68a649/lib/modules/datasource/index.ts#L392 instead?

fstehle avatar Dec 15 '23 08:12 fstehle

why do we need this? that function shouldn't be called when the digest is already returned in releases.

That is not what I observed, supportsDigests returns false and no digest update is made.

See the following lines for that:

  • https://github.com/renovatebot/renovate/blob/6884d83a0573ebd40210cf0717c1814afd68a649/lib/modules/datasource/index.ts#L392)
  • https://github.com/renovatebot/renovate/blob/6884d83a0573ebd40210cf0717c1814afd68a649/lib/workers/repository/process/lookup/index.ts#L417-L545

fstehle avatar Dec 15 '23 08:12 fstehle

Not fond of this solution, tough a better fix would need bigger changes.

Yes, absolutely. Would you suggest to modify supportsDigests in

https://github.com/renovatebot/renovate/blob/6884d83a0573ebd40210cf0717c1814afd68a649/lib/modules/datasource/index.ts#L392 instead?

The logic in lookup/index.ts would need to modified, which needs extensive testing on real repos.

secustor avatar Dec 17 '23 23:12 secustor

This PR would resolve request for help discussion #28343.

I hope we can find a way to get this code moving again.

It looks like the suggestions from the review were just nits: if @fstehle doesn't have bandwidth to revisit, perhaps the maintainers can update the PR with their fixes or an interested party (myself) could fork the PR.

acortelyou avatar Apr 29 '24 21:04 acortelyou

The latter

rarkins avatar Apr 30 '24 04:04 rarkins

Currently quite busy, would be great if you could create a fork PR

fstehle avatar Apr 30 '24 09:04 fstehle

See linked PR for commits to address outstanding items.

Either cherry-pick the commits on to here (i don't have permissions) or publish that one and merge from there.

Thanks!

acortelyou avatar Apr 30 '24 23:04 acortelyou

Does anyone know whether or not these changes will support Gitlab MD5 https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.25/index.html?

ivankatliarchuk avatar May 01 '24 07:05 ivankatliarchuk

Does anyone know whether or not these changes will support Gitlab MD5 https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.25/index.html?

No.

Closing as this has been implemented in the linked PR.

secustor avatar May 01 '24 08:05 secustor