mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:09:06 +00:00
refactor: remove displayNumber (#20410)
This commit is contained in:
parent
75cf8f1edc
commit
9c0e1389d0
21 changed files with 11 additions and 90 deletions
lib
|
@ -6,7 +6,6 @@ exports[`modules/platform/azure/index createPr() should create and return a PR o
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #456",
|
||||
"number": 456,
|
||||
"pullRequestId": 456,
|
||||
"sourceBranch": undefined,
|
||||
|
@ -22,7 +21,6 @@ exports[`modules/platform/azure/index createPr() should create and return a PR o
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #456",
|
||||
"number": 456,
|
||||
"pullRequestId": 456,
|
||||
"sourceBranch": undefined,
|
||||
|
@ -49,7 +47,6 @@ exports[`modules/platform/azure/index createPr() should create and return a PR o
|
|||
"createdBy": {
|
||||
"id": 123,
|
||||
},
|
||||
"displayNumber": "Pull Request #456",
|
||||
"number": 456,
|
||||
"pullRequestId": 456,
|
||||
"sourceBranch": undefined,
|
||||
|
@ -70,7 +67,6 @@ exports[`modules/platform/azure/index createPr() should create and return an app
|
|||
"id": 123,
|
||||
"url": "user-url",
|
||||
},
|
||||
"displayNumber": "Pull Request #456",
|
||||
"number": 456,
|
||||
"pullRequestId": 456,
|
||||
"sourceBranch": undefined,
|
||||
|
@ -145,7 +141,6 @@ exports[`modules/platform/azure/index findPr(branchName, prTitle, state) returns
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #1",
|
||||
"number": 1,
|
||||
"pullRequestId": 1,
|
||||
"sourceBranch": "branch-a",
|
||||
|
@ -164,7 +159,6 @@ exports[`modules/platform/azure/index findPr(branchName, prTitle, state) returns
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #1",
|
||||
"number": 1,
|
||||
"pullRequestId": 1,
|
||||
"sourceBranch": "branch-a",
|
||||
|
@ -183,7 +177,6 @@ exports[`modules/platform/azure/index findPr(branchName, prTitle, state) returns
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #1",
|
||||
"number": 1,
|
||||
"pullRequestId": 1,
|
||||
"sourceBranch": "branch-a",
|
||||
|
@ -202,7 +195,6 @@ exports[`modules/platform/azure/index findPr(branchName, prTitle, state) returns
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #1",
|
||||
"number": 1,
|
||||
"pullRequestId": 1,
|
||||
"sourceBranch": "branch-a",
|
||||
|
@ -237,7 +229,6 @@ exports[`modules/platform/azure/index getPr(prNo) should return a pr in the righ
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #1234",
|
||||
"labels": [
|
||||
"renovate",
|
||||
],
|
||||
|
|
|
@ -20,7 +20,6 @@ exports[`modules/platform/azure/util getRenovatePRFormat should be formated (clo
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #undefined",
|
||||
"number": undefined,
|
||||
"sourceBranch": undefined,
|
||||
"sourceRefName": undefined,
|
||||
|
@ -36,7 +35,6 @@ exports[`modules/platform/azure/util getRenovatePRFormat should be formated (clo
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #undefined",
|
||||
"number": undefined,
|
||||
"sourceBranch": undefined,
|
||||
"sourceRefName": undefined,
|
||||
|
@ -52,7 +50,6 @@ exports[`modules/platform/azure/util getRenovatePRFormat should be formated (not
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #undefined",
|
||||
"number": undefined,
|
||||
"sourceBranch": undefined,
|
||||
"sourceRefName": undefined,
|
||||
|
|
|
@ -378,7 +378,6 @@ describe('modules/platform/azure/index', () => {
|
|||
hash: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
|
||||
},
|
||||
createdAt: undefined,
|
||||
displayNumber: 'Pull Request #1',
|
||||
labels: [],
|
||||
number: 1,
|
||||
pullRequestId: 1,
|
||||
|
@ -673,7 +672,6 @@ describe('modules/platform/azure/index', () => {
|
|||
({
|
||||
createPullRequest: jest.fn(() => ({
|
||||
pullRequestId: 456,
|
||||
displayNumber: `Pull Request #456`,
|
||||
})),
|
||||
createPullRequestLabel: jest.fn(() => ({})),
|
||||
} as any)
|
||||
|
@ -695,7 +693,6 @@ describe('modules/platform/azure/index', () => {
|
|||
({
|
||||
createPullRequest: jest.fn(() => ({
|
||||
pullRequestId: 456,
|
||||
displayNumber: `Pull Request #456`,
|
||||
})),
|
||||
createPullRequestLabel: jest.fn(() => ({})),
|
||||
} as any)
|
||||
|
@ -715,7 +712,6 @@ describe('modules/platform/azure/index', () => {
|
|||
const prResult = {
|
||||
pullRequestId: 456,
|
||||
title: 'The Title',
|
||||
displayNumber: `Pull Request #456`,
|
||||
createdBy: {
|
||||
id: 123,
|
||||
},
|
||||
|
@ -758,7 +754,6 @@ describe('modules/platform/azure/index', () => {
|
|||
await initRepo({ repository: 'some/repo' });
|
||||
const prResult = {
|
||||
pullRequestId: 456,
|
||||
displayNumber: 'Pull Request #456',
|
||||
createdBy: {
|
||||
id: 123,
|
||||
url: 'user-url',
|
||||
|
|
|
@ -84,8 +84,6 @@ const stateMap = {
|
|||
|
||||
export function getRenovatePRFormat(azurePr: GitPullRequest): AzurePr {
|
||||
const number = azurePr.pullRequestId;
|
||||
// TODO: types (#7154)
|
||||
const displayNumber = `Pull Request #${number!}`;
|
||||
|
||||
const sourceBranch = getBranchNameWithoutRefsheadsPrefix(
|
||||
azurePr.sourceRefName
|
||||
|
@ -107,7 +105,6 @@ export function getRenovatePRFormat(azurePr: GitPullRequest): AzurePr {
|
|||
sourceBranch,
|
||||
state,
|
||||
number,
|
||||
displayNumber,
|
||||
bodyStruct,
|
||||
sourceRefName,
|
||||
targetBranch,
|
||||
|
|
|
@ -31,7 +31,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with no path getBranch
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -50,7 +49,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with no path getPr() c
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -69,7 +67,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with no path getPr() c
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -88,7 +85,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with no path getPr() c
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -107,7 +103,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with no path getPr() g
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -126,7 +121,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with no path getPr() g
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #undefined",
|
||||
"number": undefined,
|
||||
"reviewers": [],
|
||||
"sourceBranch": undefined,
|
||||
|
@ -241,7 +235,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with path getBranchPr(
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -260,7 +253,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with path getPr() canR
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -279,7 +271,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with path getPr() canR
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -298,7 +289,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with path getPr() canR
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -317,7 +307,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with path getPr() gets
|
|||
"hash": "7980dafc4eb6f0c79278fd929d3e8e5954b32b68ae118a22565c7c369fc2f591",
|
||||
},
|
||||
"createdAt": 1547853840016,
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"reviewers": [
|
||||
"userName2",
|
||||
|
@ -336,7 +325,6 @@ exports[`modules/platform/bitbucket-server/index endpoint with path getPr() gets
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #undefined",
|
||||
"number": undefined,
|
||||
"reviewers": [],
|
||||
"sourceBranch": undefined,
|
||||
|
|
|
@ -260,7 +260,6 @@ export async function getPr(
|
|||
);
|
||||
|
||||
const pr: BbsPr = {
|
||||
displayNumber: `Pull Request #${res.body.id}`,
|
||||
...utils.prInfo(res.body),
|
||||
reviewers: res.body.reviewers.map((r) => r.user.name),
|
||||
};
|
||||
|
@ -832,7 +831,6 @@ export async function createPr({
|
|||
}
|
||||
|
||||
const pr: BbsPr = {
|
||||
displayNumber: `Pull Request #${prInfoRes.body.id}`,
|
||||
...utils.prInfo(prInfoRes.body),
|
||||
};
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ exports[`modules/platform/bitbucket/index findPr() finds pr 1`] = `
|
|||
"hash": "761b7ad8ad439b2855fcbb611331c646ef0870b0631247bba3f3025cb6df5a53",
|
||||
},
|
||||
"createdAt": "2018-07-02T07:02:25.275030+00:00",
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"sourceBranch": "branch",
|
||||
"state": "open",
|
||||
|
@ -34,7 +33,6 @@ exports[`modules/platform/bitbucket/index getBranchPr() bitbucket finds PR for b
|
|||
"hash": "761b7ad8ad439b2855fcbb611331c646ef0870b0631247bba3f3025cb6df5a53",
|
||||
},
|
||||
"createdAt": "2018-07-02T07:02:25.275030+00:00",
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"sourceBranch": "branch",
|
||||
"state": "open",
|
||||
|
@ -68,7 +66,6 @@ exports[`modules/platform/bitbucket/index getPr() canRebase 1`] = `
|
|||
"hash": "761b7ad8ad439b2855fcbb611331c646ef0870b0631247bba3f3025cb6df5a53",
|
||||
},
|
||||
"createdAt": "2018-07-02T07:02:25.275030+00:00",
|
||||
"displayNumber": "Pull Request #3",
|
||||
"number": 3,
|
||||
"sourceBranch": "branch",
|
||||
"state": "open",
|
||||
|
@ -83,7 +80,6 @@ exports[`modules/platform/bitbucket/index getPr() canRebase 2`] = `
|
|||
"hash": "761b7ad8ad439b2855fcbb611331c646ef0870b0631247bba3f3025cb6df5a53",
|
||||
},
|
||||
"createdAt": "2018-07-02T07:02:25.275030+00:00",
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"sourceBranch": "branch",
|
||||
"state": "open",
|
||||
|
@ -98,7 +94,6 @@ exports[`modules/platform/bitbucket/index getPr() canRebase 3`] = `
|
|||
"hash": "761b7ad8ad439b2855fcbb611331c646ef0870b0631247bba3f3025cb6df5a53",
|
||||
},
|
||||
"createdAt": "2018-07-02T07:02:25.275030+00:00",
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"sourceBranch": "branch",
|
||||
"state": "open",
|
||||
|
@ -113,7 +108,6 @@ exports[`modules/platform/bitbucket/index getPr() exists 1`] = `
|
|||
"hash": "761b7ad8ad439b2855fcbb611331c646ef0870b0631247bba3f3025cb6df5a53",
|
||||
},
|
||||
"createdAt": "2018-07-02T07:02:25.275030+00:00",
|
||||
"displayNumber": "Pull Request #5",
|
||||
"number": 5,
|
||||
"sourceBranch": "branch",
|
||||
"state": "open",
|
||||
|
@ -129,7 +123,6 @@ exports[`modules/platform/bitbucket/index getPrList() filters PR list by author
|
|||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"createdAt": undefined,
|
||||
"displayNumber": "Pull Request #1",
|
||||
"number": 1,
|
||||
"sourceBranch": "branch-a",
|
||||
"state": "open",
|
||||
|
|
|
@ -1002,7 +1002,6 @@ describe('modules/platform/bitbucket/index', () => {
|
|||
hash: '761b7ad8ad439b2855fcbb611331c646ef0870b0631247bba3f3025cb6df5a53',
|
||||
},
|
||||
createdAt: '2018-07-02T07:02:25.275030+00:00',
|
||||
displayNumber: 'Pull Request #5',
|
||||
number: 5,
|
||||
reviewers: ['{90b6646d-1724-4a64-9fd9-539515fe94e9}'],
|
||||
sourceBranch: 'branch',
|
||||
|
|
|
@ -291,7 +291,6 @@ export async function getPr(prNo: number): Promise<Pr | null> {
|
|||
}
|
||||
|
||||
const res: Pr = {
|
||||
displayNumber: `Pull Request #${pr.id}`,
|
||||
...utils.prInfo(pr),
|
||||
};
|
||||
|
||||
|
|
|
@ -179,7 +179,6 @@ export interface PrResponse {
|
|||
export function prInfo(pr: PrResponse): Pr {
|
||||
return {
|
||||
number: pr.id,
|
||||
displayNumber: `Pull Request #${pr.id}`,
|
||||
bodyStruct: getPrBodyStruct(pr.summary?.raw),
|
||||
sourceBranch: pr.source?.branch?.name,
|
||||
targetBranch: pr.destination?.branch?.name,
|
||||
|
|
|
@ -7,7 +7,6 @@ exports[`modules/platform/gitea/index createPr should use base branch by default
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2014-04-01T05:14:20Z",
|
||||
"displayNumber": "Pull Request #42",
|
||||
"hasAssignees": false,
|
||||
"isDraft": false,
|
||||
"number": 42,
|
||||
|
@ -27,7 +26,6 @@ exports[`modules/platform/gitea/index createPr should use default branch if requ
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2014-04-01T05:14:20Z",
|
||||
"displayNumber": "Pull Request #42",
|
||||
"hasAssignees": false,
|
||||
"isDraft": false,
|
||||
"number": 42,
|
||||
|
@ -47,7 +45,6 @@ exports[`modules/platform/gitea/index getPr should fallback to direct fetching i
|
|||
},
|
||||
"cannotMergeReason": "pr.mergeable="false"",
|
||||
"createdAt": "2015-03-22T20:36:16Z",
|
||||
"displayNumber": "Pull Request #1",
|
||||
"hasAssignees": false,
|
||||
"isDraft": false,
|
||||
"number": 1,
|
||||
|
@ -67,7 +64,6 @@ exports[`modules/platform/gitea/index getPr should return enriched pull request
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2015-03-22T20:36:16Z",
|
||||
"displayNumber": "Pull Request #1",
|
||||
"hasAssignees": false,
|
||||
"isDraft": false,
|
||||
"number": 1,
|
||||
|
@ -95,7 +91,6 @@ exports[`modules/platform/gitea/index getPrList should filter list by creator 2`
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2015-03-22T20:36:16Z",
|
||||
"displayNumber": "Pull Request #1",
|
||||
"hasAssignees": false,
|
||||
"isDraft": false,
|
||||
"number": 1,
|
||||
|
@ -112,7 +107,6 @@ exports[`modules/platform/gitea/index getPrList should filter list by creator 2`
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2011-08-18T22:30:38Z",
|
||||
"displayNumber": "Pull Request #2",
|
||||
"hasAssignees": false,
|
||||
"isDraft": false,
|
||||
"number": 2,
|
||||
|
@ -129,7 +123,6 @@ exports[`modules/platform/gitea/index getPrList should filter list by creator 2`
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2011-08-18T22:30:39Z",
|
||||
"displayNumber": "Pull Request #3",
|
||||
"hasAssignees": false,
|
||||
"isDraft": true,
|
||||
"number": 3,
|
||||
|
@ -151,7 +144,6 @@ exports[`modules/platform/gitea/index getPrList should return list of pull reque
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2015-03-22T20:36:16Z",
|
||||
"displayNumber": "Pull Request #1",
|
||||
"hasAssignees": false,
|
||||
"isDraft": false,
|
||||
"number": 1,
|
||||
|
@ -168,7 +160,6 @@ exports[`modules/platform/gitea/index getPrList should return list of pull reque
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2011-08-18T22:30:38Z",
|
||||
"displayNumber": "Pull Request #2",
|
||||
"hasAssignees": false,
|
||||
"isDraft": false,
|
||||
"number": 2,
|
||||
|
@ -185,7 +176,6 @@ exports[`modules/platform/gitea/index getPrList should return list of pull reque
|
|||
},
|
||||
"cannotMergeReason": undefined,
|
||||
"createdAt": "2011-08-18T22:30:39Z",
|
||||
"displayNumber": "Pull Request #3",
|
||||
"hasAssignees": false,
|
||||
"isDraft": true,
|
||||
"number": 3,
|
||||
|
|
|
@ -118,7 +118,6 @@ function toRenovatePR(data: PR): Pr | null {
|
|||
|
||||
return {
|
||||
number: data.number,
|
||||
displayNumber: `Pull Request #${data.number}`,
|
||||
state: data.state,
|
||||
title,
|
||||
isDraft,
|
||||
|
|
|
@ -10,7 +10,6 @@ import type { GhPr, GhRestPr } from './types';
|
|||
export function coerceRestPr(pr: GhRestPr): GhPr {
|
||||
const bodyStruct = pr.bodyStruct ?? getPrBodyStruct(pr.body);
|
||||
const result: GhPr = {
|
||||
displayNumber: `Pull Request #${pr.number}`,
|
||||
number: pr.number,
|
||||
sourceBranch: pr.head?.ref,
|
||||
title: pr.title,
|
||||
|
|
|
@ -2450,7 +2450,6 @@ describe('modules/platform/github/index', () => {
|
|||
expect(pr).toMatchObject({
|
||||
number: 2500,
|
||||
bodyStruct: { hash: expect.any(String) },
|
||||
displayNumber: 'Pull Request #2500',
|
||||
sourceBranch: 'renovate/jest-monorepo',
|
||||
sourceRepo: 'some/repo',
|
||||
state: 'open',
|
||||
|
@ -2578,7 +2577,6 @@ describe('modules/platform/github/index', () => {
|
|||
bodyStruct: {
|
||||
hash: expect.any(String),
|
||||
},
|
||||
displayNumber: 'Pull Request #1234',
|
||||
hasAssignees: true,
|
||||
number: 1234,
|
||||
sourceBranch: 'some/branch',
|
||||
|
@ -2612,7 +2610,6 @@ describe('modules/platform/github/index', () => {
|
|||
bodyStruct: {
|
||||
hash: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
|
||||
},
|
||||
displayNumber: 'Pull Request #1234',
|
||||
number: 1234,
|
||||
sourceBranch: 'some/branch',
|
||||
state: 'open',
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
exports[`modules/platform/gitlab/index createPr(branchName, title, body) raises with squash enabled when repository squash option is always 1`] = `
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"number": 12345,
|
||||
|
@ -13,7 +12,6 @@ exports[`modules/platform/gitlab/index createPr(branchName, title, body) raises
|
|||
|
||||
exports[`modules/platform/gitlab/index createPr(branchName, title, body) raises with squash enabled when repository squash option is default_on 1`] = `
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"number": 12345,
|
||||
|
@ -24,7 +22,6 @@ exports[`modules/platform/gitlab/index createPr(branchName, title, body) raises
|
|||
|
||||
exports[`modules/platform/gitlab/index createPr(branchName, title, body) returns the PR 1`] = `
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"number": 12345,
|
||||
|
@ -35,7 +32,6 @@ exports[`modules/platform/gitlab/index createPr(branchName, title, body) returns
|
|||
|
||||
exports[`modules/platform/gitlab/index createPr(branchName, title, body) supports draftPR on < 13.2 1`] = `
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"isDraft": true,
|
||||
|
@ -47,7 +43,6 @@ exports[`modules/platform/gitlab/index createPr(branchName, title, body) support
|
|||
|
||||
exports[`modules/platform/gitlab/index createPr(branchName, title, body) supports draftPR on >= 13.2 1`] = `
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"isDraft": true,
|
||||
|
@ -59,7 +54,6 @@ exports[`modules/platform/gitlab/index createPr(branchName, title, body) support
|
|||
|
||||
exports[`modules/platform/gitlab/index createPr(branchName, title, body) uses default branch 1`] = `
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"number": 12345,
|
||||
|
@ -73,7 +67,6 @@ exports[`modules/platform/gitlab/index getBranchPr(branchName) should return the
|
|||
"bodyStruct": {
|
||||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"displayNumber": "Merge Request #91",
|
||||
"hasAssignees": false,
|
||||
"headPipelineStatus": undefined,
|
||||
"labels": undefined,
|
||||
|
@ -92,7 +85,6 @@ exports[`modules/platform/gitlab/index getBranchPr(branchName) should strip depr
|
|||
"bodyStruct": {
|
||||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"displayNumber": "Merge Request #91",
|
||||
"hasAssignees": false,
|
||||
"headPipelineStatus": undefined,
|
||||
"isDraft": true,
|
||||
|
@ -112,7 +104,6 @@ exports[`modules/platform/gitlab/index getBranchPr(branchName) should strip draf
|
|||
"bodyStruct": {
|
||||
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
},
|
||||
"displayNumber": "Merge Request #91",
|
||||
"hasAssignees": false,
|
||||
"headPipelineStatus": undefined,
|
||||
"isDraft": true,
|
||||
|
@ -132,7 +123,6 @@ exports[`modules/platform/gitlab/index getPr(prNo) removes deprecated draft pref
|
|||
"bodyStruct": {
|
||||
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
|
||||
},
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"hasAssignees": false,
|
||||
"headPipelineStatus": undefined,
|
||||
"isDraft": true,
|
||||
|
@ -152,7 +142,6 @@ exports[`modules/platform/gitlab/index getPr(prNo) removes draft prefix from ret
|
|||
"bodyStruct": {
|
||||
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
|
||||
},
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"hasAssignees": false,
|
||||
"headPipelineStatus": undefined,
|
||||
"isDraft": true,
|
||||
|
@ -172,7 +161,6 @@ exports[`modules/platform/gitlab/index getPr(prNo) returns the PR 1`] = `
|
|||
"bodyStruct": {
|
||||
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
|
||||
},
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"hasAssignees": false,
|
||||
"headPipelineStatus": undefined,
|
||||
"labels": undefined,
|
||||
|
@ -191,7 +179,6 @@ exports[`modules/platform/gitlab/index getPr(prNo) returns the PR with nonexisti
|
|||
"bodyStruct": {
|
||||
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
|
||||
},
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"hasAssignees": true,
|
||||
"headPipelineStatus": undefined,
|
||||
"labels": undefined,
|
||||
|
@ -210,7 +197,6 @@ exports[`modules/platform/gitlab/index getPr(prNo) returns the mergeable PR 1`]
|
|||
"bodyStruct": {
|
||||
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
|
||||
},
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"hasAssignees": true,
|
||||
"headPipelineStatus": undefined,
|
||||
"labels": undefined,
|
||||
|
|
|
@ -1568,7 +1568,6 @@ describe('modules/platform/gitlab/index', () => {
|
|||
})
|
||||
).toMatchInlineSnapshot(`
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"number": 12345,
|
||||
|
@ -1684,7 +1683,6 @@ describe('modules/platform/gitlab/index', () => {
|
|||
})
|
||||
).toMatchInlineSnapshot(`
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"number": 12345,
|
||||
|
@ -1736,7 +1734,6 @@ describe('modules/platform/gitlab/index', () => {
|
|||
})
|
||||
).toMatchInlineSnapshot(`
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"number": 12345,
|
||||
|
@ -1788,7 +1785,6 @@ describe('modules/platform/gitlab/index', () => {
|
|||
})
|
||||
).toMatchInlineSnapshot(`
|
||||
{
|
||||
"displayNumber": "Merge Request #12345",
|
||||
"id": 1,
|
||||
"iid": 12345,
|
||||
"number": 12345,
|
||||
|
@ -1947,7 +1943,6 @@ describe('modules/platform/gitlab/index', () => {
|
|||
bodyStruct: {
|
||||
hash: '23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90',
|
||||
},
|
||||
displayNumber: 'Merge Request #12345',
|
||||
hasAssignees: false,
|
||||
headPipelineStatus: undefined,
|
||||
labels: undefined,
|
||||
|
|
|
@ -603,7 +603,6 @@ export async function createPr({
|
|||
const pr = res.body;
|
||||
pr.number = pr.iid;
|
||||
pr.sourceBranch = sourceBranch;
|
||||
pr.displayNumber = `Merge Request #${pr.iid}`;
|
||||
// istanbul ignore if
|
||||
if (config.prList) {
|
||||
config.prList.push(pr);
|
||||
|
@ -623,7 +622,6 @@ export async function getPr(iid: number): Promise<GitlabPr> {
|
|||
sourceBranch: mr.source_branch,
|
||||
targetBranch: mr.target_branch,
|
||||
number: mr.iid,
|
||||
displayNumber: `Merge Request #${mr.iid}`,
|
||||
bodyStruct: getPrBodyStruct(mr.description),
|
||||
state: mr.state === 'opened' ? 'open' : mr.state,
|
||||
headPipelineStatus: mr.head_pipeline?.status,
|
||||
|
|
|
@ -65,7 +65,6 @@ export interface Pr {
|
|||
cannotMergeReason?: string; // for reflecting platform policies which may prevent merging
|
||||
createdAt?: string;
|
||||
closedAt?: string;
|
||||
displayNumber?: string;
|
||||
hasAssignees?: boolean;
|
||||
labels?: string[];
|
||||
number: number;
|
||||
|
|
|
@ -147,8 +147,7 @@ If you need any further assistance then you can also [request help here](${
|
|||
// Check if existing PR needs updating
|
||||
const prBodyHash = hashBody(prBody);
|
||||
if (existingPr.bodyStruct?.hash === prBodyHash) {
|
||||
// TODO: types (#7154)
|
||||
logger.debug(`${existingPr.displayNumber!} does not need updating`);
|
||||
logger.debug(`Pull Request #${existingPr.number} does not need updating`);
|
||||
return;
|
||||
}
|
||||
// PR must need updating
|
||||
|
@ -179,7 +178,10 @@ If you need any further assistance then you can also [request help here](${
|
|||
labels,
|
||||
platformOptions: getPlatformPrOptions({ ...config, automerge: false }),
|
||||
});
|
||||
logger.info({ pr: pr!.displayNumber }, 'Onboarding PR created');
|
||||
logger.info(
|
||||
{ pr: `Pull Request #${pr!.number}` },
|
||||
'Onboarding PR created'
|
||||
);
|
||||
await addParticipants(config, pr!);
|
||||
}
|
||||
} catch (err) {
|
||||
|
|
|
@ -299,7 +299,7 @@ describe('workers/repository/update/pr/index', () => {
|
|||
|
||||
expect(res).toEqual({
|
||||
type: 'with-pr',
|
||||
pr: { displayNumber: 'Dry run PR', number: 0 },
|
||||
pr: { number: 0 },
|
||||
});
|
||||
expect(platform.updatePr).not.toHaveBeenCalled();
|
||||
expect(platform.createPr).not.toHaveBeenCalled();
|
||||
|
|
|
@ -307,8 +307,9 @@ export async function ensurePr(
|
|||
existingPrTitle === newPrTitle &&
|
||||
existingPrBodyHash === newPrBodyHash
|
||||
) {
|
||||
// TODO: types (#7154)
|
||||
logger.debug(`${existingPr.displayNumber!} does not need updating`);
|
||||
logger.debug(
|
||||
`Pull Request #${existingPr.number} does not need updating`
|
||||
);
|
||||
return { type: 'with-pr', pr: existingPr };
|
||||
}
|
||||
// PR must need updating
|
||||
|
@ -349,7 +350,7 @@ export async function ensurePr(
|
|||
let pr: Pr | null;
|
||||
if (GlobalConfig.get('dryRun')) {
|
||||
logger.info('DRY-RUN: Would create PR: ' + prTitle);
|
||||
pr = { number: 0, displayNumber: 'Dry run PR' } as never;
|
||||
pr = { number: 0 } as never;
|
||||
} else {
|
||||
try {
|
||||
if (
|
||||
|
@ -430,8 +431,7 @@ export async function ensurePr(
|
|||
} else {
|
||||
await addParticipants(config, pr);
|
||||
}
|
||||
// TODO: types (#7154)
|
||||
logger.debug(`Created ${pr.displayNumber!}`);
|
||||
logger.debug(`Created Pull Request #${pr.number}`);
|
||||
return { type: 'with-pr', pr };
|
||||
}
|
||||
} catch (err) {
|
||||
|
|
Loading…
Reference in a new issue