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(config): remove manager additionalBranchPrefix defaults #9373

Merged
merged 4 commits into from Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/usage/configuration-options.md
Expand Up @@ -69,7 +69,7 @@ With the above config:
## additionalBranchPrefix

This value defaults to an empty string, and is typically not necessary.
Some managers populate this field for historical reasons, for example we use `docker-` for Docker branches, so they may look like `renovate/docker-ubuntu-16.x`.
Some managers previously populate this field, but they no longer do it by default.
rarkins marked this conversation as resolved.
Show resolved Hide resolved
You normally don't need to configure this, but one example where it can be useful is combining with `parentDir` in monorepos to split PRs based on where the package definition is located, e.g.

```json
Expand Down
3 changes: 1 addition & 2 deletions docs/usage/configuration-templates.md
Expand Up @@ -21,8 +21,7 @@ Most users will be happy with the default `branchPrefix` of `renovate/`, but you
Say you don't want the forward slashes, in that case you would use `renovate-` as your `branchPrefix`.
The onboarding PR will always use `renovate/configure`.

`additionalBranchPrefix` is optional and by default is empty for all JavaScript dependencies.
We use `docker-` for all Docker updates, branches will look like this: `renovate/docker-ubuntu-16.x`.
`additionalBranchPrefix` is optional and by default is empty.

`branchTopic` depends on the package manager and upgrade type, so you will see a lot of variety.
This is probably a setting you want to change yourself.
Expand Down
1 change: 1 addition & 0 deletions lib/config/presets/index.ts
Expand Up @@ -93,6 +93,7 @@ export function parsePreset(input: string): ParsedPreset {
str = str.slice(0, str.indexOf('('));
}
const presetsPackages = [
'compatibility',
'config',
'default',
'docker',
Expand Down
24 changes: 24 additions & 0 deletions lib/config/presets/internal/compatibility.ts
@@ -0,0 +1,24 @@
import { Preset } from '../types';

export const presets: Record<string, Preset> = {
additionalBranchPrefix: {
buildkite: {
additionalBranchPrefix: 'buildkite-',
},
cargo: {
additionalBranchPrefix: 'rust-',
},
docker: {
additionalBranchPrefix: 'docker-',
},
homebrew: {
additionalBranchPrefix: 'homebrew-',
},
packageRules: [
{
matchDatasources: ['helm'],
additionalBranchPrefix: 'helm-',
},
],
},
};
2 changes: 2 additions & 0 deletions lib/config/presets/internal/index.ts
@@ -1,4 +1,5 @@
import type { Preset, PresetConfig } from '../types';
import * as compatibilityPreset from './compatibility';
import * as configPreset from './config';
import * as defaultPreset from './default';
import * as dockerPreset from './docker';
Expand All @@ -13,6 +14,7 @@ import * as schedulePreset from './schedule';
import * as workaroundsPreset from './workarounds';

export const groups: Record<string, Record<string, Preset>> = {
compatibility: compatibilityPreset.presets,
config: configPreset.presets,
default: defaultPreset.presets,
docker: dockerPreset.presets,
Expand Down
1 change: 0 additions & 1 deletion lib/datasource/docker/index.ts
Expand Up @@ -26,7 +26,6 @@ export const defaultVersioning = dockerVersioning.id;
export const registryStrategy = 'first';

export const defaultConfig = {
additionalBranchPrefix: 'docker-',
commitMessageTopic: '{{{depName}}} Docker tag',
major: { enabled: false },
commitMessageExtra:
Expand Down
1 change: 0 additions & 1 deletion lib/datasource/helm/index.ts
Expand Up @@ -17,7 +17,6 @@ export const defaultRegistryUrls = ['https://charts.helm.sh/stable'];
export const registryStrategy = 'first';

export const defaultConfig = {
additionalBranchPrefix: 'helm-',
commitMessageTopic: 'Helm release {{depName}}',
group: {
commitMessageTopic: '{{{groupName}}} Helm releases',
Expand Down
1 change: 0 additions & 1 deletion lib/manager/buildkite/index.ts
Expand Up @@ -7,5 +7,4 @@ export const defaultConfig = {
commitMessageTopic: 'buildkite plugin {{depName}}',
commitMessageExtra:
'to {{#if isMajor}}v{{{newMajor}}}{{else}}{{{newValue}}}{{/if}}',
additionalBranchPrefix: 'buildkite-',
};
1 change: 0 additions & 1 deletion lib/manager/cargo/index.ts
Expand Up @@ -10,7 +10,6 @@ export { extractPackageFile, updateArtifacts, language };

export const defaultConfig = {
commitMessageTopic: 'Rust crate {{depName}}',
additionalBranchPrefix: 'rust-',
fileMatch: ['(^|/)Cargo.toml$'],
versioning: cargoVersioning.id,
rangeStrategy: 'bump',
Expand Down
1 change: 0 additions & 1 deletion lib/manager/homebrew/index.ts
Expand Up @@ -3,6 +3,5 @@ export { updateDependency } from './update';

export const defaultConfig = {
commitMessageTopic: 'Homebrew Formula {{depName}}',
additionalBranchPrefix: 'homebrew-',
fileMatch: ['^Formula/[^/]+[.]rb$'],
};
9 changes: 0 additions & 9 deletions lib/workers/repository/updates/flatten.ts
Expand Up @@ -4,7 +4,6 @@ import {
getManagerConfig,
mergeChildConfig,
} from '../../../config';
import { LANGUAGE_DOCKER } from '../../../constants/languages';
import { getDefaultConfig } from '../../../datasource';
import { get } from '../../../manager';
import { applyPackageRules } from '../../../util/package-rules';
Expand All @@ -27,14 +26,6 @@ export function applyUpdateConfig(input: BranchUpgradeConfig): any {
.replace(/-+/, '-')
.toLowerCase()
: undefined;
if (
updateConfig.language === LANGUAGE_DOCKER &&
/(^|\/)node$/.exec(updateConfig.depName) &&
updateConfig.depName !== 'calico/node'
) {
updateConfig.additionalBranchPrefix = '';
updateConfig.depNameSanitized = 'node';
}
generateBranchName(updateConfig);
return updateConfig;
}
Expand Down