Skip to content
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: extend skipStage to extract, lookup #33108

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 7 additions & 1 deletion lib/modules/manager/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import type {
ValidationMessage,
} from '../../config/types';
import type { Category } from '../../constants';
import type { ModuleApi, RangeStrategy, SkipReason } from '../../types';
import type {
ModuleApi,
RangeStrategy,
SkipReason,
StageName,
} from '../../types';
import type { FileChange } from '../../util/git/types';
import type { MergeConfidence } from '../../util/merge-confidence/types';
import type { CustomExtractConfig } from './custom/types';
Expand Down Expand Up @@ -144,6 +149,7 @@ export interface PackageDependency<T = Record<string, any>>
registryUrls?: string[] | null;
rangeStrategy?: RangeStrategy;
skipReason?: SkipReason;
skipStage?: StageName;
sourceLine?: number;
newVersion?: string;
updates?: LookupUpdate[];
Expand Down
2 changes: 1 addition & 1 deletion lib/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type { CommitMessageJSON } from './commit-message-json';
export type { HostRule, CombinedHostRule } from './host-rules';
export type { SkipReason } from './skip-reason';
export type { SkipReason, StageName } from './skip-reason';
export type { RangeStrategy } from './versioning';
export type { BranchStatus } from './branch-status';
export type {
Expand Down
2 changes: 2 additions & 0 deletions lib/types/skip-reason.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ export type SkipReason =
export type StageName =
| 'current-timestamp'
| 'datasource-merge'
| 'extract'
| 'lock-file-maintenance-merge'
| 'lock-file-maintenance-merge-2'
| 'lookup'
| 'pre-lookup'
| 'source-url'
| 'update-type'
Expand Down
4 changes: 4 additions & 0 deletions lib/workers/repository/process/extract-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export async function extract(
for (const file of files) {
for (const dep of file.deps) {
delete dep.updates;
if (dep.skipStage && dep.skipStage !== 'extract') {
viceice marked this conversation as resolved.
Show resolved Hide resolved
delete dep.skipReason;
delete dep.skipStage;
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions lib/workers/repository/process/fetch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@ describe('workers/repository/process/fetch', () => {
depName: 'abcd',
packageName: 'abcd',
skipReason: 'ignored',
skipStage: 'lookup',
updates: [],
},
{
depName: 'foo',
packageName: 'foo',
skipReason: 'disabled',
skipStage: 'lookup',
updates: [],
},
{
depName: 'skipped',
packageName: 'skipped',
skipReason: 'some-reason',
skipStage: 'lookup',
updates: [],
},
],
Expand Down
3 changes: 3 additions & 0 deletions lib/workers/repository/process/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ export async function fetchUpdates(
deps = [];
packageDeps.set(packageFile, deps);
}
if (dep.skipReason && !dep.skipStage) {
dep.skipStage = 'lookup';
}
deps.push(dep);
} else {
errors.push(err);
Expand Down
Loading