diff options
author | James Lopez <james@gitlab.com> | 2018-12-27 13:42:25 +0000 |
---|---|---|
committer | James Lopez <james@gitlab.com> | 2018-12-27 13:42:25 +0000 |
commit | c18b8aa51fadee77040b17f90dda124c57a8a6ce (patch) | |
tree | 574270b1e6d9f987a2c62dd74533be400822d9eb /app/models/ci/build.rb | |
parent | 2537ed052eb85cf38be778131d91e0d2b6b103d5 (diff) | |
parent | 0cd507461d3869661d71ead79fc06c7a3a0979e6 (diff) | |
download | gitlab-ce-c18b8aa51fadee77040b17f90dda124c57a8a6ce.tar.gz |
Merge branch 'security-11-5' into 'security-fix/security-group-user-removal-11-5'
# Conflicts:
# app/services/members/destroy_service.rb
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r-- | app/models/ci/build.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 889f8ce27a6..4b943486aff 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -10,6 +10,7 @@ module Ci include Importable include Gitlab::Utils::StrongMemoize include Deployable + include HasRef belongs_to :project, inverse_of: :builds belongs_to :runner @@ -152,6 +153,10 @@ module Ci .execute(build) # rubocop: enable CodeReuse/ServiceClass end + + def find_running_by_token(token) + running.find_by_token(token) + end end state_machine :status do @@ -638,11 +643,11 @@ module Ci def secret_group_variables return [] unless project.group - project.group.ci_variables_for(ref, project) + project.group.ci_variables_for(git_ref, project) end def secret_project_variables(environment: persisted_environment) - project.ci_variables_for(ref: ref, environment: environment) + project.ci_variables_for(ref: git_ref, environment: environment) end def steps |