renovate
renovate copied to clipboard
fix(datasource/custom): Support digest in custom datasource
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
why do we need this? that function shouldn't be called when the digest is already returned in releases.
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?
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
Not fond of this solution, tough a better fix would need bigger changes.
Yes, absolutely. Would you suggest to modify
supportsDigests
inhttps://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.
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.
The latter
Currently quite busy, would be great if you could create a fork PR
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!
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?
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.