Skip to content

chore(ci): drop duplicate bundle install in Android jobs#7257

Merged
diegolmello merged 2 commits into
developfrom
fix/android-bundle-install-dupe
Apr 27, 2026
Merged

chore(ci): drop duplicate bundle install in Android jobs#7257
diegolmello merged 2 commits into
developfrom
fix/android-bundle-install-dupe

Conversation

@diegolmello
Copy link
Copy Markdown
Member

@diegolmello diegolmello commented Apr 27, 2026

Proposed changes

Every Android build/upload job in CI ran bundle install twice. The first install was triggered implicitly by ruby/setup-ruby@v1 with bundler-cache: true and resolved against the root Gemfile — which carries iOS-only deps (cocoapods, xcodeproj, ~125 gems). Android jobs threw all of that away and then ran a second explicit bundle install --path gems against android/Gemfile.

Pointing setup-ruby at android/ via working-directory: android makes bundler-cache: true target the correct Gemfile from the start, so the explicit "Install Fastlane" step becomes redundant. The deprecated --path flag goes away as a bonus.

Affects:

  • .github/actions/build-android/action.yml
  • .github/actions/upload-android/action.yml
  • .github/actions/upload-internal-android/action.yml

Saves roughly ~40s per Android build/upload job (and enables proper cache hits, which the previous setup also missed because the cache key was rooted at the wrong lockfile).

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-2139

How to test or reproduce

Trigger any Android build job (this PR's own checks are sufficient). In the Set up Ruby and Bundler step, confirm:

  • only one bundle install runs (against android/Gemfile.lock, ~88 gems)
  • no [DEPRECATED] The --path flag is deprecated warning
  • no separate "Install Fastlane" step in the job timeline

Subsequent runs on the same branch should hit the bundler cache.

Screenshots

N/A — CI-only change.

Types of changes

  • Improvement (non-breaking change which improves a current function)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable) — N/A, CI-only
  • I have added necessary documentation (if applicable) — N/A
  • Any dependent changes have been merged and published in downstream modules — N/A

Further comments

bundler-cache: true already runs bundle install automatically; the prior setup was effectively running it twice with two different lockfiles. Verified against run 25008420199, where both installs were visible back-to-back (~68s combined).

Summary by CodeRabbit

  • Chores
    • Streamlined GitHub Actions build workflows by simplifying dependency installation configuration across Android build processes.

… install

The Android composite actions ran `bundle install` twice per job: first the
implicit one from `ruby/setup-ruby@v1` (against the root iOS-flavored Gemfile,
~125 gems including cocoapods/xcodeproj that Android never uses), then an
explicit `bundle install --path gems` for `android/Gemfile`.

Setting `working-directory: android` on `setup-ruby` makes `bundler-cache: true`
target the right Gemfile directly, so the explicit step becomes redundant and
the deprecated `--path` flag goes away. Saves ~40s per Android build/upload job.
@diegolmello diegolmello temporarily deployed to approve_e2e_testing April 27, 2026 18:20 — with GitHub Actions Inactive
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Walkthrough

Three GitHub Actions workflows in the Android build pipeline have been simplified by removing explicit Bundler installation steps (bundle install --path gems) from the android directory. Ruby setup with bundler-cache: true now handles dependency installation automatically.

Changes

Cohort / File(s) Summary
GitHub Actions Android Workflows
.github/actions/build-android/action.yml, .github/actions/upload-android/action.yml, .github/actions/upload-internal-android/action.yml
Removed dedicated "Install Fastlane" step that executed bundle install --path gems. Bundler caching is now configured directly in the Ruby setup step.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested labels

type: chore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing duplicate bundle install steps in Android CI jobs by consolidating the Ruby setup configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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


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.

@diegolmello diegolmello had a problem deploying to experimental_ios_build April 27, 2026 18:24 — with GitHub Actions Error
@diegolmello diegolmello temporarily deployed to experimental_android_build April 27, 2026 18:24 — with GitHub Actions Inactive
@diegolmello diegolmello temporarily deployed to official_android_build April 27, 2026 18:24 — with GitHub Actions Inactive
@diegolmello diegolmello had a problem deploying to upload_official_android April 27, 2026 21:01 — with GitHub Actions Error
@diegolmello diegolmello had a problem deploying to upload_experimental_android April 27, 2026 21:03 — with GitHub Actions Error
@github-actions
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

