Skip to content

Commit 4341780

Browse files
authored
fix(gitlab): add missing createdAt to mapped PR (renovatebot#36058)
1 parent d2b73dc commit 4341780

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

lib/modules/platform/gitlab/__snapshots__/index.spec.ts.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ exports[`modules/platform/gitlab/index > getBranchPr(branchName) > should return
55
"bodyStruct": {
66
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
77
},
8+
"createdAt": "2025-05-19T12:00:00.000Z",
89
"hasAssignees": false,
910
"number": 91,
1011
"sourceBranch": "some-branch",
@@ -19,6 +20,7 @@ exports[`modules/platform/gitlab/index > getBranchPr(branchName) > should strip
1920
"bodyStruct": {
2021
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
2122
},
23+
"createdAt": "2025-05-19T12:00:00.000Z",
2224
"hasAssignees": false,
2325
"isDraft": true,
2426
"number": 91,
@@ -34,6 +36,7 @@ exports[`modules/platform/gitlab/index > getBranchPr(branchName) > should strip
3436
"bodyStruct": {
3537
"hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
3638
},
39+
"createdAt": "2025-05-19T12:00:00.000Z",
3740
"hasAssignees": false,
3841
"isDraft": true,
3942
"number": 91,
@@ -49,6 +52,7 @@ exports[`modules/platform/gitlab/index > getPr(prNo) > removes deprecated draft
4952
"bodyStruct": {
5053
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
5154
},
55+
"createdAt": "2025-05-19T12:00:00.000Z",
5256
"hasAssignees": false,
5357
"isDraft": true,
5458
"number": 12345,
@@ -64,6 +68,7 @@ exports[`modules/platform/gitlab/index > getPr(prNo) > removes draft prefix from
6468
"bodyStruct": {
6569
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
6670
},
71+
"createdAt": "2025-05-19T12:00:00.000Z",
6772
"hasAssignees": false,
6873
"isDraft": true,
6974
"number": 12345,
@@ -79,6 +84,7 @@ exports[`modules/platform/gitlab/index > getPr(prNo) > returns the PR 1`] = `
7984
"bodyStruct": {
8085
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
8186
},
87+
"createdAt": "2025-05-19T12:00:00.000Z",
8288
"hasAssignees": false,
8389
"number": 12345,
8490
"sourceBranch": "some-branch",
@@ -93,6 +99,7 @@ exports[`modules/platform/gitlab/index > getPr(prNo) > returns the PR with nonex
9399
"bodyStruct": {
94100
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
95101
},
102+
"createdAt": "2025-05-19T12:00:00.000Z",
96103
"hasAssignees": true,
97104
"number": 12345,
98105
"sourceBranch": "some-branch",
@@ -107,6 +114,7 @@ exports[`modules/platform/gitlab/index > getPr(prNo) > returns the mergeable PR
107114
"bodyStruct": {
108115
"hash": "23f41dbec0785a6c77457dd6ebf99ae5970c5fffc9f7a8ad7f66c1b8eeba5b90",
109116
},
117+
"createdAt": "2025-05-19T12:00:00.000Z",
110118
"hasAssignees": true,
111119
"number": 12345,
112120
"sourceBranch": "some-branch",

lib/modules/platform/gitlab/index.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ describe('modules/platform/gitlab/index', () => {
545545
iid: 91,
546546
title: 'some change',
547547
state: 'opened',
548+
created_at: '2025-05-19T12:00:00.000Z',
548549
additions: 1,
549550
deletions: 1,
550551
commits: 1,
@@ -580,6 +581,7 @@ describe('modules/platform/gitlab/index', () => {
580581
iid: 91,
581582
title: 'Draft: some change',
582583
state: 'opened',
584+
created_at: '2025-05-19T12:00:00.000Z',
583585
additions: 1,
584586
deletions: 1,
585587
commits: 1,
@@ -615,6 +617,7 @@ describe('modules/platform/gitlab/index', () => {
615617
iid: 91,
616618
title: 'WIP: some change',
617619
state: 'opened',
620+
created_at: '2025-05-19T12:00:00.000Z',
618621
additions: 1,
619622
deletions: 1,
620623
commits: 1,
@@ -2928,6 +2931,7 @@ describe('modules/platform/gitlab/index', () => {
29282931
title: 'do something',
29292932
description: 'a merge request',
29302933
state: 'merged',
2934+
created_at: '2025-05-19T12:00:00.000Z',
29312935
merge_status: 'cannot_be_merged',
29322936
diverged_commits_count: 5,
29332937
source_branch: 'some-branch',
@@ -2951,6 +2955,7 @@ describe('modules/platform/gitlab/index', () => {
29512955
title: 'Draft: do something',
29522956
description: 'a merge request',
29532957
state: 'merged',
2958+
created_at: '2025-05-19T12:00:00.000Z',
29542959
merge_status: 'cannot_be_merged',
29552960
diverged_commits_count: 5,
29562961
source_branch: 'some-branch',
@@ -2974,6 +2979,7 @@ describe('modules/platform/gitlab/index', () => {
29742979
title: 'WIP: do something',
29752980
description: 'a merge request',
29762981
state: 'merged',
2982+
created_at: '2025-05-19T12:00:00.000Z',
29772983
merge_status: 'cannot_be_merged',
29782984
diverged_commits_count: 5,
29792985
source_branch: 'some-branch',
@@ -2997,6 +3003,7 @@ describe('modules/platform/gitlab/index', () => {
29973003
title: 'do something',
29983004
description: 'a merge request',
29993005
state: 'open',
3006+
created_at: '2025-05-19T12:00:00.000Z',
30003007
diverged_commits_count: 5,
30013008
source_branch: 'some-branch',
30023009
target_branch: 'master',
@@ -3021,6 +3028,7 @@ describe('modules/platform/gitlab/index', () => {
30213028
title: 'do something',
30223029
description: 'a merge request',
30233030
state: 'open',
3031+
created_at: '2025-05-19T12:00:00.000Z',
30243032
merge_status: 'cannot_be_merged',
30253033
diverged_commits_count: 2,
30263034
source_branch: 'some-branch',

lib/modules/platform/gitlab/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export interface GitLabMergeRequest {
2323
iid: number;
2424
title: string;
2525
state: string;
26+
created_at: string;
2627
source_branch: string;
2728
target_branch: string;
2829
description: string;

lib/modules/platform/gitlab/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export function prInfo(mr: GitLabMergeRequest): GitlabPr {
1111
state: mr.state === 'opened' ? 'open' : mr.state,
1212
number: mr.iid,
1313
title: mr.title,
14+
createdAt: mr.created_at,
1415
hasAssignees: !!(mr.assignee?.id ?? mr.assignees?.[0]?.id),
1516
bodyStruct: getPrBodyStruct(mr.description),
1617

0 commit comments

Comments
 (0)