Skip to content

Commit

Permalink
refactor: Remove dependency on Gitea and Bitbucket types in cache (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Mar 10, 2024
1 parent 674ace8 commit 48daaca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions lib/modules/platform/bitbucket/pr-cache.ts
Expand Up @@ -19,8 +19,9 @@ export class BitbucketPrCache {
repoCache.platform ??= {};
repoCache.platform.bitbucket ??= {};

let pullRequestCache: BitbucketPrCacheData | undefined =
repoCache.platform.bitbucket.pullRequestsCache;
let pullRequestCache = repoCache.platform.bitbucket.pullRequestsCache as
| BitbucketPrCacheData
| undefined;
if (!pullRequestCache || pullRequestCache.author !== author) {
pullRequestCache = {
items: {},
Expand Down
4 changes: 3 additions & 1 deletion lib/modules/platform/gitea/pr-cache.ts
Expand Up @@ -19,7 +19,9 @@ export class GiteaPrCache {
const repoCache = getCache();
repoCache.platform ??= {};
repoCache.platform.gitea ??= {};
let pullRequestCache = repoCache.platform.gitea.pullRequestsCache;
let pullRequestCache = repoCache.platform.gitea.pullRequestsCache as
| GiteaPrCacheData
| undefined;
if (!pullRequestCache || pullRequestCache.author !== author) {
pullRequestCache = {
items: {},
Expand Down
6 changes: 2 additions & 4 deletions lib/util/cache/repository/types.ts
Expand Up @@ -4,8 +4,6 @@ import type {
UpdateType,
} from '../../../config/types';
import type { PackageFile } from '../../../modules/manager/types';
import type { BitbucketPrCacheData } from '../../../modules/platform/bitbucket/types';
import type { GiteaPrCacheData } from '../../../modules/platform/gitea/types';
import type { RepoInitConfig } from '../../../workers/repository/init/types';
import type { PrBlockedBy } from '../../../workers/types';
import type { HttpResponse } from '../../http/types';
Expand Down Expand Up @@ -142,7 +140,7 @@ export interface RepoCacheData {
lastPlatformAutomergeFailure?: string;
platform?: {
gitea?: {
pullRequestsCache?: GiteaPrCacheData;
pullRequestsCache?: unknown;
};
github?: {
/**
Expand All @@ -152,7 +150,7 @@ export interface RepoCacheData {
graphqlPageCache?: unknown;
};
bitbucket?: {
pullRequestsCache?: BitbucketPrCacheData;
pullRequestsCache?: unknown;
};
};
prComments?: Record<number, Record<string, string>>;
Expand Down

0 comments on commit 48daaca

Please sign in to comment.