Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: exclude packageRules from extract cache fingerprint
  • Loading branch information
rarkins committed Oct 6, 2022
commit ccea8ca717a85deafc8de42aa14c1f47d73fd2e9
3 changes: 2 additions & 1 deletion lib/workers/repository/process/extract-update.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import hasha from 'hasha';
import stringify from 'safe-stable-stringify';
Comment thread
rarkins marked this conversation as resolved.
Outdated
import { git, mocked } from '../../../../test/util';
import type { PackageFile } from '../../../modules/manager/types';
import * as _repositoryCache from '../../../util/cache/repository';
Expand Down Expand Up @@ -71,7 +72,7 @@ describe('workers/repository/process/extract-update', () => {
scan: {
master: {
sha: '123test',
configHash: hasha(JSON.stringify(config)),
configHash: hasha(stringify(config)),
packageFiles,
},
},
Expand Down
6 changes: 5 additions & 1 deletion lib/workers/repository/process/extract-update.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// TODO #7154
import is from '@sindresorhus/is';
import hasha from 'hasha';
import stringify from 'safe-stable-stringify';
Comment thread
rarkins marked this conversation as resolved.
Outdated
import type { RenovateConfig } from '../../../config/types';
import { logger } from '../../../logger';
import type { PackageFile } from '../../../modules/manager/types';
Expand Down Expand Up @@ -71,7 +72,10 @@ export async function extract(
const cache = getCache();
cache.scan ||= {};
const cachedExtract = cache.scan[baseBranch!];
const configHash = hasha(JSON.stringify(config));
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { packageRules, ...remainingConfig } = config;
Comment thread
rarkins marked this conversation as resolved.
// Calculate hash excluding packageRules, because they're not applied during extract
const configHash = hasha(stringify(remainingConfig));
// istanbul ignore if
if (
cachedExtract?.sha === baseBranchSha &&
Expand Down