Skip to content

Commit

Permalink
Merge branch 'main' into feat/debian-datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
secustor committed Aug 27, 2024
2 parents 7d32385 + c2f2d4f commit 3d0ed1d
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ jobs:
show-progress: false

- name: docker-config
uses: containerbase/internal-tools@8c6a37b66220230ae326a513771fc3345375a678 # v3.4.9
uses: containerbase/internal-tools@950c21f000798710a192f614a1188cf091dece89 # v3.4.10
with:
command: docker-config

Expand Down
6 changes: 3 additions & 3 deletions lib/modules/datasource/conan/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ export class ConanDatasource extends Datasource {
}

@cache({
namespace: `datasource-${datasource}-revisions`,
namespace: `datasource-${datasource}`,
key: ({ registryUrl, packageName }: DigestConfig, newValue?: string) =>
// TODO: types (#22198)
`${registryUrl!}:${packageName}:${newValue!}`,
`getDigest:${registryUrl!}:${packageName}:${newValue!}`,
})
override async getDigest(
{ registryUrl, packageName }: DigestConfig,
Expand Down Expand Up @@ -106,7 +106,7 @@ export class ConanDatasource extends Datasource {
namespace: `datasource-${datasource}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
// TODO: types (#22198)
`${registryUrl}:${packageName}`,
`getReleases:${registryUrl}:${packageName}`,
})
async getReleases({
registryUrl,
Expand Down
15 changes: 8 additions & 7 deletions lib/modules/datasource/deno/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class DenoDatasource extends Datasource {
namespace: `datasource-${DenoDatasource.id}`,
key: ({ packageName, registryUrl }: GetReleasesConfig) =>
// TODO: types (#22198)
`${registryUrl}:${packageName}`,
`getReleases:${registryUrl}:${packageName}`,
})
async getReleases({
packageName,
Expand Down Expand Up @@ -70,14 +70,15 @@ export class DenoDatasource extends Datasource {
}

@cache({
namespace: `datasource-${DenoDatasource.id}-versions`,
key: (moduleAPIURL) => moduleAPIURL,
namespace: `datasource-${DenoDatasource.id}`,
key: (moduleAPIURL) => `getReleaseResult:${moduleAPIURL}`,
})
async getReleaseResult(moduleAPIURL: string): Promise<ReleaseResult> {
const detailsCacheKey = `details:${moduleAPIURL}`;
const releasesCache: Record<string, Release> =
(await packageCache.get(
`datasource-${DenoDatasource.id}-details`,
moduleAPIURL,
`datasource-${DenoDatasource.id}`,
detailsCacheKey,
)) ?? {};
let cacheModified = false;

Expand Down Expand Up @@ -119,8 +120,8 @@ export class DenoDatasource extends Datasource {
if (cacheModified) {
// 1 week. Releases at Deno are immutable, therefore we can use a long term cache here.
await packageCache.set(
`datasource-${DenoDatasource.id}-details`,
moduleAPIURL,
`datasource-${DenoDatasource.id}`,
detailsCacheKey,
releasesCache,
10080,
);
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/datasource/github-release-attachments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class GithubReleaseAttachmentsDatasource extends Datasource {
ttlMinutes: 1440,
namespace: `datasource-${GithubReleaseAttachmentsDatasource.id}`,
key: (release: GithubRestRelease, digest: string) =>
`${release.html_url}:${digest}`,
`findDigestFile:${release.html_url}:${digest}`,
})
async findDigestFile(
release: GithubRestRelease,
Expand Down Expand Up @@ -83,9 +83,9 @@ export class GithubReleaseAttachmentsDatasource extends Datasource {

@cache({
ttlMinutes: 1440,
namespace: 'datasource-github-releases',
namespace: `datasource-${GithubReleaseAttachmentsDatasource.id}`,
key: (asset: GithubRestAsset, algorithm: string) =>
`${asset.browser_download_url}:${algorithm}:assetDigest`,
`downloadAndDigest:${asset.browser_download_url}:${algorithm}`,
})
async downloadAndDigest(
asset: GithubRestAsset,
Expand Down
7 changes: 4 additions & 3 deletions lib/modules/datasource/go/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export class GoDatasource extends Datasource {
@cache({
namespace: `datasource-${GoDatasource.id}`,
// TODO: types (#22198)
key: ({ packageName }: Partial<DigestConfig>) => `${packageName}-digest`,
key: ({ packageName }: GetReleasesConfig) =>
`getReleases:${packageName}-digest`,
})
getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {
return this.goproxy.getReleases(config);
Expand All @@ -65,8 +66,8 @@ export class GoDatasource extends Datasource {
* - Call the respective getDigest in github to retrieve the commit hash
*/
@cache({
namespace: GoDatasource.id,
key: ({ packageName }: DigestConfig) => `${packageName}-digest`,
namespace: `datasource-${GoDatasource.id}`,
key: ({ packageName }: DigestConfig) => `getDigest:${packageName}-digest`,
})
override async getDigest(
{ packageName }: DigestConfig,
Expand Down
4 changes: 2 additions & 2 deletions lib/util/cache/package/key.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { getCombinedKey } from './key';
describe('util/cache/package/key', () => {
describe('getCombinedKey', () => {
it('works', () => {
expect(getCombinedKey('datasource-github-releases', 'foo:bar')).toBe(
'global%%datasource-github-releases%%foo:bar',
expect(getCombinedKey('_test-namespace', 'foo:bar')).toBe(
'global%%_test-namespace%%foo:bar',
);
});
});
Expand Down
5 changes: 0 additions & 5 deletions lib/util/cache/package/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,12 @@ export type PackageCacheNamespace =
| 'datasource-bitrise'
| 'datasource-cdnjs-digest'
| 'datasource-cdnjs'
| 'datasource-conan-revisions'
| 'datasource-conan'
| 'datasource-conda'
| 'datasource-cpan'
| 'datasource-crate-metadata'
| 'datasource-crate'
| 'datasource-deb'
| 'datasource-deno-details'
| 'datasource-deno-versions'
| 'datasource-deno'
| 'datasource-docker-architecture'
| 'datasource-docker-hub-cache'
Expand All @@ -64,7 +61,6 @@ export type PackageCacheNamespace =
| 'datasource-git'
| 'datasource-gitea-releases'
| 'datasource-gitea-tags'
| 'datasource-github-releases'
| 'datasource-github-release-attachments'
| 'datasource-gitlab-packages'
| 'datasource-gitlab-releases'
Expand Down Expand Up @@ -110,7 +106,6 @@ export type PackageCacheNamespace =
| 'datasource-unity3d'
| 'github-releases-datasource-v2'
| 'github-tags-datasource-v2'
| 'go'
| 'merge-confidence'
| 'preset'
| 'url-sha256';
Expand Down
6 changes: 3 additions & 3 deletions tools/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ ARG BASE_IMAGE_TYPE=slim
# --------------------------------------
# slim image
# --------------------------------------
FROM ghcr.io/renovatebot/base-image:7.17.1@sha256:21f8a6571f81f2b26487888c6494b2856889552d02b20c7473337acaf86524ce AS slim-base
FROM ghcr.io/renovatebot/base-image:7.17.2@sha256:0c81cca63b6d61b4736d853097e567da09c3cb76edfbc5429e4a3e19f09f38a2 AS slim-base

# --------------------------------------
# full image
# --------------------------------------
FROM ghcr.io/renovatebot/base-image:7.17.1-full@sha256:d7029da66087902e8248bb8420e31742b00e3a54273aaaea86f0c6275ea614e3 AS full-base
FROM ghcr.io/renovatebot/base-image:7.17.2-full@sha256:e08fddcf1002055dff4ad39cba02a1cc8036b91fec660f706a9106d3775b4161 AS full-base

# --------------------------------------
# build image
# --------------------------------------
FROM --platform=$BUILDPLATFORM ghcr.io/renovatebot/base-image:7.17.1@sha256:21f8a6571f81f2b26487888c6494b2856889552d02b20c7473337acaf86524ce AS build
FROM --platform=$BUILDPLATFORM ghcr.io/renovatebot/base-image:7.17.2@sha256:0c81cca63b6d61b4736d853097e567da09c3cb76edfbc5429e4a3e19f09f38a2 AS build

# We want a specific node version here
# renovate: datasource=node-version
Expand Down

0 comments on commit 3d0ed1d

Please sign in to comment.