Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Oct 10, 2025

Summary by CodeRabbit

  • Chores
    • Hardened mobile deployment workflow: tightened job permissions, added pre/post verifications, per-platform guards, idempotent PR/tag logic, timestamped branches, force-push fallback, and changelog/release generation.
    • Marked legacy iOS/Android version-sync lanes as deprecated with user-facing guidance.
    • Switched release token usage for release calendar.
    • Improved CI diagnostics and numeric validation/coercion for version/build handling.
  • Tests
    • Added comprehensive unit tests for version management, validation, and file read/write behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

Harden CI permissions and reshaped mobile-deploy flow with robust bump/version verification, idempotent PR/tag creation, changelog/release generation, Fastlane lanes marked deprecated, richer CI diagnostics, version-manager validation/coercion, expanded Jest test discovery, and new unit tests for version-manager.

Changes

Cohort / File(s) Summary
CI workflow hardening & bump/tag control
.github/workflows/mobile-deploy.yml
Reduced top-level repo permissions; added per-job permissions; added early bump-output verification, platform/branch guards via needs.bump-version.outputs.platform; reordered steps; idempotent, timestamped branch PR creation; idempotent/platform-aware tagging with force-push fallback; added changelog and GitHub Release generation.
Release calendar token update
.github/workflows/release-calendar.yml
Swapped github.token for secrets.SELFXYZ_INTERNAL_REPO_PAT in PR creation steps.
Fastlane lane deprecations
app/fastlane/Fastfile
Marked ios sync_version and android sync_version lanes as DEPRECATED; removed automatic version-setting behavior and now emit deprecation UI errors and guidance.
CI diagnostic enhancements (Ruby helper)
app/fastlane/helpers/version_manager.rb
Replaced terse mismatch failure with detailed diagnostic output: emoji-prefixed header, expected vs actual, per-field mismatch list, common causes, debug hint, then UI.user_error to fail CI.
Version script validation & coercion (Node)
app/scripts/version-manager.cjs
Added semver validation for version, coerced iosBuild/androidBuild to numbers with bounds checks, updated logs to show coerced numeric values, and ensure numeric builds are written to version.json.
Unit tests for version manager
app/scripts/version-manager.test.cjs
New fs-mocking unit tests covering getVersionInfo, bumpVersion (major/minor/patch/build and platform-scoped), applyVersions validation/coercion/writes, and read/write error handling.
Jest discovery update
app/jest.config.cjs
Replaced testRegex with testMatch glob patterns, added cjs to moduleFileExtensions, and added testPathIgnorePatterns to exclude node_modules and scripts/tests.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant Bump as bump-version job
  participant Build as build jobs (iOS/Android)
  participant Repo as GitHub Repo
  participant PR as GitHub PRs
  participant Release as Tag/Release step

  Dev->>GH: push / dispatch mobile-deploy
  GH->>Bump: run bump calculation (version, ios_build, android_build)
  Bump->>GH: outputs: version, ios_build, android_build
  GH->>GH: Verify bump outputs present
  alt missing outputs
    GH-->>GH: fail early
  end
  GH->>Repo: prepare timestamped bump branch name
  GH->>PR: search existing bump PRs
  alt PR exists
    GH-->>GH: skip PR creation (idempotent)
  else
    GH->>PR: create bump PR (contents: write, pull-requests: write)
  end
  par Platform builds (conditional by outputs)
    GH->>Build: run platform-specific jobs (permissions adjusted)
    Build->>GH: post-build verification (versions/artifacts)
  end
  GH->>Release: create platform-aware tags (idempotent, with force fallback)
  GH->>Release: generate changelog & GitHub Release
Loading
sequenceDiagram
  autonumber
  participant CI as CI step
  participant VM as version_manager.rb
  participant Logs as Workflow Logs

  CI->>VM: verify versions across package.json/version.json
  alt mismatch
    VM->>Logs: emit expected vs actual, field diffs, common causes
    VM-->>CI: fail with UI.user_error
  else match
    VM-->>CI: proceed
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • remicolin
  • aaronmgdr

Poem

Bump outputs checked before the run, branches stamped with time,
Deprecated lanes now bow out, helpers print a richer rhyme.
Tests mock files and guard the bump, builds gated per platform's call,
Tags, changelogs, releases rise—idempotent, standing tall. 🚀

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title "code rabbit feedback for staging auto deploy logic" is partially related to the changeset as it references a real aspect of the changes—improvements to the mobile deployment automation workflow. However, the title relies on meta-language ("code rabbit feedback") rather than describing what was actually improved, and it's somewhat overly broad given that the PR encompasses much more than auto-deploy logic alone: it includes deprecation of legacy version sync lanes, enhanced error diagnostics in version management, new test coverage, and workflow permission refinements for security. A teammate scanning the git history would recognize this touched deployment logic but wouldn't clearly understand the nature and scope of the improvements being made.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch justin/mobile-auto-deploy-coderabbit-feedback

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a09ad4 and 73db86a.

