Skip to content

Conversation

@transphorm
Copy link
Member

@transphorm transphorm commented Oct 7, 2025

…224)

  • chore: bump iOS build number to 179

  • fix: use PR source commit for deployment to get correct version.json

When deploying from a PR merge (e.g., dev → staging), now uses the source branch's commit instead of always checking out staging. This ensures version.json has the correct bumped build number from the previous deployment's PR back to dev, preventing 'build number already exists' errors.

  • downgrade to match store

  • fix: use merge_commit_sha instead of head.sha for deployments

Use github.event.pull_request.merge_commit_sha instead of head.sha to ensure we deploy exactly what landed on staging after the merge, not just the source branch state. This correctly handles:

  • Conflict resolutions made during merge
  • Any staging-only changes
  • The actual state of staging post-merge

The merge commit still includes the updated version.json from the source branch (e.g., dev), so build numbers remain correct while ensuring we deploy and tag the true staging state.


Summary by CodeRabbit

  • Chores
    • Improved mobile deployment workflow for PR-triggered builds to enhance reliability and traceability.
    • Standardized ref selection across build steps, ensuring consistent iOS and Android pipelines.
    • Enhanced logging to clearly indicate build source and PR details during staging builds.
    • Maintained existing validation and behavior for non-PR runs, with clearer warnings when refs differ.
    • Streamlined release tagging and version update paths for more predictable releases.
    • No user-facing changes.

)

* chore: bump iOS build number to 179

* fix: use PR source commit for deployment to get correct version.json

When deploying from a PR merge (e.g., dev → staging), now uses the source
branch's commit instead of always checking out staging. This ensures
version.json has the correct bumped build number from the previous
deployment's PR back to dev, preventing 'build number already exists' errors.

* downgrade to match store

* fix: use merge_commit_sha instead of head.sha for deployments

Use github.event.pull_request.merge_commit_sha instead of head.sha to ensure
we deploy exactly what landed on staging after the merge, not just the source
branch state. This correctly handles:
- Conflict resolutions made during merge
- Any staging-only changes
- The actual state of staging post-merge

The merge commit still includes the updated version.json from the source
branch (e.g., dev), so build numbers remain correct while ensuring we deploy
and tag the true staging state.

Co-authored-by: CodeRabbit <[email protected]>

---------

Co-authored-by: CodeRabbit <[email protected]>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Walkthrough

Updates the mobile deployment GitHub Actions workflow to use the PR merge commit SHA as the checkout ref during PR-triggered runs, with a fallback to staging. Adds PR-context logging and preserves original HEAD vs origin/staging comparison for non-PR runs across iOS/Android build, release-tagging, and version update steps.

Changes

Cohort / File(s) Summary
Workflow: mobile deploy
.github/workflows/mobile-deploy.yml
- Use github.event.pull_request.merge_commit_sha as checkout ref on PR runs; fallback to staging when unavailable
- Conditional logs showing PR number/title and that the build uses the PR merge commit
- Preserve HEAD vs origin/staging comparison on non-PR runs with warnings if diverged
- Apply ref strategy consistently across iOS/Android build, release-tagging, and version update paths

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant Repo as Repo (staging/PR)
  participant iOS as iOS Build
  participant Droid as Android Build
  participant Ver as Version Update
  participant Tag as Release Tagging

  Dev->>GH: Trigger workflow (PR or non-PR)
  alt PR-triggered
    GH->>Repo: Determine ref = PR.merge_commit_sha
    Note right of GH: If merge_commit_sha missing, fallback to 'staging'
    GH->>GH: Log PR number/title + merge-commit context
  else Non-PR
    GH->>Repo: Determine ref = 'staging'
    GH->>GH: Compare HEAD vs origin/staging and warn if mismatch
  end

  rect rgb(240,248,255)
    GH->>Repo: actions/checkout@ref (resolved above)
    GH->>iOS: Build iOS with resolved ref
    GH->>Droid: Build Android with resolved ref
  end

  opt Versioning path
    GH->>Ver: Update version.json with resolved ref context
  end

  opt Release path
    GH->>Tag: Create/annotate release tag using resolved ref
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • remicolin

Poem

A merge commit sails on staging seas,
PR winds whisper titles on the breeze.
iOS hums, Android keeps time,
Versions tick forward, tags align.
Ref by ref, the workflow knows—
Build from the source where the river flows.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title indicates a chore to fix mobile auto deploy and includes a version tag, but it does not clearly convey the primary change around using the PR merge commit SHA in the deployment workflow or the iOS build number bump, making it too vague for a quick scan. Please revise the title to succinctly describe the main change, for example “chore: use PR merge_commit_sha in mobile deploy workflow” or similar, so that reviewers immediately understand the core update without needing to read the full diff.
✅ 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/test-ios-mobile-deploy-v269

📜 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 1f51a5f and 66b4dce.

📒 Files selected for processing (1)
  • .github/workflows/mobile-deploy.yml (4 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

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 changed the title chore: fix build versions v2.6.9 and mobile deploy fork pr source (#1… chore: fix mobile auto deploy v2.6.9 rd2 Oct 7, 2025
@transphorm transphorm merged commit 721a3dc into staging Oct 7, 2025
13 checks passed
@transphorm transphorm deleted the justin/test-ios-mobile-deploy-v269 branch October 7, 2025 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants