Skip to content

Commit

Permalink
Merge remote-tracking branch 'fastlane/master' into replace-slack-not…
Browse files Browse the repository at this point in the history
…ifier
  • Loading branch information
ainame committed Apr 30, 2021
2 parents 7a006b5 + 39abc01 commit c58d9cd
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ def self.run(params)
require 'tmpdir'

find_binary_path(params)
find_gsp_path(params)
find_api_token(params)
unless params[:app_id]
find_gsp_path(params)
find_api_token(params)
end

if !params[:app_id] && !params[:gsp_path] && !params[:api_token]
UI.user_error!('Either Firebase Crashlytics App ID, path to GoogleService-Info.plist or legacy Fabric API key must be given.')
Expand Down
8 changes: 4 additions & 4 deletions fastlane_core/lib/fastlane_core/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ def self.xcode_version
@xcode_version
end

# @return true if Xcode version is higher than 8.3
# @return true if installed Xcode version is 'greater than or equal to' the input parameter version
def self.xcode_at_least?(version)
FastlaneCore::UI.user_error!("Unable to locate Xcode. Please make sure to have Xcode installed on your machine") if xcode_version.nil?
v = xcode_version
Gem::Version.new(v) >= Gem::Version.new(version)
installed_xcode_version = xcode_version
UI.user_error!("Unable to locate Xcode. Please make sure to have Xcode installed on your machine") if installed_xcode_version.nil?
Gem::Version.new(installed_xcode_version) >= Gem::Version.new(version)
end

# iTMSTransporter
Expand Down
1 change: 0 additions & 1 deletion pilot/lib/pilot/tester_exporter.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'spaceship/tunes/application'
require_relative 'tester_util'
require_relative 'module'
require_relative 'manager'

Expand Down
1 change: 0 additions & 1 deletion pilot/lib/pilot/tester_manager.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'terminal-table'

require_relative 'manager'
require_relative 'tester_util'

module Pilot
class TesterManager < Manager
Expand Down
Empty file removed pilot/lib/pilot/tester_util.rb
Empty file.
6 changes: 6 additions & 0 deletions spaceship/lib/spaceship/connect_api/models/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ def fetch_all_devices(client: nil, filter: {}, includes: nil, sort: nil)
return resps.flat_map(&:to_models)
end

def fetch_all_certificates(client: nil, filter: {}, includes: nil, sort: nil)
client ||= Spaceship::ConnectAPI
resps = client.get_certificates(profile_id: id, filter: filter, includes: includes).all_pages
return resps.flat_map(&:to_models)
end

def delete!(client: nil)
client ||= Spaceship::ConnectAPI
return client.delete_profile(profile_id: id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ def delete_bundle_id_capability(bundle_id_capability_id:)
# certificates
#

def get_certificates(filter: {}, includes: nil, limit: nil, sort: nil)
def get_certificates(profile_id: nil, filter: {}, includes: nil, limit: nil, sort: nil)
params = provisioning_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)
provisioning_request_client.get("certificates", params)
if profile_id.nil?
provisioning_request_client.get("certificates", params)
else
provisioning_request_client.get("profiles/#{profile_id}/certificates", params)
end
end

def get_certificate(certificate_id: nil, includes: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ def test_request_body(url, body)
client.get_certificates
end
end

context 'get_certificates_for_profile' do
let(:path) { "profiles/123456789/certificates" }

it 'succeeds' do
params = {}
req_mock = test_request_body(path, params)
expect(client).to receive(:request).with(:post).and_yield(req_mock)
client.get_certificates(profile_id: '123456789')
end
end
end

describe "devices" do
Expand Down

0 comments on commit c58d9cd

Please sign in to comment.