diff --git a/lib/fastlane/plugin/ddg_apple_automation/actions/asana_log_message_action.rb b/lib/fastlane/plugin/ddg_apple_automation/actions/asana_log_message_action.rb index 83d8fed..9a12a92 100644 --- a/lib/fastlane/plugin/ddg_apple_automation/actions/asana_log_message_action.rb +++ b/lib/fastlane/plugin/ddg_apple_automation/actions/asana_log_message_action.rb @@ -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) @@ -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) @@ -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 diff --git a/spec/asana_log_message_spec.rb b/spec/asana_log_message_spec.rb index f792662..43433e8 100644 --- a/spec/asana_log_message_spec.rb +++ b/spec/asana_log_message_spec.rb @@ -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, @@ -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 @@ -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