Skip to content

Commit 3b70c1e

Browse files
committed
Add step parameter in status reporting for Instabug
1 parent 2b6414d commit 3b70c1e

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

lib/fastlane/plugin/instabug_stores_upload/actions/instabug_upload_to_app_store_action.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def self.run(params)
2121
Helper::InstabugStoresUploadHelper.report_status(
2222
branch_name: branch_name,
2323
api_key: instabug_api_key,
24-
status: "inprogress"
24+
status: "inprogress",
25+
step: "upload_to_the_store"
2526
)
2627

2728
# Execute the actual upload to App Store
@@ -31,7 +32,8 @@ def self.run(params)
3132
Helper::InstabugStoresUploadHelper.report_status(
3233
branch_name: branch_name,
3334
api_key: instabug_api_key,
34-
status: "success"
35+
status: "success",
36+
step: "upload_to_the_store"
3537
)
3638

3739
UI.success("App Store upload completed successfully!")
@@ -43,7 +45,8 @@ def self.run(params)
4345
Helper::InstabugStoresUploadHelper.report_status(
4446
branch_name: branch_name,
4547
api_key: instabug_api_key,
46-
status: "failure"
48+
status: "failure",
49+
step: "upload_to_the_store"
4750
)
4851
raise e
4952
end

lib/fastlane/plugin/instabug_stores_upload/actions/instabug_upload_to_play_store_action.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def self.run(params)
2121
Helper::InstabugStoresUploadHelper.report_status(
2222
branch_name: branch_name,
2323
api_key: instabug_api_key,
24-
status: "inprogress"
24+
status: "inprogress",
25+
step: "upload_to_the_store"
2526
)
2627

2728
# Execute the actual upload to Play Store
@@ -31,21 +32,23 @@ def self.run(params)
3132
Helper::InstabugStoresUploadHelper.report_status(
3233
branch_name: branch_name,
3334
api_key: instabug_api_key,
34-
status: "success"
35+
status: "success",
36+
step: "upload_to_the_store"
3537
)
3638

3739
UI.success("Play Store upload completed successfully!")
3840
result
3941

4042
rescue => e
43+
UI.error("Play Store upload failed: #{e.message}")
44+
4145
# Report upload failure to Instabug
4246
Helper::InstabugStoresUploadHelper.report_status(
4347
branch_name: branch_name,
4448
api_key: instabug_api_key,
45-
status: "failure"
49+
status: "failure",
50+
step: "upload_to_the_store"
4651
)
47-
48-
UI.error("Play Store upload failed: #{e.message}")
4952
raise e
5053
end
5154
end

lib/fastlane/plugin/instabug_stores_upload/helper/instabug_stores_upload_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ def self.show_message
1515
UI.message("Hello from the instabug_stores_upload plugin helper!")
1616
end
1717

18-
def self.report_status(branch_name:, api_key:, status:)
18+
def self.report_status(branch_name:, api_key:, status:, step:)
1919
return unless branch_name.start_with?('crash-fix/instabug-crash-')
2020

21-
UI.message("📡 Reporting upload status to Instabug for #{branch_name}/#{status}")
21+
UI.message("📡 Reporting #{step} status to Instabug for #{branch_name}/#{status}")
2222

2323
make_api_request(
2424
branch_name: branch_name,
2525
status: status,
2626
api_key: api_key,
27-
step: "upload_to_the_store"
27+
step: step
2828
)
2929
end
3030

0 commit comments

Comments
 (0)