Skip to content

Add source and destination branch data to Compliance Dashboard

What does this MR do?

Add the source and target branch data to the Compliance Dashboard. If the branch doesn't exist (deleted on merge for instance), the branch is shown as plain text. Otherwise, a link to the branch is included.

Additional notes

This is part two of adding branch details to the Compliance Dashboard.

  1. Add source and destination branches to compliance entity backend !37630 (merged)
  2. Display source and destination branches in compliance dashboard frontend <- this MR

Screenshots

Before After
image image

Local testing

The URL for the dashboard is https://[GDK_HOST]/groups/gitlab-org/-/security/compliance_dashboard

If you don't see any merge requests, you can run the following in your rails console in your gitlab directory to add a merge request event:

# Include FactoryBot
FactoryBot.definition_file_paths = [Rails.root.join('ee', 'spec', 'factories')]
FactoryBot.find_definitions

group = Group.find(22) # The group id for gitlab-org, replace it for a different group 
user = User.find(1) # The admin id on GDK, replace it for a different user

project = FactoryBot.create(:project, :repository, :public, group: group)
merge_request = FactoryBot.create(:merge_request, source_project: project, state: :merged)
FactoryBot.create(:event, :merged, project: project, target: merge_request, author: user, created_at: 10.minutes.ago)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related #216279 (closed)

Edited by Robert Hunt

Merge request reports