Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp committed Sep 6, 2024
1 parent 889e719 commit bf42f3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.run(params)
task_url = params[:task_url]
template_name = params[:template_name]
comment = params[:comment]
is_scheduled_release = params[:is_scheduled_release] || false
is_scheduled_release = params[:is_scheduled_release]
github_handle = params[:github_handle]

automation_subtask_id = AsanaGetReleaseAutomationSubtaskIdAction.run(task_url: task_url, asana_access_token: token)
Expand All @@ -39,7 +39,7 @@ def self.run(params)
begin
asana_client.tasks.add_followers_for_task(task_gid: automation_subtask_id, followers: [assignee_id])
rescue StandardError => e
UI.user_error!("Failed to add a collaborator to the release task: #{e}")
UI.user_error!("Failed to add user #{assignee_id} as collaborator on task #{automation_subtask_id}: #{e}")
end

AsanaAddCommentAction.run(task_id: automation_subtask_id, comment: comment, template_name: template_name, asana_access_token: token)
Expand Down Expand Up @@ -84,7 +84,8 @@ def self.available_options
FastlaneCore::ConfigItem.new(key: :is_scheduled_release,
description: "Indicates whether the release was scheduled or started manually",
optional: true,
type: Boolean)
type: Boolean,
default_value: false)
]
end

Expand Down
6 changes: 3 additions & 3 deletions spec/asana_log_message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
allow(Fastlane::Actions::AsanaAddCommentAction).to receive(:run)
end

it "does extract assignee id from release task when is scheduled release" do
it "extracts assignee id from release task when is scheduled release" do
expect(Fastlane::Actions::AsanaExtractTaskIdAction).to receive(:run).with(task_url: task_url)
expect(Fastlane::Actions::AsanaExtractTaskAssigneeAction).to receive(:run).with(
task_id: task_id,
Expand All @@ -30,7 +30,7 @@
test_action(task_url: task_url, comment: comment, is_scheduled_release: true)
end

it "does takes assignee id from github handle when is manual release" do
it "takes assignee id from github handle when is manual release" do
expect(Fastlane::Actions::AsanaGetUserIdForGithubHandleAction).to receive(:run).with(
github_handle: github_handle,
asana_access_token: anything
Expand All @@ -43,7 +43,7 @@
test_action(task_url: task_url, comment: comment, is_scheduled_release: false, github_handle: "")
end

it "adds a assignee as a follower to the automation task" do
it "adds an assignee as follower to the automation task" do
expect(@asana_client_tasks).to receive(:add_followers_for_task).with(task_gid: automation_subtask_id, followers: [assignee_id])
test_action(task_url: task_url, comment: comment, is_scheduled_release: false, github_handle: github_handle)
end
Expand Down

0 comments on commit bf42f3f

Please sign in to comment.