From 46209354ba993b83e4042be98754567e1f5ecdb6 Mon Sep 17 00:00:00 2001 From: Nathan Wong Date: Fri, 26 Apr 2024 15:45:49 +0100 Subject: [PATCH 1/4] Test: Support multiple CDNs --- lib/cocoapods-core/cdn_source.rb | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/cocoapods-core/cdn_source.rb b/lib/cocoapods-core/cdn_source.rb index 9345a9fe..2b868226 100644 --- a/lib/cocoapods-core/cdn_source.rb +++ b/lib/cocoapods-core/cdn_source.rb @@ -282,14 +282,19 @@ def ensure_versions_file_loaded(fragment) # We use those because you can't get a directory listing from a CDN. index_file_name = index_file_name_for_fragment(fragment) download_file(index_file_name) - versions_raw = local_file(index_file_name, &:to_a).map(&:chomp) - @version_arrays_by_fragment_by_name[fragment] = versions_raw.reduce({}) do |hash, row| - row = row.split('/') - pod = row.shift - versions = row - - hash[pod] = versions - hash + file_okay = local_file_okay?(index_file_name) + if file_okay + versions_raw = local_file(index_file_name, &:to_a).map(&:chomp) + @version_arrays_by_fragment_by_name[fragment] = versions_raw.reduce({}) do |hash, row| + row = row.split('/') + pod = row.shift + versions = row + + hash[pod] = versions + hash + end + else + debug "CDN: #{name} Relative path: #{partial_url} not available in this source set" end end From 3d4a0ad16a2355a472eaca3da73a9992c480ad46 Mon Sep 17 00:00:00 2001 From: Marco Santarelli Date: Wed, 29 May 2024 14:09:58 +0200 Subject: [PATCH 2/4] Fix failing tests. --- lib/cocoapods-core/cdn_source.rb | 4 ++-- spec/cdn_source_spec.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/cocoapods-core/cdn_source.rb b/lib/cocoapods-core/cdn_source.rb index 2b868226..26033168 100644 --- a/lib/cocoapods-core/cdn_source.rb +++ b/lib/cocoapods-core/cdn_source.rb @@ -116,7 +116,7 @@ def versions(name) pod_path_actual = pod_path(name) pod_path_relative = relative_pod_path(name) - return nil if @version_arrays_by_fragment_by_name[fragment][name].nil? + return nil if @version_arrays_by_fragment_by_name[fragment].nil? || @version_arrays_by_fragment_by_name[fragment][name].nil? concurrent_requests_catching_errors do loaders = [] @@ -294,7 +294,7 @@ def ensure_versions_file_loaded(fragment) hash end else - debug "CDN: #{name} Relative path: #{partial_url} not available in this source set" + debug "CDN: #{name} Relative path: #{index_file_name} not available in this source set" end end diff --git a/spec/cdn_source_spec.rb b/spec/cdn_source_spec.rb index af7fe4da..b0f43496 100644 --- a/spec/cdn_source_spec.rb +++ b/spec/cdn_source_spec.rb @@ -424,6 +424,7 @@ def typhoeus_non_http_response_future(code) end it 'matches case' do + @source.expects(:debug).with { |cmd| cmd =~ /CDN: #{@source.name} Relative path: all_pods_versions_9_5_b\.txt not available in this source set/ } @source.expects(:debug).with { |cmd| cmd =~ /CDN: #{@source.name} Relative path downloaded: all_pods_versions_9_5_b\.txt, save ETag:/ } @source.search('bEacoNKIT').should.be.nil? end From 39aaae5e0d76cc22827eb53c1915e011765f9a5e Mon Sep 17 00:00:00 2001 From: Marco Santarelli Date: Fri, 19 Jul 2024 10:21:37 +0200 Subject: [PATCH 3/4] Update lib/cocoapods-core/cdn_source.rb Accept @segiddings suggestion Co-authored-by: Samuel Giddins --- lib/cocoapods-core/cdn_source.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cocoapods-core/cdn_source.rb b/lib/cocoapods-core/cdn_source.rb index 26033168..a24cb9a0 100644 --- a/lib/cocoapods-core/cdn_source.rb +++ b/lib/cocoapods-core/cdn_source.rb @@ -116,7 +116,7 @@ def versions(name) pod_path_actual = pod_path(name) pod_path_relative = relative_pod_path(name) - return nil if @version_arrays_by_fragment_by_name[fragment].nil? || @version_arrays_by_fragment_by_name[fragment][name].nil? + return nil if @version_arrays_by_fragment_by_name.dig(fragment, name).nil? concurrent_requests_catching_errors do loaders = [] From fd71c2168b34e081c2653e46e59be752ea8a719c Mon Sep 17 00:00:00 2001 From: Marco Santarelli Date: Mon, 22 Jul 2024 14:18:29 +0200 Subject: [PATCH 4/4] https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/ MacOS 11 is removed from GHA supported stack, updating to a supported version. --- .github/workflows/Specs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Specs.yml b/.github/workflows/Specs.yml index 32c74e4e..ae749e52 100644 --- a/.github/workflows/Specs.yml +++ b/.github/workflows/Specs.yml @@ -8,7 +8,7 @@ jobs: os: [ubuntu-20.04] ruby: [2.6, 2.7, 3.0.0, 3.2.2] include: - - os: macos-11 + - os: macos-13 ruby: system name: ${{ matrix.os }} / Ruby ${{ matrix.ruby }}