Android Build Available

Rocket.Chat Experimental 4.72.0.108669

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNTghqCZKS2ZGxvOpOx4YIeCJNzzfzDVZeuA1A4NuCpIImlj87Gc-z7ffZ5tVFMCt2EDNO5RA1GJZizDxWZ9

Copy link
Copy Markdown
Member Author

@diegolmello diegolmello left a comment

Choose a reason for hiding this comment

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

Review — #7257 — 2026-04-27T21:18:19Z

Findings: 2 (critical: 0, major: 0, minor: 1, nit: 1, spec-mismatch: 0)
Verdict: APPROVE
Skipped (duplicate of existing thread): 0

Summary

This PR achieves its stated goal: it eliminates the duplicate bundle install previously running on every Android CI job. ruby/setup-ruby@v1 with working-directory: android + bundler-cache: true performs exactly one resolve+install against android/Gemfile, writes android/.bundle/config, and the downstream bundle exec fastlane … calls (which already use working-directory: android) resolve gems via that config. The three composite actions (build-android, upload-android, upload-internal-android) receive identical patches, and a repo-wide grep for android/gems returned no references — nothing else in the repo depends on the deleted install path.

Estimated savings: ~40s per Android job today (one per build-android × 2 = ~80s/run unconditional, up to ~4 min/run when uploads run); up to ~67s per job once the bundler cache warms, since the previous setup's cache key was rooted at the wrong lockfile and never hit on Android jobs.

minor: gem path migration from android/gems/ to android/vendor/bundle

Path: .github/actions/build-android/action.yml, .github/actions/upload-android/action.yml, .github/actions/upload-internal-android/action.yml
Category: design
Suggested fix: none — flagged for awareness.

The deleted explicit step used bundle install --path gems, which placed gems under android/gems/. setup-ruby's default install path is vendor/bundle, so installs now land at android/vendor/bundle/. A repo-wide grep for android/gems shows zero hits in CI scripts, Gemfiles, gradle, fastlane, or .gitignore, so the migration is safe. Worth noting if any external tooling or developer workflow caches the old path.


nit: bundler-cache precondition

Path: .github/actions/build-android/action.yml:47-52, .github/actions/upload-android/action.yml:38-43, .github/actions/upload-internal-android/action.yml:38-43
Category: docs
Suggested fix: none.

bundler-cache: true requires android/Gemfile.lock to exist and be authoritative for cache keying. It does, and the lockfile is committed — just calling out that it is now load-bearing for cache hits.


Verified negatives (not findings)

  • Ruby version pin (2.7.7) untouched — no smuggled upgrade.
  • No secret-handling changes — FASTLANE/Google service account flow is unaffected.
  • Three composite actions patched identically — symmetry confirmed.
  • No workflow YAML or shell script references the old android/gems/ path.
  • Subsequent bundle exec fastlane … invocations use working-directory: android and will pick up the new .bundle/config.

Positive observations

  • Surgical CI change, net -15 lines, three-file symmetry.
  • Uses official action behavior (bundler-cache + working-directory) rather than a custom step.
  • Cache path under android/vendor/bundle is the documented setup-ruby convention; should improve cache hit rates compared to the prior gems/ directory.

Copy link
Copy Markdown
Contributor

@OtavioStasiak OtavioStasiak left a comment

Choose a reason for hiding this comment

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

LGTM

@diegolmello diegolmello merged commit 1c15a40 into develop Apr 27, 2026
3 of 4 checks passed
@diegolmello diegolmello deleted the fix/android-bundle-install-dupe branch April 27, 2026 21:55
@diegolmello diegolmello requested a deployment to approve_e2e_testing April 27, 2026 21:56 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to experimental_android_build April 27, 2026 21:59 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to official_android_build April 27, 2026 21:59 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to experimental_ios_build April 27, 2026 21:59 — with GitHub Actions Waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants