Commit d41e6fd0 authored by Mark Chao's avatar Mark Chao

Merge branch 'remove-gpg-keys-feature-flag' into 'master'

Remove credentials inventory GPG keys feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!59658
parents 7b9756c3 0fd05f84
......@@ -56,14 +56,7 @@ The instance then notifies the user.
## Review existing GPG keys
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/282429) in GitLab 13.10.
> - [Deployed behind a feature flag](../feature_flags.md), disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/292961) in GitLab 13.11.
> - Enabled on GitLab.com.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-the-gpg-keys-view).
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/292961) in GitLab 13.12.
You can view all existing GPG in your GitLab instance by navigating to the
credentials inventory GPG Keys tab, as well as the following properties:
......@@ -73,22 +66,3 @@ credentials inventory GPG Keys tab, as well as the following properties:
- Whether the GPG key is [verified or unverified](../project/repository/gpg_signed_commits/index.md)
![Credentials inventory page - GPG keys](img/credentials_inventory_gpg_keys_v13_10.png)
### Enable or disable the GPG keys view
Enabling or disabling the GPG keys view 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
Feature.enable(:credential_inventory_gpg_keys)
```
To disable it:
```ruby
Feature.disable(:credential_inventory_gpg_keys)
```
......@@ -9,7 +9,6 @@ class Admin::CredentialsController < Admin::ApplicationController
:ssh_key_delete_path, :gpg_keys_available?
before_action :check_license_credentials_inventory_available!, only: [:index, :revoke, :destroy]
before_action :check_gpg_keys_list_enabled!, only: [:index]
track_unique_visits :index, target_id: 'i_compliance_credential_inventory'
......@@ -21,10 +20,6 @@ class Admin::CredentialsController < Admin::ApplicationController
render_404 unless credentials_inventory_feature_available?
end
def check_gpg_keys_list_enabled!
render_404 if show_gpg_keys? && Feature.disabled?(:credential_inventory_gpg_keys, default_enabled: :yaml)
end
override :credentials_inventory_path
def credentials_inventory_path(args)
admin_credentials_path(args)
......@@ -52,7 +47,7 @@ class Admin::CredentialsController < Admin::ApplicationController
override :gpg_keys_available?
def gpg_keys_available?
Feature.enabled?(:credential_inventory_gpg_keys, default_enabled: :yaml)
true
end
override :users
......
---
title: Remove :credential_inventory_gpg_keys feature flag
merge_request: 59658
author:
type: added
---
name: credential_inventory_gpg_keys
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49835
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/292961
milestone: '13.8'
type: development
group: group::compliance
default_enabled: true
......@@ -38,30 +38,12 @@ RSpec.describe 'Admin::CredentialsInventory' do
end
context 'tabs' do
context 'when GPG keys feature is enabled' do
before_all do
stub_feature_flags(credential_inventory_gpg_keys: true)
end
it 'contains the relevant filter tabs' do
expect(page).to have_link('Personal Access Tokens', href: admin_credentials_path(filter: 'personal_access_tokens'))
expect(page).to have_link('SSH Keys', href: admin_credentials_path(filter: 'ssh_keys'))
expect(page).to have_link('GPG Keys', href: admin_credentials_path(filter: 'gpg_keys'))
end
end
context 'when GPG keys feature is disabled' do
before_all do
stub_feature_flags(credential_inventory_gpg_keys: false)
end
it 'contains the relevant filter tabs' do
expect(page).to have_link('Personal Access Tokens', href: admin_credentials_path(filter: 'personal_access_tokens'))
expect(page).to have_link('SSH Keys', href: admin_credentials_path(filter: 'ssh_keys'))
expect(page).not_to have_link('GPG Keys', href: admin_credentials_path(filter: 'gpg_keys'))
end
end
end
end
context 'filtering' do
......
......@@ -75,18 +75,6 @@ RSpec.describe Admin::CredentialsController, type: :request do
expect(assigns(:credentials)).to match_array([gpg_key])
end
context 'feature flag is disabled' do
before do
stub_feature_flags(credential_inventory_gpg_keys: false)
end
it 'responds with not found' do
get admin_credentials_path(filter: 'gpg_keys')
expect(response).to have_gitlab_http_status(:not_found)
end
end
# There is currently N+1 issue when checking verified_emails per user:
# https://gitlab.com/gitlab-org/gitlab/-/issues/322773
# Therefore we are currently adding + 1 to the control until this is resolved
......
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