Skip to content

Commit 96984c8

Browse files
authored
Fix git log to work with current expected working directory (#35)
1 parent f33f0da commit 96984c8

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

lib/fastlane/plugin/ddg_apple_automation/helper/asana_helper.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def self.update_asana_tasks_for_internal_release(params)
224224
UI.success("Latest public release: #{latest_public_release.tag_name}")
225225

226226
UI.message("Extracting task IDs from git log since #{latest_public_release.tag_name} release")
227-
task_ids = get_task_ids_from_git_log(params[:platform], latest_public_release.tag_name)
227+
task_ids = get_task_ids_from_git_log(latest_public_release.tag_name)
228228
UI.success("#{task_ids.count} task(s) found.")
229229

230230
UI.message("Fetching release notes from Asana release task (#{asana_task_url(params[:release_task_id])})")
@@ -411,10 +411,8 @@ def self.sanitize_asana_html_notes(content)
411411
.gsub(%r{<br\s*/?>}, "\n") # replace <br> tags with newlines
412412
end
413413

414-
def self.get_task_ids_from_git_log(platform, from_ref, to_ref = "HEAD")
415-
platform_paths = platform.downcase == "ios" ? ["iOS/", "BrowserServicesKit/"] : ["macOS/", "BrowserServicesKit/"]
416-
417-
git_log = `git log #{from_ref}..#{to_ref} -- #{platform_paths.join(' ')}`
414+
def self.get_task_ids_from_git_log(from_ref, to_ref = "HEAD")
415+
git_log = `git log #{from_ref}..#{to_ref} -- ./ ../BrowserServicesKit/`
418416

419417
git_log
420418
.gsub("\n", " ")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Fastlane
22
module DdgAppleAutomation
3-
VERSION = "2.0.1"
3+
VERSION = "2.0.2"
44
end
55
end

spec/asana_helper_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,16 +590,16 @@ def sanitize_asana_html_notes(content)
590590
Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f)
591591
LOG
592592

593-
allow(Fastlane::Helper::AsanaHelper).to receive(:`).with("git log v1.0.0..HEAD -- iOS/ BrowserServicesKit/").and_return(git_log)
593+
allow(Fastlane::Helper::AsanaHelper).to receive(:`).with("git log v1.0.0..HEAD -- ./ ../BrowserServicesKit/").and_return(git_log)
594594

595-
task_ids = Fastlane::Helper::AsanaHelper.get_task_ids_from_git_log("ios", "v1.0.0")
595+
task_ids = Fastlane::Helper::AsanaHelper.get_task_ids_from_git_log("v1.0.0")
596596
expect(task_ids).to eq(["1208700893044577", "1208589738926535", "1208804405760977"])
597597
end
598598

599599
it "returns an empty array if no task IDs are found" do
600-
allow(Fastlane::Helper::AsanaHelper).to receive(:`).with("git log v1.0.0..HEAD -- macOS/ BrowserServicesKit/").and_return("No tasks here.")
600+
allow(Fastlane::Helper::AsanaHelper).to receive(:`).with("git log v1.0.0..HEAD -- ./ ../BrowserServicesKit/").and_return("No tasks here.")
601601

602-
task_ids = Fastlane::Helper::AsanaHelper.get_task_ids_from_git_log("macos", "v1.0.0")
602+
task_ids = Fastlane::Helper::AsanaHelper.get_task_ids_from_git_log("v1.0.0")
603603
expect(task_ids).to eq([])
604604
end
605605
end

0 commit comments

Comments
 (0)