Skip to content

Commit

Permalink
refactor: remove depNameShort (#9114)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Mar 13, 2021
1 parent b7b268e commit edfac73
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/config/__snapshots__/migration.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Object {
"binarySource": "global",
"branchName": "{{{branchPrefix}}}{{{additionalBranchPrefix}}}{{{branchTopic}}}{{{packageFileDir}}}",
"branchPrefix": "renovate/",
"commitMessage": "{{#if semanticCommitType}}{{semanticCommitType}}{{#if semanticCommitScope}}({{semanticCommitScope}}){{/if}}: {{/if}}some commit message",
"commitMessage": "{{#if semanticCommitType}}{{semanticCommitType}}{{#if semanticCommitScope}}({{semanticCommitScope}}){{/if}}: {{/if}}some commit message {{depName}}",
"constraints": Object {
"python": "3.7",
},
Expand Down
2 changes: 1 addition & 1 deletion lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('config/migration', () => {
meteor: true,
autodiscover: 'true' as never,
schedule: 'on the last day of the month' as never,
commitMessage: '{{semanticPrefix}}some commit message',
commitMessage: '{{semanticPrefix}}some commit message {{depNameShort}}',
prTitle: '{{semanticPrefix}}some pr title',
semanticPrefix: 'fix(deps): ',
pathRules: [
Expand Down
2 changes: 2 additions & 0 deletions lib/config/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ export function migrateConfig(
}
} else if (is.string(val) && val.includes('{{baseDir}}')) {
migratedConfig[key] = val.replace(/{{baseDir}}/g, '{{packageFileDir}}');
} else if (is.string(val) && val.includes('{{depNameShort}}')) {
migratedConfig[key] = val.replace(/{{depNameShort}}/g, '{{depName}}');
} else if (key === 'gitFs') {
delete migratedConfig.gitFs;
} else if (key === 'rebaseStalePrs') {
Expand Down
2 changes: 1 addition & 1 deletion lib/manager/terraform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export { extractPackageFile } from './extract';

export const defaultConfig = {
commitMessageTopic:
'Terraform {{managerData.terraformDependencyType}} {{depNameShort}}',
'Terraform {{managerData.terraformDependencyType}} {{depName}}',
fileMatch: ['\\.tf$'],
versioning: hashicorpVersioning.id,
};
2 changes: 1 addition & 1 deletion lib/manager/terragrunt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as hashicorpVersioning from '../../versioning/hashicorp';
export { extractPackageFile } from './extract';

export const defaultConfig = {
commitMessageTopic: 'Terragrunt dependency {{depNameShort}}',
commitMessageTopic: 'Terragrunt dependency {{depName}}',
fileMatch: ['(^|/)terragrunt\\.hcl$'],
versioning: hashicorpVersioning.id,
};
1 change: 0 additions & 1 deletion lib/manager/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export interface Package<T> extends ManagerData<T> {
currentValue?: string;
currentDigest?: string;
depName?: string;
depNameShort?: string;
depType?: string;
fileReplacePosition?: number;
groupName?: string;
Expand Down
1 change: 0 additions & 1 deletion lib/util/template/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const allowedFields = {
'The dependency name already linked to its home page using markdown',
depNameSanitized:
'The depName field sanitized for use in branches after removing spaces and special characters',
depNameShort: 'Shortened depName',
depType: 'The dependency type (if extracted - manager-dependent)',
displayFrom: 'The current value, formatted for display',
displayTo: 'The to value, formatted for display',
Expand Down
1 change: 0 additions & 1 deletion lib/workers/repository/updates/flatten.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ describe('workers/repository/updates/flatten', () => {
res.filter((r) => r.updateType === 'lockFileMaintenance')
).toHaveLength(2);
expect(res.filter((r) => r.isVulnerabilityAlert)).toHaveLength(1);
expect(res.filter((r) => r.depNameShort)).toHaveLength(10); // lockFileMaintenance has no depName
});
});
});
1 change: 0 additions & 1 deletion lib/workers/repository/updates/flatten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function applyUpdateConfig(input: BranchUpgradeConfig): any {
const updateConfig = { ...input };
delete updateConfig.packageRules;
// TODO: Remove next line once #8075 is complete
updateConfig.depNameShort ||= updateConfig.depName;
updateConfig.depNameSanitized = updateConfig.depName
? updateConfig.depName
.replace('@types/', '')
Expand Down

0 comments on commit edfac73

Please sign in to comment.