-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(datasource/custom): Support digest in custom datasource #26299
feat(datasource/custom): Support digest in custom datasource #26299
Conversation
c470002
to
dfc34f7
Compare
To support digests a datasource has to implement the getDigest method. The value itself can be provided in the getReleases method.
dfc34f7
to
08edb90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fond of this solution, tough a better fix would need bigger changes.
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
why do we need this? that function shouldn't be called when the digest is already returned in releases. |
Yes, absolutely. Would you suggest to modify renovate/lib/modules/datasource/index.ts Line 392 in 6884d83
|
That is not what I observed, See the following lines for that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The snapshot is with the latest change obsolete.
You can remove it with pnpm run jest -u
The logic in |
Support digets for custom datasource. The getDigest method needs to exist on the custom datasource for renovate to use the digest provided from the main versions/releases endpoint. If the versions response always includes the digest, the getDigest method doesn't actually need to be implemented. https://github.com/renovatebot/renovate/blob/14b67888307e2a83219e4bb90f7f0f71f5e608bd/lib/workers/repository/process/lookup/index.ts#L446 See renovatebot#26299
Support digets for custom datasource. The getDigest method needs to exist on the custom datasource for renovate to use the digest provided from the main versions/releases endpoint. If the versions response always includes the digest, the getDigest method doesn't actually need to be implemented. https://github.com/renovatebot/renovate/blob/14b67888307e2a83219e4bb90f7f0f71f5e608bd/lib/workers/repository/process/lookup/index.ts#L446 See renovatebot#26299
Support digets for custom datasource. The getDigest method needs to exist on the custom datasource for renovate to use the digest provided from the main versions/releases endpoint. If the versions response always includes the digest, the getDigest method doesn't actually need to be implemented. https://github.com/renovatebot/renovate/blob/14b67888307e2a83219e4bb90f7f0f71f5e608bd/lib/workers/repository/process/lookup/index.ts#L446 See renovatebot#26299
Support digets for custom datasource. The getDigest method needs to exist on the custom datasource for renovate to use the digest provided from the main versions/releases endpoint. If the versions response always includes the digest, the getDigest method doesn't actually need to be implemented. https://github.com/renovatebot/renovate/blob/14b67888307e2a83219e4bb90f7f0f71f5e608bd/lib/workers/repository/process/lookup/index.ts#L446 See renovatebot#26299
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs deconflicting and continuing
Support digets for custom datasource. The getDigest method needs to exist on the custom datasource for renovate to use the digest provided from the main versions/releases endpoint. If the versions response always includes the digest, the getDigest method doesn't actually need to be implemented. https://github.com/renovatebot/renovate/blob/14b67888307e2a83219e4bb90f7f0f71f5e608bd/lib/workers/repository/process/lookup/index.ts#L446 See renovatebot#26299
Support digets for custom datasource. The getDigest method needs to exist on the custom datasource for renovate to use the digest provided from the main versions/releases endpoint. If the versions response always includes the digest, the getDigest method doesn't actually need to be implemented. https://github.com/renovatebot/renovate/blob/14b67888307e2a83219e4bb90f7f0f71f5e608bd/lib/workers/repository/process/lookup/index.ts#L446 See renovatebot#26299
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 |
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
# Conflicts: # lib/workers/repository/process/lookup/index.spec.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed conflicts, but now I defer to @secustor
newValue?: string, | ||
): Promise<string | null> { | ||
// Return null here to support setting a digest: value can be provided digest in getReleases | ||
// istanbul ignore next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be removed, it seems there's a test for it
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs test fix and removal of ignore statement, else LGTM
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! |
const res = await lookup.lookupUpdates(config); | ||
expect(res).toMatchObject({ | ||
updates: [ | ||
{ | ||
newDigest: '0123456789abcdef', | ||
newValue: '1.0.0', | ||
updateType: 'digest', | ||
}, | ||
], | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const res = await lookup.lookupUpdates(config); | |
expect(res).toMatchObject({ | |
updates: [ | |
{ | |
newDigest: '0123456789abcdef', | |
newValue: '1.0.0', | |
updateType: 'digest', | |
}, | |
], | |
}); | |
const { updates } = await Result.wrap( | |
lookup.lookupUpdates(config), | |
).unwrapOrThrow(); | |
expect(updates).toEqual([ | |
{ | |
newDigest: '0123456789abcdef', | |
newValue: '1.0.0', | |
updateType: 'digest', | |
}, | |
]); |
newValue?: string, | ||
): Promise<string | null> { | ||
// Return null here to support setting a digest: value can be provided digest in getReleases | ||
// istanbul ignore next |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
newValue?: string, | ||
): Promise<string | null> { | ||
// Return null here to support setting a digest: value can be provided digest in getReleases | ||
// istanbul ignore next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// istanbul ignore next |
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. |
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])
How I've tested my work (please select one)
I have verified these changes via: