The CI/CD keyword manual_confirmation has no effect on jobs that stop enviroments.
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
The CI/CD keyword manual_confirmation has no effect on jobs that stop enviroments.
Steps to reproduce
- Create a repo with the following gitlab CI:
---
stages:
- deploy
- stop
deploy:
stage: deploy
script:
- "echo deploy"
environment:
name: test
on_stop: stop
when: manual
manual_confirmation: "Are you sure?"
stop:
stage: stop
script:
- "echo stop"
environment:
name: test
action: stop
when: manual
manual_confirmation: "Are you sure?"
- Start the pipeline
Example Project
https://gitlab.com/DeutscheAnwaltshotline/manual_confirmation
What is the current bug behavior?
There's no confirmation popup when starting the stop job manually. It is shown for the deploy job.
What is the expected correct behavior?
There should be a popup.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Implementation guide
- Update the status/build/stop to have the
confirmation_messagemethod:
diff --git a/lib/gitlab/ci/status/build/stop.rb b/lib/gitlab/ci/status/build/stop.rb
index a620e7ad126f..d65fea6d6c42 100644
--- a/lib/gitlab/ci/status/build/stop.rb
+++ b/lib/gitlab/ci/status/build/stop.rb
@@ -36,6 +36,10 @@ def action_method
def self.matches?(build, user)
build.playable? && build.stops_environment?
end
+
+ def confirmation_message
+ subject.manual_confirmation_message
+ end
end
end
end
- Update the related spec. Example of a similar test: !148778 (diffs)
Edited by 🤖 GitLab Bot 🤖
