Files
renovate/tools/schemas/schema.ts
Sebastian Poxhofer 9d0e535934 feat(config): add overrideDescription option (#45400)
* feat(config): add `overrideDescription` option

Presets which extend many other presets used an `ignoreDeps: []` sentinel
to keep their own one-line summary in the onboarding PR instead of one line
per extended preset. Replace that hack with an explicit `overrideDescription`
option, which is consumed and removed while presets are resolved.

The resolved descriptions are unchanged. Repositories which set
`ignoreDeps: []` in their own config no longer lose all preset descriptions
in their onboarding PR.

* fixup! feat(config): add `overrideDescription` option

* fixup! feat(config): add `overrideDescription` option

* fixup! feat(config): add `overrideDescription` option
2026-08-24 11:22:31 +00:00

70 lines
1.6 KiB
TypeScript

import { z } from 'zod/v4';
const Url = z.record(z.string(), z.union([z.string(), z.array(z.string())]));
export const Monorepo = z.object({
repoGroups: Url,
orgGroups: Url,
patternGroups: Url,
});
const PackageRule = z.object({
matchCurrentVersion: z.string().optional(),
matchDatasources: z.array(z.string()),
matchPackageNames: z.array(z.string()),
replacementName: z.string().optional(),
replacementVersion: z.string().optional(),
description: z.string().optional(),
replacementNameTemplate: z.string().optional(),
replacementVersionTemplate: z.string().optional(),
});
const RuleSet = z.object({
description: z.string(),
packageRules: z
.array(PackageRule)
.min(1)
.refine(
(rules) =>
rules.some(
(rule) =>
rule.replacementName !== undefined ||
rule.replacementNameTemplate !== undefined,
),
{
message:
'At least one package rule must use either the replacementName config option, or the replacementNameTemplate config option',
},
),
});
const All = z.object({
extends: z.array(z.string()),
overrideDescription: z.string(),
});
export const Replacements = z
.object({
$schema: z.string(),
all: All,
})
.catchall(RuleSet);
export const ChangelogUrls = z
.object({
$schema: z.string(),
})
.catchall(z.record(z.string(), z.string().url()));
export const SourceUrls = z
.object({
$schema: z.string(),
})
.catchall(z.record(z.string(), z.string().url()));
export const Abandonments = z
.object({
$schema: z.string(),
})
.catchall(z.record(z.string(), z.string()));