-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[app store connect] cleanup token creation code across entire project #18186
[app store connect] cleanup token creation code across entire project #18186
Conversation
@@ -2,10 +2,6 @@ | |||
|
|||
module Fastlane | |||
module Actions | |||
module SharedValues | |||
APP_STORE_CONNECT_API_KEY = :APP_STORE_CONNECT_API_KEY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really want to break API for users who might depend on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was unsure about this. I didn’t super want to keep it but I also didn’t want to break 😬 I can put it back in!
match/lib/match/importer.rb
Outdated
@api_token ||= Spaceship::ConnectAPI::Token.create(params[:api_key]) if params[:api_key] | ||
@api_token ||= Spaceship::ConnectAPI::Token.from_json_file(params[:api_key_path]) if params[:api_key_path] | ||
return @api_token | ||
api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this class (and a few below) we are not consistent with the way we log about wether we reuse or create a token.
For example the implementation in fastlane/lib/fastlane/actions/set_changelog.rb
treats them differently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match
has a bunch of tools that are only called from the CLI as sub commands. So this one should never really have token to reuse already 🤷♂️ But I can make these look and reuse a token if there is an existing one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, I read your original comment wrong 😛 I will make this change!
28cf78b
to
5b32701
Compare
a1a9881
to
1cec4b5
Compare
@@ -13,7 +13,6 @@ def self.run(params) | |||
|
|||
begin | |||
Cert.config = params # we alread have the finished config | |||
Cert.config[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore because Cert
will look for existing Spaceship::ConnectAPI.client
now and use that
@@ -10,7 +10,6 @@ def self.run(params) | |||
require 'match' | |||
|
|||
params.load_configuration_file("Matchfile") | |||
params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore because Match
will look for existing Spaceship::ConnectAPI.client
now and use that
if values[:api_key_path].nil? | ||
values[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed anymore because Pilot
will look for existing Spaceship::ConnectAPI.client
now and use that
@lacostej I think this is ready for a re-review (finally 😅) |
…asc-token-creation-in-each-action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations! 🎉 This was released as part of fastlane 2.184.0 🚀
Motivation and Context
Adds on to #18173
Partly resolves #18145
Description
app_store_connect_api_key
actionSharedValues::APP_STORE_CONNECT_API_KEY
Spaceship::ConnectAPI.token