diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-16 03:11:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-16 03:11:34 +0300 |
commit | 574c823ddc9bdcbcf302105a578fac345463a287 (patch) | |
tree | 628e0cdee2f6624296149c7484613e771a788e08 | |
parent | b403a8ba3d2f01b6d4e46d1980639bd769b1be4f (diff) |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | app/services/releases/destroy_service.rb | 2 | ||||
-rw-r--r-- | app/views/shared/web_hooks/_form.html.haml | 2 | ||||
-rw-r--r-- | config/feature_flags/development/inherit_higher_access_levels_no_cross_join.yml | 2 | ||||
-rw-r--r-- | doc/user/project/integrations/webhook_events.md | 5 | ||||
-rw-r--r-- | locale/gitlab.pot | 2 | ||||
-rw-r--r-- | spec/services/releases/destroy_service_spec.rb | 6 |
6 files changed, 15 insertions, 4 deletions
diff --git a/app/services/releases/destroy_service.rb b/app/services/releases/destroy_service.rb index 41b421662ef..78613c05ff1 100644 --- a/app/services/releases/destroy_service.rb +++ b/app/services/releases/destroy_service.rb @@ -9,6 +9,8 @@ module Releases if release.destroy update_catalog_resource! + execute_hooks(release, 'delete') + success(tag: existing_tag, release: release) else error(release.errors.messages || '400 Bad request', 400) diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index f040ea8e542..7c713e63cd7 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -63,7 +63,7 @@ %li.gl-pb-3 = form.gitlab_ui_checkbox_component :releases_events, integration_webhook_event_human_name(:releases_events), - help_text: s_('Webhooks|A release is created or updated.') + help_text: s_('Webhooks|A release is created, updated, or deleted.') - if Feature.enabled?(:emoji_webhooks, hook.parent) %li.gl-pb-5 - emoji_help_link = link_to s_('Which emoji events trigger webhooks'), help_page_path('user/project/integrations/webhook_events.md', anchor: 'emoji-events') diff --git a/config/feature_flags/development/inherit_higher_access_levels_no_cross_join.yml b/config/feature_flags/development/inherit_higher_access_levels_no_cross_join.yml index 1dbf92d2c6f..b4cef5219ba 100644 --- a/config/feature_flags/development/inherit_higher_access_levels_no_cross_join.yml +++ b/config/feature_flags/development/inherit_higher_access_levels_no_cross_join.yml @@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/427238 milestone: '16.5' type: development group: group::authentication and authorization -default_enabled: false +default_enabled: true diff --git a/doc/user/project/integrations/webhook_events.md b/doc/user/project/integrations/webhook_events.md index 204452a072d..705d17c9e76 100644 --- a/doc/user/project/integrations/webhook_events.md +++ b/doc/user/project/integrations/webhook_events.md @@ -1790,12 +1790,15 @@ Payload example: ## Release events -Release events are triggered when a release is created or updated. +> Delete release event [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/418113) in GitLab 16.5. + +Release events are triggered when a release is created, updated, or deleted. The available values for `object_attributes.action` in the payload are: - `create` - `update` +- `delete` Request header: diff --git a/locale/gitlab.pot b/locale/gitlab.pot index fcd8c86969e..1357be62b52 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -53164,7 +53164,7 @@ msgstr "" msgid "Webhooks|A pipeline's status changes." msgstr "" -msgid "Webhooks|A release is created or updated." +msgid "Webhooks|A release is created, updated, or deleted." msgstr "" msgid "Webhooks|A subgroup is created or removed." diff --git a/spec/services/releases/destroy_service_spec.rb b/spec/services/releases/destroy_service_spec.rb index 2b6e96a781e..de3ce2b6206 100644 --- a/spec/services/releases/destroy_service_spec.rb +++ b/spec/services/releases/destroy_service_spec.rb @@ -83,5 +83,11 @@ RSpec.describe Releases::DestroyService, feature_category: :release_orchestratio expect(milestone.reload).to be_persisted end end + + it 'executes hooks' do + expect(service.release).to receive(:execute_hooks).with('delete') + + service.execute + end end end |