Commit 721fcebf authored by Max Woolf's avatar Max Woolf Committed by David O'Regan

Enable MR CSV Export

Puts export_merge_requests_as_csv behind a
default on feature-flag to enable
CSV export of merge requests
parent 26e81eeb
......@@ -319,7 +319,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
end
def export_csv
return render_404 unless Feature.enabled?(:export_merge_requests_as_csv, project)
return render_404 unless Feature.enabled?(:export_merge_requests_as_csv, project, default_enabled: true)
IssuableExportCsvWorker.perform_async(:merge_request, current_user.id, project.id, finder_options.to_h) # rubocop:disable CodeReuse/Worker
......
- if Feature.enabled?(:export_merge_requests_as_csv, @project)
- if Feature.enabled?(:export_merge_requests_as_csv, @project, default_enabled: true)
.btn-group
= render 'shared/issuable/csv_export/button', issuable_type: 'merge-requests'
......@@ -8,5 +8,5 @@
= link_to new_merge_request_path, class: "gl-button btn btn-success", title: "New merge request" do
New merge request
- if Feature.enabled?(:export_merge_requests_as_csv, @project)
- if Feature.enabled?(:export_merge_requests_as_csv, @project, default_enabled: true)
= render 'shared/issuable/csv_export/modal', issuable_type: 'merge_requests'
---
title: Enable MR CSV export
merge_request: 46662
author:
type: added
......@@ -4,4 +4,4 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45130
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/267129
type: development
group: group::compliance
default_enabled: false
default_enabled: true
......@@ -7,10 +7,12 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Export Merge Requests to CSV **(CORE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/3619) in GitLab 13.6.
> - It's [deployed behind a feature flag](../../../administration/feature_flags.md), disabled by default.
> - It's disabled on GitLab.com.
> - It's not recommended for production use.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-export-merge-requests-to-csv). **(CORE ONLY)**
> - It was [deployed behind a feature flag](../../../administration/feature_flags.md), disabled by default.
> - Became enabled by default in GitLab 13.6.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-export-merge-requests-to-csv). **(CORE ONLY)**
> - It can be enabled or disabled for a single project.
CAUTION: **Warning:**
This feature might not be available to you. Check the **version history** note above for details.
......@@ -55,25 +57,25 @@ The following table shows what attributes will be present in the CSV.
### Enable or disable Export Merge Requests to CSV **(CORE ONLY)**
Export merge requests to CSV is under development and not ready for production use. It is
deployed behind a feature flag that is **disabled by default**.
Export merge requests to CSV is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can enable it.
can opt to disable it.
To enable it:
```ruby
# For the instance
Feature.enable(:export_merge_requests_as_csv)
# For a single project
Feature.enable(:export_merge_requests_as_csv, Project.find(<project id>))
```
To disable it:
```ruby
Feature.enable(:export_merge_requests_as_csv)
```
Optionally, pass a project as an argument to enable for a single project.
```ruby
Feature.enable(:export_merge_requests_as_csv, project)
# For the instance
Feature.disable(:export_merge_requests_as_csv)
# For a single project
Feature.disable(:export_merge_requests_as_csv, Project.find(<project id>))
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment