Skip to content
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

Prefer Google auth library and generated API client for list releases action #307

Merged
merged 5 commits into from Jul 18, 2023

Conversation

lfkellogg
Copy link
Collaborator

@lfkellogg lfkellogg commented May 3, 2023

Use Google Auth library for application default credentials and use generated API client instead of hand rolled client in the list releases action.

UI.success("✅ Latest release fetched successfully. Returning release and setting Actions.lane_context[SharedValues::FIREBASE_APP_DISTRO_LATEST_RELEASE].")
end
Actions.lane_context[SharedValues::FIREBASE_APP_DISTRO_LATEST_RELEASE] = latest_release
return latest_release
end

def self.map_release_hash(release)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this for backwards compatibility, because other fastlane plugins might rely on camelCase instead of snake_case?

Or is this temporary until you update the rest of the code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For backwards compatibility

def refresh_token_from_firebase_tools
config_path = format_config_path
if File.exist?(config_path)
begin
firebase_tools_tokens = JSON.parse(File.read(config_path))['tokens']
if firebase_tools_tokens.nil?
UI.user_error!(ErrorMessage::EMPTY_TOKENS_FIELD)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might move this to a separate PR. I realized that this isn't actually an exceptional case. If they log out of the Firebase CLI (at least the version I'm using), that file will still exist it just won't have a tokens field. In that case we just want to return nil and continue.

Copy link
Collaborator

@tagboola tagboola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏿👏🏿👏🏿

Are you going to iteratively make the changes i.e. submit this one fix first and keep going or include all the changes in one big change?

@lfkellogg
Copy link
Collaborator Author

👏🏿👏🏿👏🏿

Are you going to iteratively make the changes i.e. submit this one fix first and keep going or include all the changes in one big change?

Either. If we want to collaborate on this then I think splitting it up makes sense. The only downside of that is that we'd probably want to temporarily support both paths in the auth client. In this PR I am breaking the old path.

@tagboola tagboola linked an issue Jul 18, 2023 that may be closed by this pull request
@tagboola tagboola changed the title WIP - use generated API client Prefer Google auth library and generated API client for list releases action Jul 18, 2023
@tagboola tagboola merged commit a1c8d42 into master Jul 18, 2023
3 checks passed
@tagboola tagboola deleted the lk/api-client branch July 18, 2023 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use official, auto-generated Google API client
3 participants