Skip to content
Snippets Groups Projects
Commit ea4a81c4 authored by Michael Becker's avatar Michael Becker
Browse files

Add the merge date to the Chain of Custody report

Prior to this change, the [Chain of Custody report][0] did not include
the date or time when a MR was merged.

Without this field, a user needed to take the report and
cross-reference it with a list of Git commits to identify the time a
merge occurred.

This was a time consuming and error prone process.

This lack of date information also made it difficult to filter reporte
rows by date ranges. See [issue 365041][1] for more details

With this commit, we now include a "Date Merged" column in the report

[0]:https://docs.gitlab.com/ee/user/compliance/compliance_report/#chain-of-custody-report
[1]:#365041

Changelog: changed
MR: !91766#
EE: true
parent 93e4fc63
No related branches found
No related tags found
1 merge request!91766Add the merge date to the Chain of Custody report
......@@ -96,7 +96,7 @@ Our criteria for the separation of duties is as follows:
The Chain of Custody report allows customers to export a list of merge commits within the group.
The data provides a comprehensive view with respect to merge commits. It includes the merge commit SHA,
merge request author, merge request ID, merge user, pipeline ID, group name, project name, and merge request approvers.
merge request author, merge request ID, merge user, date merged, pipeline ID, group name, project name, and merge request approvers.
Depending on the merge strategy, the merge commit SHA can be a merge commit, squash commit, or a diff head commit.
To download the Chain of Custody report:
......
......@@ -49,6 +49,7 @@ def header_to_value_hash
'Author' => -> (merge_request) { merge_request.author&.name },
'Merge Request' => 'id',
'Merged By' => -> (merge_request) { merge_request.metrics&.merged_by&.name },
'Date Merged' => -> (merge_request) { merge_request.merged_at },
'Pipeline' => -> (merge_request) { merge_request.metrics&.pipeline_id },
'Group' => -> (merge_request) { merge_request.project&.namespace&.name },
'Project' => -> (merge_request) { merge_request.project&.name },
......
......@@ -21,7 +21,7 @@
it { expect(service.csv_data).to be_success }
it 'includes the appropriate headers' do
expect(csv.headers).to eq(['Merge Commit', 'Author', 'Merge Request', 'Merged By', 'Pipeline', 'Group', 'Project', 'Approver(s)'])
expect(csv.headers).to eq(['Merge Commit', 'Author', 'Merge Request', 'Merged By', 'Date Merged', 'Pipeline', 'Group', 'Project', 'Approver(s)'])
end
context 'data verification' do
......@@ -41,6 +41,10 @@
expect(csv[0]['Merged By']).to eq 'Brock Lesnar'
end
specify 'Date Merged' do
expect(csv[0]['Date Merged']).to eq merge_request.merged_at.to_s
end
specify 'Pipeline' do
expect(csv[0]['Pipeline']).to eq merge_request.metrics.pipeline_id.to_s
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment