ci: add early fastlane version check#613
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new :verify_version lane to the Android Fastlane configuration, designed to prevent version code collisions by checking existing codes on Google Play. The review feedback suggests improving CI compatibility by allowing the json_key_path to fall back to an environment variable and expanding the collision check to include all active tracks (production, beta, and alpha) instead of only the internal track to ensure global uniqueness.
| platform :android do | ||
| desc "Verify that the version code doesn't collide with existing version" | ||
| lane :verify_version do |options| | ||
| json_key_path = options[:json_key] |
There was a problem hiding this comment.
The json_key_path should fall back to the GOOGLE_PLAY_JSON_KEY environment variable for consistency with the deploy_internal lane. This ensures the lane works correctly in CI environments where the service account key is typically provided via environment variables rather than explicit parameters.
json_key_path = options[:json_key] || ENV["GOOGLE_PLAY_JSON_KEY"]
|
|
||
| version_code = version_code.to_i | ||
|
|
||
| tracks_to_check = ['internal'] |
There was a problem hiding this comment.
Checking only the internal track is insufficient because Google Play requires version codes to be unique and generally increasing across all tracks. If a higher version code already exists in production, beta, or alpha, this check will pass but the actual deployment will fail later. It is safer to check all active tracks to ensure the version code is truly unique.
tracks_to_check = ['production', 'beta', 'alpha', 'internal']
No description provided.