📒 Files selected for processing (1)
  • .github/workflows/mobile-deploy.yml (11 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/**/*.{yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

.github/workflows/**/*.{yml,yaml}: In GitHub workflows, use the shared composite actions in .github/actions for dependency caching instead of calling actions/cache directly
Use the cache-yarn composite action for Yarn dependency caching in workflows
Use the cache-bundler composite action for Ruby gems caching in workflows
Use the cache-gradle composite action for Gradle caching in workflows
Use the cache-pods composite action for CocoaPods caching in workflows

Files:

  • .github/workflows/mobile-deploy.yml
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: selfxyz/self#0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Address CodeRabbitAI feedback before merging
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-deps
  • GitHub Check: analyze-android
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-ios
  • GitHub Check: android-build-test
🔇 Additional comments (4)
.github/workflows/mobile-deploy.yml (4)

244-256: Version output verification improves robustness.

The new step adds early validation that bump-version job properly set all required outputs (version, ios_build, android_build). This defensive check prevents downstream jobs from proceeding with incomplete data.


1311-1323: Version change validation adds safety gate.

Verifying that both package.json and version.json files were actually modified (before commit) prevents silent failures where the version manager script might not have properly applied changes. Good defensive pattern.


305-305: Platform-aware step conditionals are well-layered.

The step-level if conditions using needs.bump-version.outputs.platform provide defense-in-depth validation. Even if a job runs, the step conditionals ensure version bump and branch verification occur only on applicable platforms. Logic is correct and prevents accidental cross-platform version misapplication.

Also applies to: 329-329, 934-934, 954-954


1256-1420: Version bump PR and release tag jobs are robust and idempotent.

Strong patterns for idempotency and error handling:

  • Version bump PR (lines 1256–1420): Timestamped branch naming + duplicate PR detection (line 1376) prevent collisions on retries; version change verification (line 1311–1323) gates the PR creation.
  • Release tags (lines 1423–1550): Idempotent tag creation (exit code 128 = already exists), platform-aware tagging, and changelog/Release generation provide a complete deployment artifact trail.

Both jobs respect dry_run and deployment track gates. Well-designed for production reliability.

Also applies to: 1423-1550


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.

@transphorm transphorm marked this pull request as ready for review October 10, 2025 18:14
Copy link
Contributor

@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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97310d2 and af787b1.

📒 Files selected for processing (6)
  • .github/workflows/mobile-deploy.yml (8 hunks)
  • app/fastlane/Fastfile (2 hunks)
  • app/fastlane/helpers/version_manager.rb (1 hunks)
  • app/jest.config.cjs (1 hunks)
  • app/scripts/version-manager.cjs (2 hunks)
  • app/scripts/version-manager.test.cjs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
app/jest.config.cjs

📄 CodeRabbit inference engine (.cursor/rules/mobile-sdk-migration.mdc)

app/jest.config.cjs: Use Jest in the app with a React Native preset configured in app/jest.config.cjs
Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and '@tests/' to 'tests/src/'

Files:

  • app/jest.config.cjs
.github/workflows/**/*.{yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

.github/workflows/**/*.{yml,yaml}: In GitHub workflows, use the shared composite actions in .github/actions for dependency caching instead of calling actions/cache directly
Use the cache-yarn composite action for Yarn dependency caching in workflows
Use the cache-bundler composite action for Ruby gems caching in workflows
Use the cache-gradle composite action for Gradle caching in workflows
Use the cache-pods composite action for CocoaPods caching in workflows

Files:

  • .github/workflows/mobile-deploy.yml
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: selfxyz/self#0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Address CodeRabbitAI feedback before merging
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Configure moduleNameMapper in app/jest.config.cjs to map '@/'' to 'src/' and 'tests/' to 'tests/src/'

Applied to files:

  • app/jest.config.cjs
📚 Learning: 2025-08-24T18:54:04.809Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursor/rules/mobile-sdk-migration.mdc:0-0
Timestamp: 2025-08-24T18:54:04.809Z
Learning: Applies to app/jest.config.cjs : Use Jest in the app with a React Native preset configured in app/jest.config.cjs

Applied to files:

  • app/jest.config.cjs
📚 Learning: 2025-09-22T11:10:22.019Z
Learnt from: CR
PR: selfxyz/self#0
File: .cursorrules:0-0
Timestamp: 2025-09-22T11:10:22.019Z
Learning: Test, build, and deploy scripts (`yarn test`, `yarn ios`, `yarn test:e2e:ios`, Fastlane, etc.) must be used for automation.

Applied to files:

  • app/fastlane/Fastfile
🧬 Code graph analysis (1)
app/scripts/version-manager.test.cjs (1)
app/scripts/version-manager.cjs (8)
  • fs (27-27)
  • path (28-28)
  • info (260-260)
  • result (280-280)
  • pkg (90-90)
  • pkg (161-161)
  • pkg (236-236)
  • version (299-299)
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-deps
  • GitHub Check: android-build-test
  • GitHub Check: e2e-ios
  • GitHub Check: analyze-android
  • GitHub Check: analyze-ios

Copy link
Contributor

@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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3c7429 and c072478.

📒 Files selected for processing (2)
  • .github/workflows/mobile-deploy.yml (11 hunks)
  • .github/workflows/release-calendar.yml (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/**/*.{yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

.github/workflows/**/*.{yml,yaml}: In GitHub workflows, use the shared composite actions in .github/actions for dependency caching instead of calling actions/cache directly
Use the cache-yarn composite action for Yarn dependency caching in workflows
Use the cache-bundler composite action for Ruby gems caching in workflows
Use the cache-gradle composite action for Gradle caching in workflows
Use the cache-pods composite action for CocoaPods caching in workflows

Files:

  • .github/workflows/release-calendar.yml
  • .github/workflows/mobile-deploy.yml
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: selfxyz/self#0
File: app/AGENTS.md:0-0
Timestamp: 2025-09-22T11:10:57.879Z
Learning: Address CodeRabbitAI feedback before merging
⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: e2e-ios
  • GitHub Check: android-build-test
  • GitHub Check: build-deps
  • GitHub Check: analyze-ios
  • GitHub Check: analyze-android

@transphorm transphorm merged commit e01ec18 into dev Oct 17, 2025
29 of 31 checks passed
@transphorm transphorm deleted the justin/mobile-auto-deploy-coderabbit-feedback branch October 17, 2025 14:58
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.

2 participants