summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-16 15:18:40 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-16 15:18:40 +0000
commitab1e86ea87439843ba5d278eced1dddff7d3f5a5 (patch)
tree15751b4199761a350ba75723deb37f58f57b3851 /app/models
parent9bf0c33b634f078e3b6419ec6d59297ebde34cc1 (diff)
downloadgitlab-ce-ab1e86ea87439843ba5d278eced1dddff7d3f5a5.tar.gz
Add latest changes from gitlab-org/gitlab@12-5-stable-ee
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/build.rb2
-rw-r--r--app/models/project_services/asana_service.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 59a2c09bd28..49c5b67d600 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -53,7 +53,7 @@ module Ci
has_one :runner_session, class_name: 'Ci::BuildRunnerSession', validate: true, inverse_of: :build
- accepts_nested_attributes_for :runner_session
+ accepts_nested_attributes_for :runner_session, update_only: true
accepts_nested_attributes_for :job_variables
delegate :url, to: :runner_session, prefix: true, allow_nil: true
diff --git a/app/models/project_services/asana_service.rb b/app/models/project_services/asana_service.rb
index 3e28dc23782..757b2f17fb9 100644
--- a/app/models/project_services/asana_service.rb
+++ b/app/models/project_services/asana_service.rb
@@ -81,12 +81,12 @@ http://app.asana.com/-/account_api'
def check_commit(message, push_msg)
# matches either:
# - #1234
- # - https://app.asana.com/0/0/1234
+ # - https://app.asana.com/0/{project_gid}/{task_gid}
# optionally preceded with:
# - fix/ed/es/ing
# - close/s/d
# - closing
- issue_finder = %r{(fix\w*|clos[ei]\w*+)?\W*(?:https://app\.asana\.com/\d+/\d+/(\d+)|#(\d+))}i
+ issue_finder = %r{(fix\w*|clos[ei]\w*+)?\W*(?:https://app\.asana\.com/\d+/\w+/(\w+)|#(\w+))}i
message.scan(issue_finder).each do |tuple|
# tuple will be
@@ -94,7 +94,7 @@ http://app.asana.com/-/account_api'
taskid = tuple[2] || tuple[1]
begin
- task = Asana::Task.find_by_id(client, taskid)
+ task = Asana::Resources::Task.find_by_id(client, taskid)
task.add_comment(text: "#{push_msg} #{message}")
if tuple[0]