Skip to content

Conversation

@techsavvy185
Copy link
Contributor

@techsavvy185 techsavvy185 commented Jan 20, 2026

Fixes - Jira-#599

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the static analysis check ./gradlew check or ci-prepush.sh to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

Summary by CodeRabbit

  • New Features

    • Centralized project configuration for Android and iOS
    • New iOS lanes and workflows for TestFlight and App Store releases
    • Config export utility to output structured project settings
    • Firebase deployment supports optional app ID override
  • Improvements

    • Consolidated configuration sources for consistency across platforms
    • Streamlined iOS build/signing flow with reusable helpers
    • Version handling now checks existing releases before incrementing
  • Bug Fixes

    • Removed an unnecessary APK upload restriction for Android builds

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Change Summary
New central config
fastlane-config/project_config.rb
New FastlaneConfig::ProjectConfig module with PROJECT_NAME, ORGANIZATION_NAME, ANDROID, IOS, IOS_SHARED, SHARED constants, accessors (android_package_name, ios_bundle_identifier, firebase_credentials_file, ios_config), validation and summary helpers.
Config refactors
fastlane-config/android_config.rb, fastlane-config/ios_config.rb
Both now require_relative 'project_config' and read STORE_CONFIG, FIREBASE_CONFIG, BUILD_PATHS/BUILD_CONFIG values from ProjectConfig constants instead of hardcoded literals; iOS adds TESTFLIGHT_CONFIG and APPSTORE_CONFIG.
Fastfile (iOS workflow)
fastlane/FastFile
Reorganized iOS lanes: added private helpers (setup_ci_if_needed, load_api_key, fetch_certificates_with_match, build_ios_project, get_version_from_gradle), public lanes build_ios, build_signed_ios, beta, release, generateFullReleaseNote; increment_version conditional on latest Firebase release; deploy_on_firebase supports appId override.
Fastfile (Android tweaks)
fastlane/FastFile
Android: changed build task from "bundle"→"assemble" in bundleReleaseApks lane; removed skip_upload_apk: true from upload call (affects Play upload behavior).
Extraction tool
fastlane-config/extract_config.rb
New script that emits JSON config derived from FastlaneConfig::ProjectConfig::IOS and IOS_SHARED; includes error handling and pretty-printed output.
AppFile update
fastlane/AppFile
Replaced hardcoded android/ios identifiers and json key paths with dynamic loading via FastlaneConfig::ProjectConfig constants.
Docs/README
fastlane/README.md
Added documentation for new iOS lanes (build_signed_ios, beta, release, generateReleaseNote) and updated descriptions for increment_version and beta usage.

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Suggested reviewers

  • therajanmaurya

Poem

🐰 I found a config, neat and wide,

One ProjectConfig to be my guide.
New lanes to build, sign, and race,
Certs and uploads all in place.
Hopping code, a joyous stride.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—refactoring Fastlane configurations by adapting them from the KMP Project Template. It's specific, clear, and directly relates to the substantial configuration changes across multiple fastlane files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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:

  1. RuboCop flags a missing trailing comma after the last array element (line 138).
  2. The path resolution File.join(Dir.pwd, '..', file) assumes execution from the fastlane directory, 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_path sources from age_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 between beta and release lanes.

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_release helper 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
  )
end

Also applies to: 499-538

Comment on lines +34 to +39
keystore: {
file: "release_keystore.keystore",
password: "mifos1234",
key_alias: "mifos",
key_password: "mifos1234"
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
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.

Comment on lines +429 to 435
lane :generateReleaseNote do
branchName = `git rev-parse --abbrev-ref HEAD`.chomp()
releaseNotes = changelog_from_git_commits(
commits_count: 1,
)
releaseNotes
end
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
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.

@biplab1
Copy link
Contributor

biplab1 commented Jan 23, 2026

@techsavvy185 Can you please tell me the steps you have taken to adapt the Fastlane configuration?

@techsavvy185
Copy link
Contributor Author

@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.

@biplab1
Copy link
Contributor

biplab1 commented Jan 23, 2026

@techsavvy185 There are some sections missing from FastFile compared to that of the KMP project template.

@techsavvy185
Copy link
Contributor Author

@biplab1 Ok, I'll make those changes.

@techsavvy185
Copy link
Contributor Author

@biplab1 I have made the required changes. Those parts were missing since they were merged into the KMP template yesterday.

Copy link

@coderabbitai coderabbitai bot left a 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.

bundleReleaseApks uses taskName: "assemble" which produces an APK file. The lane name and deployment pattern (compare to deployInternal at line 124 which correctly uses taskName: "bundleProd") indicate an AAB should be generated instead. Update to taskName: "bundle" or taskName: "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.

Comment on lines +448 to +454
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
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

Comment on lines +456 to +483
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
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find the fastlane file
find . -name "FastFile" -o -name "fastlane" -type d | head -20

Repository: openMF/android-client

Length of output: 186


🏁 Script executed:

#!/bin/bash
# Look for FastFile in fastlane directory
git ls-files | grep -i fastfile | head -20

Repository: openMF/android-client

Length of output: 82


🏁 Script executed:

#!/bin/bash
# Get total lines and examine the relevant sections
wc -l fastlane/FastFile

Repository: 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/FastFile

Repository: openMF/android-client

Length of output: 2760


🏁 Script executed:

#!/bin/bash
# Search for all call sites of increment_version
rg -n "increment_version\(" fastlane/FastFile

Repository: 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/FastFile

Repository: 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.

Suggested change
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.

Copy link

@coderabbitai coderabbitai bot left a 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")
       },

Comment on lines +12 to +25
# 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],

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

rg -n "app_rating_config_path|age_rating_config_path" -C 2

Repository: openMF/android-client

Length of output: 865


🏁 Script executed:

rg -n "BUILD_CONFIG" -C 3

Repository: openMF/android-client

Length of output: 5026


🏁 Script executed:

rg -n "app_rating_config_path|:age_rating_config_path" fastlane/FastFile

Repository: 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.

Comment on lines +258 to +272
# 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)) }

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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).

Comment on lines +1 to +12
# 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])
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -type f -name "AppFile" | head -20

Repository: openMF/android-client

Length of output: 83


🏁 Script executed:

find . -type f -name "*project_config*" | head -20

Repository: openMF/android-client

Length of output: 100


🏁 Script executed:

git ls-files | grep -i fastlane | head -20

Repository: openMF/android-client

Length of output: 975


🏁 Script executed:

cat -n ./fastlane/AppFile

Repository: openMF/android-client

Length of output: 677


🏁 Script executed:

cat -n ./fastlane-config/project_config.rb

Repository: openMF/android-client

Length of output: 14648


🏁 Script executed:

cat -n ./fastlane-config/ios_config.rb

Repository: 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.

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.

3 participants