-
Notifications
You must be signed in to change notification settings - Fork 671
refactor(fastlane): Adapted the Fastlane configurations from the KMP Project Template. #2579
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
base: development
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds a centralized FastlaneConfig::ProjectConfig module and updates Fastlane configs to source Android/iOS settings from it. Introduces an extract_config utility, updates AppFile and fastlane-config/* files to use ProjectConfig, and reorganizes iOS lanes in Fastfile (new helper lanes and public lanes for build/sign/beta/release). Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer/CI
participant Fastlane as Fastfile Lanes
participant Config as ProjectConfig
participant Match as match (Certs/Profiles)
participant Xcode as Xcode / Gradle Build
participant ASC as App Store Connect
participant Firebase as Firebase / Google Play
Dev->>Fastlane: trigger lane (beta/release/deploy_on_firebase)
Fastlane->>Config: read platform build & firebase config
Fastlane->>Match: fetch certificates & provisioning
Match-->>Fastlane: certificates & profiles
Fastlane->>Xcode: build & sign (uses configs)
Xcode-->>Fastlane: artifact (IPA/AAB/APK)
Fastlane->>ASC: upload to TestFlight/App Store (beta/release)
Fastlane->>Firebase: upload to Firebase/Play (deploy_on_firebase)
ASC-->>Dev: upload status
Firebase-->>Dev: upload status
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@fastlane-config/project_config.rb`:
- Around line 34-39: The keystore block in project_config.rb contains hardcoded
credentials (keys: keystore, file, password, key_alias, key_password); replace
the plaintext passwords with environment variables and/or a secrets manager
(e.g. use ENV['KEYSTORE_PASSWORD'] and ENV['KEY_PASSWORD'] and ENV['KEY_ALIAS']
for the corresponding values referenced in the keystore hash), ensure the
fastlane code accesses these ENV vars instead of literals, add a clear error or
fail-fast check in the initialization (e.g., validate ENV presence and
raise/exit with a message if missing), and update project CI/README to document
the required environment variables or secret names so the keystore values are
provided securely at runtime.
In `@fastlane/FastFile`:
- Around line 429-435: In the lane :generateReleaseNote remove the unused local
variable branchName (the backtick call `git rev-parse --abbrev-ref
HEAD`.chomp()) since it's assigned but never referenced; update the
generateReleaseNote lane body to simply call changelog_from_git_commits and
return releaseNotes (or return the result directly) so there is no dead
assignment left in the generateReleaseNote lane.
🧹 Nitpick comments (3)
fastlane-config/project_config.rb (1)
134-139: Add trailing comma and consider path resolution robustness.Two issues:
- RuboCop flags a missing trailing comma after the last array element (line 138).
- The path resolution
File.join(Dir.pwd, '..', file)assumes execution from thefastlanedirectory, which may not always be the case.♻️ Proposed fix
required_files = [ ANDROID[:play_store_json_key], SHARED[:firebase_service_credentials], IOS[:app_store_connect][:key_filepath], - IOS[:code_signing][:match_git_private_key] + IOS[:code_signing][:match_git_private_key], ] - missing_files = required_files.reject { |file| File.exist?(File.join(Dir.pwd, '..', file)) } + project_root = File.expand_path('../..', __dir__) + missing_files = required_files.reject { |file| File.exist?(File.join(project_root, file)) }fastlane-config/ios_config.rb (1)
31-32: Minor: Inconsistent naming between config key and source.The key
app_rating_config_pathsources fromage_rating_config_path. While functionally correct, this naming inconsistency could cause confusion during maintenance.Consider aligning the naming:
- app_rating_config_path: ProjectConfig::IOS[:age_rating_config_path] + age_rating_config_path: ProjectConfig::IOS[:age_rating_config_path]Note: This would require updating references in
FastFile(line 550) as well.fastlane/FastFile (1)
461-497: Consider: Significant code duplication betweenbetaandreleaselanes.Both lanes share nearly identical setup logic (CI setup, API key loading, certificate fetching, version/build number incrementing). This duplication could be consolidated into a shared helper.
Based on learnings, since this is synced template code, this refactoring could be deferred to a follow-up issue. However, if you'd like, a shared
prepare_for_releasehelper could reduce ~30 lines of duplication:private_lane :prepare_for_release do |options| ios_config = FastlaneConfig::IosConfig::BUILD_CONFIG setup_ci_if_needed load_api_key(options) fetch_certificates_with_match(options.merge(match_type: "appstore")) increment_version_number( xcodeproj: ios_config[:project_path], version_number: ios_config[:version_number] ) latest_build_number = latest_testflight_build_number( app_identifier: options[:app_identifier] || ios_config[:app_identifier], api_key: Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] ) increment_build_number( xcodeproj: ios_config[:project_path], build_number: latest_build_number + 1 ) endAlso applies to: 499-538
| keystore: { | ||
| file: "release_keystore.keystore", | ||
| password: "mifos1234", | ||
| key_alias: "mifos", | ||
| key_password: "mifos1234" | ||
| }, |
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.
Critical: Hardcoded keystore credentials should use environment variables.
Storing plaintext passwords (mifos1234) in source code is a significant security risk, especially if this repository is public. These credentials should be sourced from environment variables or a secure secrets manager.
🔒 Proposed fix using environment variables
# Keystore configuration
keystore: {
file: "release_keystore.keystore",
- password: "mifos1234",
+ password: ENV['ANDROID_KEYSTORE_PASSWORD'] || UI.user_error!("ANDROID_KEYSTORE_PASSWORD not set"),
key_alias: "mifos",
- key_password: "mifos1234"
+ key_password: ENV['ANDROID_KEY_PASSWORD'] || UI.user_error!("ANDROID_KEY_PASSWORD not set")
},📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| keystore: { | |
| file: "release_keystore.keystore", | |
| password: "mifos1234", | |
| key_alias: "mifos", | |
| key_password: "mifos1234" | |
| }, | |
| keystore: { | |
| file: "release_keystore.keystore", | |
| password: ENV['ANDROID_KEYSTORE_PASSWORD'] || UI.user_error!("ANDROID_KEYSTORE_PASSWORD not set"), | |
| key_alias: "mifos", | |
| key_password: ENV['ANDROID_KEY_PASSWORD'] || UI.user_error!("ANDROID_KEY_PASSWORD not set") | |
| }, |
🤖 Prompt for AI Agents
In `@fastlane-config/project_config.rb` around lines 34 - 39, The keystore block
in project_config.rb contains hardcoded credentials (keys: keystore, file,
password, key_alias, key_password); replace the plaintext passwords with
environment variables and/or a secrets manager (e.g. use
ENV['KEYSTORE_PASSWORD'] and ENV['KEY_PASSWORD'] and ENV['KEY_ALIAS'] for the
corresponding values referenced in the keystore hash), ensure the fastlane code
accesses these ENV vars instead of literals, add a clear error or fail-fast
check in the initialization (e.g., validate ENV presence and raise/exit with a
message if missing), and update project CI/README to document the required
environment variables or secret names so the keystore values are provided
securely at runtime.
| lane :generateReleaseNote do | ||
| branchName = `git rev-parse --abbrev-ref HEAD`.chomp() | ||
| releaseNotes = changelog_from_git_commits( | ||
| commits_count: 1, | ||
| ) | ||
| releaseNotes | ||
| 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.
Remove unused variable branchName.
The variable branchName is assigned on line 430 but never used. This is dead code that should be removed.
🧹 Proposed fix
desc "Generate release notes"
lane :generateReleaseNote do
- branchName = `git rev-parse --abbrev-ref HEAD`.chomp()
releaseNotes = changelog_from_git_commits(
commits_count: 1,
)
releaseNotes
end📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| lane :generateReleaseNote do | |
| branchName = `git rev-parse --abbrev-ref HEAD`.chomp() | |
| releaseNotes = changelog_from_git_commits( | |
| commits_count: 1, | |
| ) | |
| releaseNotes | |
| end | |
| lane :generateReleaseNote do | |
| releaseNotes = changelog_from_git_commits( | |
| commits_count: 1, | |
| ) | |
| releaseNotes | |
| end |
🤖 Prompt for AI Agents
In `@fastlane/FastFile` around lines 429 - 435, In the lane :generateReleaseNote
remove the unused local variable branchName (the backtick call `git rev-parse
--abbrev-ref HEAD`.chomp()) since it's assigned but never referenced; update the
generateReleaseNote lane body to simply call changelog_from_git_commits and
return releaseNotes (or return the result directly) so there is no dead
assignment left in the generateReleaseNote lane.
|
@techsavvy185 Can you please tell me the steps you have taken to adapt the Fastlane configuration? |
|
@biplab1 So basically I took all the values from the existing android and iOS configs and put references to the actual values in the project config file and replaced the already existing values in the project config file. Although I am not sure if we need to replace other values as well, particularly about the iOS config values since it did not contain that many values before. |
|
@techsavvy185 There are some sections missing from FastFile compared to that of the KMP project template. |
|
@biplab1 Ok, I'll make those changes. |
|
@biplab1 I have made the required changes. Those parts were missing since they were merged into the KMP template yesterday. |
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.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
fastlane/FastFile (1)
31-42: Change assemble task to bundle task to generate AAB instead of APK.
bundleReleaseApksusestaskName: "assemble"which produces an APK file. The lane name and deployment pattern (compare todeployInternalat line 124 which correctly usestaskName: "bundleProd") indicate an AAB should be generated instead. Update totaskName: "bundle"ortaskName: "bundleRelease"to produce the correct artifact format.Proposed fix
buildAndSignApp( - taskName: "assemble", + taskName: "bundle", buildType: "Release", **signing_config )
🤖 Fix all issues with AI agents
In `@fastlane/FastFile`:
- Around line 448-454: The lanes build_signed_ios, beta, and release call
setup_ci_if_needed without forwarding the lane options, so overrides in
options[:ci_provider] are ignored; update those lanes (the lane definitions
named build_signed_ios, beta, and release) to call setup_ci_if_needed(options)
instead of setup_ci_if_needed so the helper receives the passed options and
respects ci_provider overrides.
- Around line 456-483: The deploy_on_firebase lane currently calls
increment_version without forwarding the firebase_app_id and serviceCredsFile
overrides, so update the deploy_on_firebase invocation of increment_version to
pass options[:firebase_app_id] and options[:serviceCredsFile] (or similarly
named params) through; then modify the increment_version lane to accept and use
those parameters (e.g., check for a passed appId and serviceCredsFile instead of
only using FastlaneConfig.get_firebase_config(:ios)) and use them when calling
firebase_app_distribution_get_latest_release so the appId and credentials used
come from the override rather than the default firebase_config.
| desc "Build Signed Ios application" | ||
| lane :build_signed_ios do |options| | ||
| setup_ci_if_needed | ||
| load_api_key(options) | ||
| fetch_certificates_with_match(options) | ||
| build_ios_project(options) | ||
| 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.
Pass options into setup_ci_if_needed.
The helper reads options[:ci_provider], but build_signed_ios, beta, and release call it without options, so overrides won’t be honored. Pass the options through.
♻️ Proposed fix
- setup_ci_if_needed
+ setup_ci_if_needed(options)- setup_ci_if_needed
+ setup_ci_if_needed(options)- setup_ci_if_needed
+ setup_ci_if_needed(options)Also applies to: 518-525, 620-622
🤖 Prompt for AI Agents
In `@fastlane/FastFile` around lines 448 - 454, The lanes build_signed_ios, beta,
and release call setup_ci_if_needed without forwarding the lane options, so
overrides in options[:ci_provider] are ignored; update those lanes (the lane
definitions named build_signed_ios, beta, and release) to call
setup_ci_if_needed(options) instead of setup_ci_if_needed so the helper receives
the passed options and respects ci_provider overrides.
| desc "Increment build number from latest Firebase release and set version number" | ||
| lane :increment_version do |options| | ||
| firebase_config = FastlaneConfig.get_firebase_config(:ios) | ||
| ios_config = FastlaneConfig::IosConfig::BUILD_CONFIG | ||
|
|
||
| # Get version from gradle - Firebase accepts full semantic version with pre-release identifiers | ||
| version = get_version_from_gradle(sanitize_for_appstore: false) | ||
|
|
||
| # Set version number to match Android version | ||
| increment_version_number( | ||
| xcodeproj: ios_config[:project_path], | ||
| version_number: version | ||
| ) | ||
|
|
||
| latest_release = firebase_app_distribution_get_latest_release( | ||
| app: firebase_config[:appId], | ||
| service_credentials_file: options[:serviceCredsFile] || firebase_config[:serviceCredsFile] | ||
| ) | ||
|
|
||
| increment_build_number( | ||
| xcodeproj: ios_config[:project_path], | ||
| build_number: latest_release[:buildVersion].to_i + 1 | ||
| if latest_release | ||
| increment_build_number( | ||
| xcodeproj: ios_config[:project_path], | ||
| build_number: latest_release[:buildVersion].to_i + 1 | ||
| ) | ||
| else | ||
| UI.important("⚠️ No existing Firebase release found. Skipping build number increment.") | ||
| end | ||
| 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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find the fastlane file
find . -name "FastFile" -o -name "fastlane" -type d | head -20Repository: openMF/android-client
Length of output: 186
🏁 Script executed:
#!/bin/bash
# Look for FastFile in fastlane directory
git ls-files | grep -i fastfile | head -20Repository: openMF/android-client
Length of output: 82
🏁 Script executed:
#!/bin/bash
# Get total lines and examine the relevant sections
wc -l fastlane/FastFileRepository: openMF/android-client
Length of output: 86
🏁 Script executed:
#!/bin/bash
# Read the code at lines 456-483 and surrounding context
sed -n '440,520p' fastlane/FastFileRepository: openMF/android-client
Length of output: 2760
🏁 Script executed:
#!/bin/bash
# Search for all call sites of increment_version
rg -n "increment_version\(" fastlane/FastFileRepository: openMF/android-client
Length of output: 144
🏁 Script executed:
#!/antml:thinking]
I need to verify all places where increment_version is called and check if the method signature supports appId parameter.Repository: openMF/android-client
Length of output: 106
🏁 Script executed:
#!/bin/bash
# Read the increment_version method definition (lines 456-490)
sed -n '456,490p' fastlane/FastFileRepository: openMF/android-client
Length of output: 1329
Firebase appId override must be passed to increment_version.
The deploy_on_firebase lane accepts firebase_app_id to override which Firebase app receives the build, but increment_version ignores this override and always queries the latest release from the default Firebase app. This causes incorrect build numbers when deploying to non-default Firebase apps.
Pass both the appId and serviceCredsFile overrides to increment_version, and update the method to use them:
Required changes
Update the increment_version call in deploy_on_firebase (line 499) to pass the overrides:
- increment_version(serviceCredsFile: firebase_config[:serviceCredsFile])
+ increment_version(
+ serviceCredsFile: options[:serviceCredsFile] || firebase_config[:serviceCredsFile],
+ appId: options[:firebase_app_id] || firebase_config[:appId]
+ )Update the increment_version method to use the passed appId (line 467):
latest_release = firebase_app_distribution_get_latest_release(
- app: firebase_config[:appId],
+ app: options[:appId] || firebase_config[:appId],
service_credentials_file: options[:serviceCredsFile] || firebase_config[:serviceCredsFile]
)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| desc "Increment build number from latest Firebase release and set version number" | |
| lane :increment_version do |options| | |
| firebase_config = FastlaneConfig.get_firebase_config(:ios) | |
| ios_config = FastlaneConfig::IosConfig::BUILD_CONFIG | |
| # Get version from gradle - Firebase accepts full semantic version with pre-release identifiers | |
| version = get_version_from_gradle(sanitize_for_appstore: false) | |
| # Set version number to match Android version | |
| increment_version_number( | |
| xcodeproj: ios_config[:project_path], | |
| version_number: version | |
| ) | |
| latest_release = firebase_app_distribution_get_latest_release( | |
| app: firebase_config[:appId], | |
| service_credentials_file: options[:serviceCredsFile] || firebase_config[:serviceCredsFile] | |
| ) | |
| increment_build_number( | |
| xcodeproj: ios_config[:project_path], | |
| build_number: latest_release[:buildVersion].to_i + 1 | |
| if latest_release | |
| increment_build_number( | |
| xcodeproj: ios_config[:project_path], | |
| build_number: latest_release[:buildVersion].to_i + 1 | |
| ) | |
| else | |
| UI.important("⚠️ No existing Firebase release found. Skipping build number increment.") | |
| end | |
| end | |
| desc "Increment build number from latest Firebase release and set version number" | |
| lane :increment_version do |options| | |
| firebase_config = FastlaneConfig.get_firebase_config(:ios) | |
| ios_config = FastlaneConfig::IosConfig::BUILD_CONFIG | |
| # Get version from gradle - Firebase accepts full semantic version with pre-release identifiers | |
| version = get_version_from_gradle(sanitize_for_appstore: false) | |
| # Set version number to match Android version | |
| increment_version_number( | |
| xcodeproj: ios_config[:project_path], | |
| version_number: version | |
| ) | |
| latest_release = firebase_app_distribution_get_latest_release( | |
| app: options[:appId] || firebase_config[:appId], | |
| service_credentials_file: options[:serviceCredsFile] || firebase_config[:serviceCredsFile] | |
| ) | |
| if latest_release | |
| increment_build_number( | |
| xcodeproj: ios_config[:project_path], | |
| build_number: latest_release[:buildVersion].to_i + 1 | |
| ) | |
| else | |
| UI.important("⚠️ No existing Firebase release found. Skipping build number increment.") | |
| end | |
| end |
🤖 Prompt for AI Agents
In `@fastlane/FastFile` around lines 456 - 483, The deploy_on_firebase lane
currently calls increment_version without forwarding the firebase_app_id and
serviceCredsFile overrides, so update the deploy_on_firebase invocation of
increment_version to pass options[:firebase_app_id] and
options[:serviceCredsFile] (or similarly named params) through; then modify the
increment_version lane to accept and use those parameters (e.g., check for a
passed appId and serviceCredsFile instead of only using
FastlaneConfig.get_firebase_config(:ios)) and use them when calling
firebase_app_distribution_get_latest_release so the appId and credentials used
come from the override rather than the default firebase_config.
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.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
fastlane/README.md (1)
117-165: Fix “iOS” capitalization and address MD003 heading-style lint.Line 117/125 uses “Ios”. Also markdownlint flags the new headings (Lines 119, 127, 135, 151, 159) for MD003; if lint is enforced, align heading style with the repo config or exclude this auto-generated file.
✏️ Suggested text fix
-Build Ios application +Build iOS application @@ -Build Signed Ios application +Build Signed iOS application
🤖 Fix all issues with AI agents
In `@fastlane-config/ios_config.rb`:
- Around line 12-25: BUILD_CONFIG currently includes a dead entry
app_rating_config_path (set from ProjectConfig::IOS[:age_rating_config_path]);
remove the app_rating_config_path key from BUILD_CONFIG to eliminate the unused
configuration, leaving all other keys (app_identifier, project_path,
workspace_path, plist_path, scheme, output_name, output_directory,
version_number, metadata_path) intact so lanes referencing BUILD_CONFIG continue
to work.
In `@fastlane-config/project_config.rb`:
- Around line 258-272: The validate_config method currently builds
required_files and checks existence using File.join(Dir.pwd, '..', file), which
can resolve outside the repo; replace that with an __dir__-anchored project root
(e.g., define a PROJECT_ROOT via File.expand_path('..', __dir__) or similar) and
use File.join(PROJECT_ROOT, file) when constructing missing_files; also fix the
trailing-comma RuboCop lint by removing the extra comma after the last element
in the required_files array (symbols: validate_config, required_files,
missing_files, File.join).
In `@fastlane/AppFile`:
- Around line 1-12: The Fastlane iOS wiring is wrong: change the apple_id call
to use the Apple ID email from FastlaneConfig::ProjectConfig::IOS[:apple_id]
(not the bundle id), set team_id to
FastlaneConfig::ProjectConfig::IOS_SHARED[:team_id] (not IOS[:team_id] which is
nil), and add an explicit
app_identifier(FastlaneConfig::ProjectConfig::IOS[:app_identifier]) call so the
bundle identifier is provided to fastlane; update the apple_id, team_id, and add
app_identifier in the AppFile accordingly.
♻️ Duplicate comments (1)
fastlane-config/project_config.rb (1)
34-39: Avoid hardcoded keystore passwords in source.Store keystore secrets in environment variables or a secrets manager to prevent leakage and accidental exposure.
🔒 Suggested fix
keystore: { file: "release_keystore.keystore", - password: "mifos1234", + password: ENV['ANDROID_KEYSTORE_PASSWORD'] || UI.user_error!("ANDROID_KEYSTORE_PASSWORD not set"), key_alias: "mifos", - key_password: "mifos1234" + key_password: ENV['ANDROID_KEY_PASSWORD'] || UI.user_error!("ANDROID_KEY_PASSWORD not set") },
| # Build Configuration (reads from both IOS and IOS_SHARED) | ||
| BUILD_CONFIG = { | ||
| project_path: "cmp-ios/iosApp.xcodeproj", | ||
| scheme: "iosApp", | ||
| output_directory: "cmp-ios/build" | ||
| # App-specific (from IOS) | ||
| app_identifier: ProjectConfig::IOS[:app_identifier], | ||
| project_path: ProjectConfig::IOS[:project_path], | ||
| workspace_path: ProjectConfig::IOS[:workspace_path], | ||
| plist_path: ProjectConfig::IOS[:plist_path], | ||
| scheme: ProjectConfig::IOS[:scheme], | ||
| output_name: ProjectConfig::IOS[:output_name], | ||
| output_directory: ProjectConfig::IOS[:output_directory], | ||
| version_number: ProjectConfig::IOS[:version_number], | ||
| metadata_path: ProjectConfig::IOS[:metadata_path], | ||
| app_rating_config_path: ProjectConfig::IOS[:age_rating_config_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.
🧩 Analysis chain
🏁 Script executed:
rg -n "app_rating_config_path|age_rating_config_path" -C 2Repository: openMF/android-client
Length of output: 865
🏁 Script executed:
rg -n "BUILD_CONFIG" -C 3Repository: openMF/android-client
Length of output: 5026
🏁 Script executed:
rg -n "app_rating_config_path|:age_rating_config_path" fastlane/FastFileRepository: openMF/android-client
Length of output: 47
🏁 Script executed:
rg -n "app_rating_config_path" --type rb | grep -v "fastlane-config/ios_config.rb"Repository: openMF/android-client
Length of output: 91
🏁 Script executed:
rg -n "app_rating_config_path"Repository: openMF/android-client
Length of output: 172
🏁 Script executed:
rg -n "age_rating_config_path"Repository: openMF/android-client
Length of output: 269
Remove unused app_rating_config_path configuration from BUILD_CONFIG.
app_rating_config_path is defined in BUILD_CONFIG but never accessed by any lane. This configuration entry is dead code and should be removed unless its usage will be added in the future.
🤖 Prompt for AI Agents
In `@fastlane-config/ios_config.rb` around lines 12 - 25, BUILD_CONFIG currently
includes a dead entry app_rating_config_path (set from
ProjectConfig::IOS[:age_rating_config_path]); remove the app_rating_config_path
key from BUILD_CONFIG to eliminate the unused configuration, leaving all other
keys (app_identifier, project_path, workspace_path, plist_path, scheme,
output_name, output_directory, version_number, metadata_path) intact so lanes
referencing BUILD_CONFIG continue to work.
| # Validate that all required files exist | ||
| def self.validate_config | ||
| required_files = [ | ||
| SHARED[:firebase_service_credentials], | ||
| IOS_SHARED[:app_store_connect][:key_filepath], | ||
| IOS_SHARED[:code_signing][:match_git_private_key] | ||
| ] | ||
|
|
||
| # Add Android files only if running Android lanes | ||
| if ENV['FASTLANE_PLATFORM_NAME'] == 'android' | ||
| required_files << ANDROID[:play_store_json_key] | ||
| end | ||
|
|
||
| missing_files = required_files.reject { |file| File.exist?(File.join(Dir.pwd, '..', file)) } | ||
|
|
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.
Anchor required-file checks to project root + fix trailing comma lint.
File.join(Dir.pwd, '..', file) can resolve outside the repo when fastlane runs from the project root. Using an __dir__-anchored project root avoids false “missing file” warnings and satisfies the trailing-comma RuboCop rule.
✅ Proposed fix
- required_files = [
- SHARED[:firebase_service_credentials],
- IOS_SHARED[:app_store_connect][:key_filepath],
- IOS_SHARED[:code_signing][:match_git_private_key]
- ]
+ project_root = File.expand_path('..', __dir__)
+ required_files = [
+ SHARED[:firebase_service_credentials],
+ IOS_SHARED[:app_store_connect][:key_filepath],
+ IOS_SHARED[:code_signing][:match_git_private_key],
+ ]
@@
- missing_files = required_files.reject { |file| File.exist?(File.join(Dir.pwd, '..', file)) }
+ missing_files = required_files.reject { |file| File.exist?(File.join(project_root, file)) }🧰 Tools
🪛 RuboCop (1.82.1)
[convention] 263-263: Put a comma after the last item of a multiline array.
(Style/TrailingCommaInArrayLiteral)
🤖 Prompt for AI Agents
In `@fastlane-config/project_config.rb` around lines 258 - 272, The
validate_config method currently builds required_files and checks existence
using File.join(Dir.pwd, '..', file), which can resolve outside the repo;
replace that with an __dir__-anchored project root (e.g., define a PROJECT_ROOT
via File.expand_path('..', __dir__) or similar) and use File.join(PROJECT_ROOT,
file) when constructing missing_files; also fix the trailing-comma RuboCop lint
by removing the extra comma after the last element in the required_files array
(symbols: validate_config, required_files, missing_files, File.join).
| # Load project configuration using absolute path | ||
| # require_relative doesn't work in AppFile due to eval context | ||
| project_dir = File.expand_path('..', __dir__) | ||
| require File.join(project_dir, 'fastlane-config', 'project_config') | ||
|
|
||
| # Android configuration | ||
| json_key_file(FastlaneConfig::ProjectConfig::ANDROID[:play_store_json_key]) | ||
| package_name(FastlaneConfig::ProjectConfig.android_package_name) | ||
|
|
||
| # iOS configuration | ||
| apple_id(FastlaneConfig::ProjectConfig::IOS[:app_identifier]) | ||
| team_id(FastlaneConfig::ProjectConfig::IOS[:team_id]) |
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.
🧩 Analysis chain
🏁 Script executed:
find . -type f -name "AppFile" | head -20Repository: openMF/android-client
Length of output: 83
🏁 Script executed:
find . -type f -name "*project_config*" | head -20Repository: openMF/android-client
Length of output: 100
🏁 Script executed:
git ls-files | grep -i fastlane | head -20Repository: openMF/android-client
Length of output: 975
🏁 Script executed:
cat -n ./fastlane/AppFileRepository: openMF/android-client
Length of output: 677
🏁 Script executed:
cat -n ./fastlane-config/project_config.rbRepository: openMF/android-client
Length of output: 14648
🏁 Script executed:
cat -n ./fastlane-config/ios_config.rbRepository: openMF/android-client
Length of output: 2706
Fix iOS AppFile wiring: apple_id receives bundle ID instead of email, team_id is nil, and app_identifier is missing.
Line 11 sets apple_id to IOS[:app_identifier] (the bundle ID), but fastlane's apple_id() expects an Apple ID email address. Line 12 reads from IOS[:team_id], which does not exist in the config—it should read from IOS_SHARED[:team_id]. Additionally, app_identifier() must be explicitly set to the bundle ID. These misconfigurations will cause authentication and code signing failures.
✅ Proposed fix
# iOS configuration
-apple_id(FastlaneConfig::ProjectConfig::IOS[:app_identifier])
-team_id(FastlaneConfig::ProjectConfig::IOS[:team_id])
+app_identifier(FastlaneConfig::ProjectConfig::IOS[:app_identifier])
+apple_id(ENV['FASTLANE_USER']) if ENV['FASTLANE_USER']
+team_id(FastlaneConfig::ProjectConfig::IOS_SHARED[:team_id])🤖 Prompt for AI Agents
In `@fastlane/AppFile` around lines 1 - 12, The Fastlane iOS wiring is wrong:
change the apple_id call to use the Apple ID email from
FastlaneConfig::ProjectConfig::IOS[:apple_id] (not the bundle id), set team_id
to FastlaneConfig::ProjectConfig::IOS_SHARED[:team_id] (not IOS[:team_id] which
is nil), and add an explicit
app_identifier(FastlaneConfig::ProjectConfig::IOS[:app_identifier]) call so the
bundle identifier is provided to fastlane; update the apple_id, team_id, and add
app_identifier in the AppFile accordingly.
Fixes - Jira-#599
Please make sure these boxes are checked before submitting your pull request - thanks!
Run the static analysis check
./gradlew checkorci-prepush.shto make sure you didn't break anythingIf you have multiple commits please combine them into one commit by squashing them.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.