Commit 57e974c0 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix 500 when using CI

- Fix for Ci::Build state machine, allowing to process builds without the project
- Forcefully update builds that didn't want to update with state machine
- Fix saving GitLabCiService as Admin Template
parent 1324cc2f
...@@ -2,6 +2,8 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -2,6 +2,8 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.3.0 (unreleased) v 8.3.0 (unreleased)
- Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera) - Fix: Assignee selector is empty when 'Unassigned' is selected (Jose Corcuera)
- Forcefully update builds that didn't want to update with state machine
- Fix: saving GitLabCiService as Admin Template
v 8.2.0 v 8.2.0
- Improved performance of finding projects and groups in various places - Improved performance of finding projects and groups in various places
......
...@@ -97,6 +97,8 @@ module Ci ...@@ -97,6 +97,8 @@ module Ci
state_machine :status, initial: :pending do state_machine :status, initial: :pending do
after_transition any => [:success, :failed, :canceled] do |build, transition| after_transition any => [:success, :failed, :canceled] do |build, transition|
return unless build.gl_project
project = build.project project = build.project
if project.web_hooks? if project.web_hooks?
......
...@@ -30,6 +30,7 @@ class GitlabCiService < CiService ...@@ -30,6 +30,7 @@ class GitlabCiService < CiService
end end
def ensure_gitlab_ci_project def ensure_gitlab_ci_project
return unless project
project.ensure_gitlab_ci_project project.ensure_gitlab_ci_project
end end
......
...@@ -14,5 +14,8 @@ class StuckCiBuildsWorker ...@@ -14,5 +14,8 @@ class StuckCiBuildsWorker
Rails.logger.debug "Dropping stuck #{build.status} build #{build.id} for runner #{build.runner_id}" Rails.logger.debug "Dropping stuck #{build.status} build #{build.id} for runner #{build.runner_id}"
build.drop build.drop
end end
# Update builds that failed to drop
builds.update_all(status: 'failed')
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment