Skip to content

Action firebase_app_distribution_get_latest_release considers createTime instead of buildVersion #390

@vini-coelho

Description

@vini-coelho

Issue Description

firebase_app_distribution_get_latest_release implements list_project_app_releases from Google API's FirebaseappdistributionV1, passing page size 1, as shown on the snippet below:

def self.run(params)
init_google_api_client(params[:debug])
client = Google::Apis::FirebaseappdistributionV1::FirebaseAppDistributionService.new
client.authorization = get_authorization(params[:service_credentials_file], params[:firebase_cli_token], params[:service_credentials_json_data], params[:debug])
app_id = app_id_from_params(params)
UI.message("⏳ Fetching latest release for app #{app_id}...")
parent = app_name_from_app_id(app_id)
begin
releases = client.list_project_app_releases(parent, page_size: 1).releases
rescue Google::Apis::Error => err
if err.status_code.to_i == 404
UI.user_error!("#{ErrorMessage::INVALID_APP_ID}: #{app_id}")
else
UI.crash!(err)
end
end

This by default returns the latest release by createTime. However, considering the context of mobile app releases versioning standards, the buildVersion parameter would be more consistent to determine which release is in fact the latest (build version number for a new release should always be greater than the previous, as enforced by public app stores - Google Play, App Store).

My suggestion is to either change this implementation to consider buildVersion as parameter to find the most recent release, or add an optional parameter to firebase_app_distribution_get_latest_release, so the developer can select which parameter to use.

Environment
Library Version
fastlane 2.228.0
fastlane-plugin-firebase_app_distribution v0.10.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions