Skip to content

Commit

Permalink
refactor(gitlab-tags): Use single cache namespace (#31038)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Aug 27, 2024
1 parent c89e14c commit 308ccdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/modules/datasource/gitlab-tags/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class GitlabTagsDatasource extends Datasource {
@cache({
namespace: `datasource-${GitlabTagsDatasource.id}`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
`${getDepHost(registryUrl)}:${packageName}`,
`getReleases:${getDepHost(registryUrl)}:${packageName}`,
})
async getReleases({
registryUrl,
Expand Down Expand Up @@ -72,17 +72,17 @@ export class GitlabTagsDatasource extends Datasource {
* Returs the latest commit hash of the repository.
*/
@cache({
namespace: `datasource-${GitlabTagsDatasource.id}-commit`,
key: ({ registryUrl, packageName }: GetReleasesConfig) =>
`${getDepHost(registryUrl)}:${packageName}`,
namespace: `datasource-${GitlabTagsDatasource.id}`,
key: ({ registryUrl, packageName }: DigestConfig) =>
`getDigest:${getDepHost(registryUrl)}:${packageName}`,
})
override async getDigest(
{ packageName: repo, registryUrl }: Partial<DigestConfig>,
{ packageName: repo, registryUrl }: DigestConfig,
newValue?: string,
): Promise<string | null> {
const depHost = getDepHost(registryUrl);

const urlEncodedRepo = encodeURIComponent(repo!);
const urlEncodedRepo = encodeURIComponent(repo);
let digest: string | null = null;

try {
Expand Down
1 change: 0 additions & 1 deletion lib/util/cache/package/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export type PackageCacheNamespace =
| 'datasource-github-release-attachments'
| 'datasource-gitlab-packages'
| 'datasource-gitlab-releases'
| 'datasource-gitlab-tags-commit'
| 'datasource-gitlab-tags'
| 'datasource-glasskube-packages'
| 'datasource-go-direct'
Expand Down

0 comments on commit 308ccdc

Please sign in to comment.