Commit 361e943b authored by anna_vovchenko's avatar anna_vovchenko Committed by Anna Vovchenko

Added feature flag to show terraform banner

The aim of the flag is to add possibility to disable it for self-hosted
The feature flag is enabled by default

Changelog: added
parent 9b97b866
......@@ -351,7 +351,7 @@ module ProjectsHelper
end
def show_terraform_banner?(project)
project.repository_languages.with_programming_language('HCL').exists? && project.terraform_states.empty?
Feature.enabled?(:show_terraform_banner, type: :ops, default_enabled: true) && project.repository_languages.with_programming_language('HCL').exists? && project.terraform_states.empty?
end
def project_permissions_panel_data(project)
......
---
name: show_terraform_banner
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71462
rollout_issue_url:
milestone: '14.4'
type: ops
group: group::configure
default_enabled: true
......@@ -904,6 +904,14 @@ RSpec.describe ProjectsHelper do
it { is_expected.to be_falsey }
end
context 'the :show_terraform_banner feature flag is disabled' do
before do
stub_feature_flags(show_terraform_banner: false)
end
it { is_expected.to be_falsey }
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