Skip to content
Snippets Groups Projects

CSV download for Merge Commits

Merged Aishwarya Subramanian requested to merge commit_history_csv into master
All threads resolved!
7 files
+ 252
0
Compare changes
  • Side-by-side
  • Inline
Files
7
 
# frozen_string_literal: true
 
class Groups::Security::MergeCommitsReportController < Groups::ApplicationController
 
include Groups::SecurityFeaturesHelper
 
 
before_action :authorize_compliance_dashboard!
 
 
def index
 
csv_data = MergeCommits::ExportCsvService.new(current_user, group.id).csv_data
 
 
respond_to do |format|
 
format.csv do
 
send_data(
 
csv_data,
 
type: 'text/csv; charset=utf-8; header=present',
 
filename: merge_commits_csv_filename
 
)
 
end
 
end
 
end
 
 
private
 
 
def authorize_compliance_dashboard!
 
render_404 unless group_level_compliance_dashboard_available?(group)
 
end
 
 
def merge_commits_csv_filename
 
"#{group.id}-merge-commits-#{Time.current.to_i}.csv"
 
end
 
end
Loading