Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 release for this tag.
# Other API errors should be surfaced.
nil
end

Expand Down
14 changes: 14 additions & 0 deletions spec/github_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
Expand Down