From 25bc1a6fa037daba21e3c918d93fb24fc469d0ee Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 13 Jul 2026 18:58:44 +0200 Subject: [PATCH 1/3] Clarify release lookup error handling --- .../wpmreleasetoolkit/helper/github_helper.rb | 2 ++ spec/github_helper_spec.rb | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb index dc072b3b1..d6472e6c8 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb @@ -254,6 +254,8 @@ def find_release(repository:, version:) def release_for_tag(repository:, version:) client.release_for_tag(repository, version) rescue Octokit::NotFound + # A 404 only means the fallback did not find a published release. + # Other API errors should be surfaced. nil end diff --git a/spec/github_helper_spec.rb b/spec/github_helper_spec.rb index 31c6fdf47..90e4e7ede 100644 --- a/spec/github_helper_spec.rb +++ b/spec/github_helper_spec.rb @@ -745,6 +745,20 @@ def create_release(is_draft:, assets: [], name: nil) end end + it 'does not hide unexpected direct release lookup errors' do + allow(client).to receive(:releases).with(test_repo).and_return([]) + allow(client).to receive(:release_for_tag).with(test_repo, test_version).and_raise(Octokit::TooManyRequests) + + with_tmp_file(named: 'test-app.zip') do |file_path| + expect(client).not_to receive(:release_assets) + expect(client).not_to receive(:upload_asset) + + expect do + upload_release_assets(assets: [file_path]) + end.to raise_error(Octokit::TooManyRequests) + end + end + it 'uploads one asset to the existing release' do with_tmp_file(named: 'test-app.zip') do |file_path| expect(client).to receive(:upload_asset).with(release_url, file_path, { content_type: 'application/octet-stream' }) From 60dbfb3a2b57d410fdbadbc4f331088fecc7187c Mon Sep 17 00:00:00 2001 From: Ian Maia Date: Mon, 13 Jul 2026 18:59:37 +0200 Subject: [PATCH 2/3] Add changelog entry for release lookup follow-up --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa2ed8d72..2b0424005 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ _None_ ### Internal Changes +- Added regression coverage for `upload_github_release_assets` direct release lookup errors. [#755] - Centralized `.strings` duplicate-key detection behind `StringsFileValidationHelper.scan_for_duplicate_keys`, returning a `[:scanned | :unsupported_format | :unscannable, payload]` tri-state that callers can map to their own warn-and-skip vs fail-closed policy. [#741] - `L10nHelper.strings_file_type` and `StringsFileValidationHelper.scan_for_duplicate_keys` accept `assume_valid:` to skip a redundant `plutil -lint` when the caller has already parsed the file. [#741] From ca54c747c0a34c879768169bec6fedbdc337f8e0 Mon Sep 17 00:00:00 2001 From: "Ian G. Maia" Date: Mon, 13 Jul 2026 19:33:06 +0200 Subject: [PATCH 3/3] Update comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb index d6472e6c8..da4160295 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb @@ -254,7 +254,7 @@ def find_release(repository:, version:) def release_for_tag(repository:, version:) client.release_for_tag(repository, version) rescue Octokit::NotFound - # A 404 only means the fallback did not find a published release. + # A 404 only means the fallback did not find a release for this tag. # Other API errors should be surfaced. nil end