Commit c1abac85 authored by Markus Koller's avatar Markus Koller

Merge branch 'ff-export_merge_requests_as_csv-remove' into 'master'

Remove export_merge_requests_as_csv feature flag

See merge request gitlab-org/gitlab!46874
parents 8b5e1ae9 0533cf60
...@@ -318,8 +318,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -318,8 +318,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
end end
def export_csv def export_csv
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 IssuableExportCsvWorker.perform_async(:merge_request, current_user.id, project.id, finder_options.to_h) # rubocop:disable CodeReuse/Worker
index_path = project_merge_requests_path(project) index_path = project_merge_requests_path(project)
......
- if Feature.enabled?(:export_merge_requests_as_csv, @project, default_enabled: true) .btn-group
.btn-group = render 'shared/issuable/csv_export/button', issuable_type: 'merge-requests'
= render 'shared/issuable/csv_export/button', issuable_type: 'merge-requests'
- if @can_bulk_update - if @can_bulk_update
= button_tag "Edit merge requests", class: "gl-button btn gl-mr-3 js-bulk-update-toggle" = button_tag "Edit merge requests", class: "gl-button btn gl-mr-3 js-bulk-update-toggle"
...@@ -8,5 +7,4 @@ ...@@ -8,5 +7,4 @@
= link_to new_merge_request_path, class: "gl-button btn btn-success", title: "New merge request" do = link_to new_merge_request_path, class: "gl-button btn btn-success", title: "New merge request" do
New merge request New merge request
- if Feature.enabled?(:export_merge_requests_as_csv, @project, default_enabled: true) = render 'shared/issuable/csv_export/modal', issuable_type: 'merge_requests'
= render 'shared/issuable/csv_export/modal', issuable_type: 'merge_requests'
---
name: export_merge_requests_as_csv
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: true
...@@ -6,23 +6,12 @@ info: To determine the technical writer assigned to the Stage/Group associated w ...@@ -6,23 +6,12 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Export Merge Requests to CSV **(CORE)** # Export Merge Requests to CSV **(CORE)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/3619) in GitLab 13.6. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/3619) in GitLab 13.6.
> - 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.
Exporting Merge Requests CSV enables you and your team to export all the data collected from merge requests into a comma-separated values (CSV) file, which stores tabular data in plain text. Exporting Merge Requests CSV enables you and your team to export all the data collected from merge requests into a comma-separated values (CSV) file, which stores tabular data in plain text.
To export Merge Requests to CSV, navigate to your **Merge Requests** from the sidebar of a project and click **Export to CSV**. To export Merge Requests to CSV, navigate to your **Merge Requests** from the sidebar of a project and click **Export to CSV**.
Exported files are generated asynchronously and delivered as an email attachment upon generation.
## CSV Output ## CSV Output
The following table shows what attributes will be present in the CSV. The following table shows what attributes will be present in the CSV.
...@@ -54,28 +43,3 @@ The following table shows what attributes will be present in the CSV. ...@@ -54,28 +43,3 @@ The following table shows what attributes will be present in the CSV.
- Export merge requests to CSV is not available at the Group’s merge request list. - Export merge requests to CSV is not available at the Group’s merge request list.
- As the merge request CSV file is sent as an email attachment, the size is limited to 15MB to ensure successful delivery across a range of email providers. If you need to minimize the size of the file, you can narrow the search before export. For example, you can set up exports of open and closed merge requests in separate files. - As the merge request CSV file is sent as an email attachment, the size is limited to 15MB to ensure successful delivery across a range of email providers. If you need to minimize the size of the file, you can narrow the search before export. For example, you can set up exports of open and closed merge requests in separate files.
### Enable or disable Export Merge Requests to CSV **(CORE ONLY)**
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 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
# 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>))
```
...@@ -1998,10 +1998,6 @@ RSpec.describe Projects::MergeRequestsController do ...@@ -1998,10 +1998,6 @@ RSpec.describe Projects::MergeRequestsController do
describe 'POST export_csv' do describe 'POST export_csv' do
subject { post :export_csv, params: { namespace_id: project.namespace, project_id: project } } subject { post :export_csv, params: { namespace_id: project.namespace, project_id: project } }
before do
stub_feature_flags(export_merge_requests_as_csv: project)
end
it 'redirects to the merge request index' do it 'redirects to the merge request index' do
subject subject
...@@ -2014,17 +2010,5 @@ RSpec.describe Projects::MergeRequestsController do ...@@ -2014,17 +2010,5 @@ RSpec.describe Projects::MergeRequestsController do
subject subject
end end
context 'feature is disabled' do
before do
stub_feature_flags(export_merge_requests_as_csv: false)
end
it 'expects a 404 response' do
subject
expect(response).to have_gitlab_http_status(:not_found)
end
end
end end
end end
...@@ -9,38 +9,23 @@ RSpec.describe 'Merge Requests > Exports as CSV', :js do ...@@ -9,38 +9,23 @@ RSpec.describe 'Merge Requests > Exports as CSV', :js do
before do before do
sign_in(user) sign_in(user)
visit(project_merge_requests_path(project))
end end
subject { page.find('.nav-controls') } subject { page.find('.nav-controls') }
context 'feature is not enabled' do it { is_expected.to have_button('Export as CSV') }
before do
stub_feature_flags(export_merge_requests_as_csv: false)
visit(project_merge_requests_path(project))
end
it { is_expected.not_to have_button('Export as CSV') }
end
context 'feature is enabled for a project' do context 'button is clicked' do
before do before do
stub_feature_flags(export_merge_requests_as_csv: project) click_button('Export as CSV')
visit(project_merge_requests_path(project))
end end
it { is_expected.to have_button('Export as CSV') } it 'shows a success message' do
click_link('Export merge requests')
context 'button is clicked' do
before do
click_button('Export as CSV')
end
it 'shows a success message' do
click_link('Export merge requests')
expect(page).to have_content 'Your CSV export has started.' expect(page).to have_content 'Your CSV export has started.'
expect(page).to have_content "It will be emailed to #{user.email} when complete" expect(page).to have_content "It will be emailed to #{user.email} when complete"
end
end end
end end
end end
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