Skip to content

Commit

Permalink
fix(azure): use pr title as merge commit message (#9964)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMagee committed May 12, 2021
1 parent 9de4fe9 commit a805ddb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/platform/azure/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Object {
"body": undefined,
"completionOptions": Object {
"deleteSourceBranch": true,
"mergeCommitMessage": "The Title",
"squashMerge": true,
},
"createdAt": undefined,
Expand All @@ -49,6 +50,7 @@ Object {
"sourceRefName": undefined,
"state": "open",
"targetBranch": undefined,
"title": "The Title",
}
`;

Expand Down
4 changes: 4 additions & 0 deletions lib/platform/azure/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ describe(getName(), () => {
await initRepo({ repository: 'some/repo' });
const prResult = {
pullRequestId: 456,
title: 'The Title',
displayNumber: `Pull Request #456`,
createdBy: {
id: 123,
Expand All @@ -642,6 +643,7 @@ describe(getName(), () => {
completionOptions: {
squashMerge: true,
deleteSourceBranch: true,
mergeCommitMessage: 'The Title',
},
};
const updateFn = jest
Expand Down Expand Up @@ -1068,6 +1070,7 @@ describe(getName(), () => {
getPullRequestById: jest.fn(() => ({
lastMergeSourceCommit: lastMergeSourceCommitMock,
targetRefName: 'refs/heads/ding',
title: 'title',
})),
updatePullRequest: updatePullRequestMock,
} as any)
Expand All @@ -1086,6 +1089,7 @@ describe(getName(), () => {
completionOptions: {
mergeStrategy: GitPullRequestMergeStrategy.Squash,
deleteSourceBranch: true,
mergeCommitMessage: 'title',
},
},
'1',
Expand Down
2 changes: 2 additions & 0 deletions lib/platform/azure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ export async function createPr({
completionOptions: {
mergeStrategy: config.defaultMergeMethod,
deleteSourceBranch: true,
mergeCommitMessage: title,
},
},
config.repoId,
Expand Down Expand Up @@ -632,6 +633,7 @@ export async function mergePr(
completionOptions: {
mergeStrategy: mergeMethod,
deleteSourceBranch: true,
mergeCommitMessage: pr.title,
},
};

Expand Down

0 comments on commit a805ddb

Please sign in to comment.