Skip to content
代码片段 群组 项目
未验证 提交 af12d337 编辑于 作者: Patrick Cyiza's avatar Patrick Cyiza 提交者: GitLab
浏览文件

Enable git guardian ff by default

上级 24024148
No related branches found
No related tags found
无相关合并请求
......@@ -22,7 +22,7 @@ module Integration
override :project_specific_integration_names
def project_specific_integration_names
names = super + EE_PROJECT_SPECIFIC_INTEGRATION_NAMES + GOOGLE_CLOUD_PLATFORM_INTEGRATION_NAMES
names.append('git_guardian') if ::Feature.enabled?(:git_guardian_integration, type: :wip)
names.append('git_guardian') if ::Feature.enabled?(:git_guardian_integration)
unless ::Gitlab::Saas.feature_available?(:google_artifact_registry)
names.delete('google_cloud_platform_artifact_registry')
......
......@@ -21,6 +21,18 @@ def self.description
s_('GitGuardian|Scan pushed document contents for policy breaks.')
end
def self.help
docs_link = ActionController::Base.helpers.link_to(
_('Learn more.'),
Rails.application.routes.url_helpers.help_page_url('user/project/integrations/git_guardian'),
target: '_blank',
rel: 'noopener noreferrer'
)
format(_('Scan pushed document contents for policy breaks. %{docs_link}').html_safe, # rubocop:disable Rails/OutputSafety -- It is fine to call html_safe here
docs_link: docs_link.html_safe) # rubocop:disable Rails/OutputSafety -- It is fine to call html_safe here
end
def self.to_param
'git_guardian'
end
......@@ -30,7 +42,7 @@ def self.supported_events
end
def execute(blobs)
return unless Feature.enabled?(:git_guardian_integration, type: :wip)
return unless Feature.enabled?(:git_guardian_integration)
::Gitlab::GitGuardian::Client.new(token).execute(blobs) if activated?
end
......
......@@ -5,5 +5,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141611
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/438695
milestone: '16.9'
group: group::source code
type: wip
default_enabled: false
type: development
default_enabled: true
......@@ -90,7 +90,7 @@ def integration_attributes(integration)
end
end
put "#{path}/#{slug}" do
if slug == "git-guardian" && Feature.disabled?(:git_guardian_integration, type: :wip)
if slug == "git-guardian" && Feature.disabled?(:git_guardian_integration)
render_api_error!('GitGuardian feature is disabled', 400)
end
......@@ -128,7 +128,7 @@ def integration_attributes(integration)
requires :slug, type: String, values: INTEGRATIONS.keys, desc: 'The name of the integration'
end
delete "#{path}/:slug" do
if params[:slug] == "git-guardian" && Feature.disabled?(:git_guardian_integration, type: :wip)
if params[:slug] == "git-guardian" && Feature.disabled?(:git_guardian_integration)
render_api_error!('GitGuardian feature is disabled', 400)
end
......
......@@ -43325,6 +43325,9 @@ msgstr ""
msgid "Saving project."
msgstr ""
 
msgid "Scan pushed document contents for policy breaks. %{docs_link}"
msgstr ""
msgid "ScanExecutionPolicy|%{boldStart}Run%{boldEnd} %{typeSelector} %{actionType}"
msgstr ""
 
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册