summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-20 15:33:45 +0000
committerRémy Coutable <remy@rymai.me>2016-07-21 11:16:04 +0200
commitb76d37c2261d4a61ad199ea4f32659f1e15d797a (patch)
tree9b8ccae307214e99801ed84dc493bb11f87ba744 /app
parented3cda00edf7d45edfbde5a8567b88ecfd8d1d3d (diff)
downloadgitlab-ce-b76d37c2261d4a61ad199ea4f32659f1e15d797a.tar.gz
Merge branch 'fix-retries-on-manual-actions' into 'master'
Fix two small problems on how we handle manual actions ## What does this MR do? Fixes two small problems in how we handle manual actions: - On environments page we show a `Play` for the same action that is lately deployed, we should show other actions only - When we process a pipeline that have only a manual action in a stage, the pipeline will stop being processed. - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5366
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/build.rb2
-rw-r--r--app/models/ci/pipeline.rb5
2 files changed, 4 insertions, 3 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index fcb7c98df0f..cbfa14e81f1 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -97,7 +97,7 @@ module Ci
end
def other_actions
- pipeline.manual_actions.where.not(id: self)
+ pipeline.manual_actions.where.not(name: name)
end
def playable?
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index ad5437cea14..f0edf3e2731 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -217,8 +217,9 @@ module Ci
# build builds only for the first stage that has builds available.
#
stages.any? do |stage|
- CreateBuildsService.new(self)
- .execute(stage, user, status, trigger_request).present?
+ CreateBuildsService.new(self).
+ execute(stage, user, status, trigger_request).
+ any?(&:active?)
end
end