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

Removed feature flag access_token_webhooks

This feature is set to true in production for sufficient amount of time
and can be removed

Changelog: removed

Fixed the spec issue
上级 d5506fa5
No related branches found
No related tags found
1 合并请求!2419Fix TanukiBot spec relying on outdated code
......@@ -18,7 +18,6 @@ def execute
@relations.each do |hooks|
hooks.hooks_for(@scope).select_active(@scope, @data).each do |hook|
next if @scope == :emoji_hooks && Feature.disabled?(:emoji_webhooks, hook.parent)
next if @scope == :resource_access_token_hooks && Feature.disabled?(:access_tokens_webhooks, hook.parent)
hook.async_execute(@data, @scope.to_s)
end
......
......@@ -76,12 +76,11 @@
= form.gitlab_ui_checkbox_component :emoji_events,
integration_webhook_event_human_name(:emoji_events),
help_text: s_('Webhooks|An emoji is awarded or revoked. %{help_link}?').html_safe % { help_link: emoji_help_link }
- if Feature.enabled?(:access_tokens_webhooks, hook.parent)
%li.gl-pb-3
- access_token_help_link = link_to s_('Which project or group access token events trigger webhooks'), help_page_path('user/project/integrations/webhook_events', anchor: 'project-and-group-access-token-events')
= form.gitlab_ui_checkbox_component :resource_access_token_events,
integration_webhook_event_human_name(:resource_access_token_events),
help_text: s_('Webhooks|An access token is going to expire in the next 7 days. %{help_link}?').html_safe % { help_link: access_token_help_link }
%li.gl-pb-3
- access_token_help_link = link_to s_('Which project or group access token events trigger webhooks'), help_page_path('user/project/integrations/webhook_events', anchor: 'project-and-group-access-token-events')
= form.gitlab_ui_checkbox_component :resource_access_token_events,
integration_webhook_event_human_name(:resource_access_token_events),
help_text: s_('Webhooks|An access token is going to expire in the next 7 days. %{help_link}?').html_safe % { help_link: access_token_help_link }
- if Feature.enabled?(:custom_webhook_template, hook.parent, type: :beta)
......
......@@ -114,7 +114,6 @@ def deliver_user_notifications(token_names, user)
def execute_web_hooks(token, bot_user)
resource = bot_user.resource_bot_resource
return unless ::Feature.enabled?(:access_tokens_webhooks, resource)
return if resource.is_a?(Project) && !resource.has_active_hooks?(:resource_access_token_hooks)
hook_data = Gitlab::DataBuilder::ResourceAccessToken.build(token, :expiring, resource)
......
---
name: access_tokens_webhooks
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/426147
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141907
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/439379
milestone: '16.10'
group: group::authentication
type: gitlab_com_derisk
default_enabled: false
......@@ -2069,6 +2069,8 @@ Payload example:
## Project and group access token events
[Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141907) in GitLab 16.10 [with a flag](../../../administration/feature_flags.md) named `access_token_webhooks`. Disabled by default.
[Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/439379) in GitLab 16.11.
[Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/454642) in GitLab 16.11. Feature flag `access_token_webhooks` removed.
An access token event is triggered when a [project or group access token](../../../security/token_overview.md) will expire in seven days or less.
......
......@@ -49,18 +49,6 @@ def run_hooks(scope, data)
run_hooks(:resource_access_token_hooks, data)
end
context 'when access_tokens_webhooks feature flag is disabled' do
before do
stub_feature_flags(access_tokens_webhooks: false)
end
it 'does not execute the hook' do
expect(WebHookService).not_to receive(:new)
run_hooks(:resource_access_token_hooks, data)
end
end
end
context 'with emoji hooks' do
......
......@@ -126,18 +126,6 @@
expect { worker.perform }.not_to exceed_all_query_limit(control)
end
context 'when access_tokens_webhooks feature is disabled' do
before do
stub_feature_flags(access_tokens_webhooks: false)
end
it "does not execute access token webhook" do
expect(::Projects::TriggeredHooks).not_to receive(:execute)
worker.perform
end
end
end
context 'when a token is owned by a group bot' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册