Skip to content

Commit

Permalink
Use make_asana_client everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Oct 2, 2024
1 parent b71c379 commit 1d48310
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ def self.create_subtask(token:, task_id:, assignee_id:, task_name:, notes: nil,
subtask_options[:notes] = notes unless notes.nil?
subtask_options[:html_notes] = html_notes unless html_notes.nil?

asana_client = Asana::Client.new do |c|
c.authentication(:access_token, token)
c.default_headers("Asana-Enable" => "new_goal_memberships,new_user_task_lists")
end
asana_client = Helper::AsanaHelper.make_asana_client(token)
asana_client.tasks.create_subtask_for_task(**subtask_options)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ def self.validate_semver(version)
end

def self.find_release_task(version, asana_access_token)
asana_client = Asana::Client.new do |c|
c.authentication(:access_token, asana_access_token)
c.default_headers("Asana-Enable" => "new_goal_memberships,new_user_task_lists")
end

asana_client = Helper::AsanaHelper.make_asana_client(asana_access_token)
release_task_id = nil

begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ def self.run(params)
asana_user_id = find_asana_user_id(params)
args[:assignee_id] = asana_user_id

asana_client = Asana::Client.new do |c|
c.authentication(:access_token, token)
c.default_headers("Asana-Enable" => "new_goal_memberships,new_user_task_lists")
end
asana_client = Helper::AsanaHelper.make_asana_client(token)

begin
UI.important("Adding user #{asana_user_id} as collaborator on release task's 'Automation' subtask")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ def self.create_release_task(platform, version, assignee_id, asana_access_token)
task_id
end

# Updates asana tasks for a release
#
# @param github_token [String] GitHub token
# @param asana_access_token [String] Asana access token
# @param release_task_id [String] Asana access token
# @param validation_section_id [String] ID of the 'Validation' section in the Asana project
# @param version [String] version number
#
def self.update_asana_tasks_for_release(params)
UI.message("Checking latest public release in GitHub")
client = Octokit::Client.new(access_token: params[:github_token])
Expand Down

0 comments on commit 1d48310

Please sign in to comment.