fix(cli): stabilize native checksums and cover @capacitor/ios + @capacitor/android#2575
fix(cli): stabilize native checksums and cover @capacitor/ios + @capacitor/android#2575riderx wants to merge 5 commits into
Conversation
Build onboarding and account-help messages pointed at capgo.app or web.capgo.app instead of the console host. Route them through a shared consoleWebUrl helper and align tests/goldens. Co-authored-by: Cursor <cursoragent@cursor.com>
Hash @capacitor/ios and @capacitor/android native layouts, normalize LF line endings and path separators for cross-OS stability, and add tests proving checksum drift still flags incompatibility when semver matches. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
📝 WalkthroughWalkthroughAdds a new ChangesNative Checksum Module Extraction
Console URL Centralization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
…bump Complete utils.ts integration, register native-checksum tests in CI, add backend platform-package coverage, and restore private/cli-mcp-tests to main to fix the TUI preview workflow failure. Co-authored-by: Cursor <cursoragent@cursor.com>
🧪 Builder onboarding TUI preview — ✅ passed▶ Open the interactive HTML report (zoomable journey tree + cast playback) Commit: fd5f50f · Job summary with the result table |
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cli/src/native-checksum.ts`:
- Around line 186-191: The `dependencyHasNativeFiles` function currently only
checks for native source files via `collectNativeFilesFromRoots` for iOS and
Android roots, but it should also detect platform configuration-only files like
`.podspec`, `Package.swift`, and `build.gradle(.kts)`. Extend the function to
return true not only when actual native files exist but also when platform
config files are present in the dependency folder, ensuring that config-only
native packages are properly detected and included in the native hashing
process.
- Around line 205-210: The hash inputs in the loop lack frame boundaries and
have ordering issues. First, add delimiters or length-prefixing around the
hash.update calls for relativePath and the result of
normalizeNativeFileContentForChecksum to prevent ambiguous concatenation of
inputs. Second, move the hash.update call for relativePath after the
readFileSync call succeeds, so that unreadable files do not contribute to the
digest. Restructure the code within the try block so that the relativePath is
only hashed after the file content has been successfully read via readFileSync.
In `@private/cli-mcp-tests`:
- Line 1: The private/cli-mcp-tests submodule references an inaccessible
repository at https://github.com/Cap-go/cli-mcp-tests.git, which will cause git
clone and CI to fail. Update the .gitmodules file to correct the submodule URL
to point to an accessible repository location, or if the repository should
remain at that URL, ensure the repository is created or made accessible and that
the commit 66665b74dcab2024e05389ce29511363693780fd is pushed and available.
Verify the corrected URL by running git submodule update --init to confirm the
submodule can be properly cloned.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 352e581f-20ad-4017-b77f-88bfa30f77f8
📒 Files selected for processing (36)
cli/package.jsoncli/src/build/onboarding/mcp/engine.tscli/src/build/onboarding/tail/flow.tscli/src/init/command.tscli/src/native-checksum.tscli/src/organization/list.tscli/src/utils.tscli/src/utils/security_policy_errors.tscli/test/fixtures/native-checksum/capacitor-android/capacitor/build.gradlecli/test/fixtures/native-checksum/capacitor-android/capacitor/src/main/java/com/getcapacitor/Bridge.javacli/test/fixtures/native-checksum/capacitor-ios/Capacitor.podspeccli/test/fixtures/native-checksum/capacitor-ios/Capacitor/Capacitor/CAPBridge.hcli/test/fixtures/native-checksum/capacitor-ios/Capacitor/Capacitor/CAPBridge.mcli/test/fixtures/native-checksum/capacitor-ios/Capacitor/Capacitor/CAPBridge.swiftcli/test/fixtures/native-checksum/plugin-changed/android/build.gradlecli/test/fixtures/native-checksum/plugin-changed/android/src/main/java/com/example/Example.javacli/test/fixtures/native-checksum/plugin-changed/ios/Sources/Plugin/AppPlugin.swiftcli/test/fixtures/native-checksum/plugin-crlf/CapacitorApp.podspeccli/test/fixtures/native-checksum/plugin-crlf/android/build.gradlecli/test/fixtures/native-checksum/plugin-crlf/android/src/main/java/com/example/Example.javacli/test/fixtures/native-checksum/plugin-crlf/ios/Sources/Plugin/AppPlugin.swiftcli/test/fixtures/native-checksum/plugin-lf/CapacitorApp.podspeccli/test/fixtures/native-checksum/plugin-lf/android/build.gradlecli/test/fixtures/native-checksum/plugin-lf/android/src/main/java/com/example/Example.javacli/test/fixtures/native-checksum/plugin-lf/ios/Sources/Plugin/AppPlugin.swiftcli/test/helpers/onboarding-fixtures.mjscli/test/test-android-tail-engine.mjscli/test/test-android-tail-render.mjscli/test/test-android-tail-routing.mjscli/test/test-frame-fit-android-shared.mjscli/test/test-ios-tail-handoff.mjscli/test/test-ios-tui-render.mjscli/test/test-native-checksum.mjscli/test/test-tail-engine-shared.mjsprivate/cli-mcp-teststests/backend-bundle-compatibility.unit.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
| @@ -1 +1 @@ | |||
| Subproject commit a600cbc2dfa62337b05bebfb72e86272d7709039 | |||
| Subproject commit 66665b74dcab2024e05389ce29511363693780fd | |||
There was a problem hiding this comment.
🩺 Stability & Availability | 🔴 Critical
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Resolve the submodule URL and verify the pinned commit exists on the remote.
set -e
# Locate the submodule path/URL from .gitmodules
git config -f .gitmodules --get-regexp 'submodule\..*\.(path|url)' || true
SUBMODULE_PATH="private/cli-mcp-tests"
PIN="66665b74dcab2024e05389ce29511363693780fd"
URL=$(git config -f .gitmodules --get "submodule.${SUBMODULE_PATH}.url" || \
git config -f .gitmodules --get-regexp 'submodule\..*\.url' | awk -v p="$SUBMODULE_PATH" '$0 ~ p {print $2}' | head -n1)
echo "Submodule URL: ${URL:-<not found>}"
if [ -n "$URL" ]; then
# Check whether the pinned SHA is advertised/reachable on the remote.
git ls-remote "$URL" | grep -i "$PIN" || echo "Pinned commit not directly advertised as a ref tip (may still be reachable via a branch history)."
fiRepository: Cap-go/capgo
Length of output: 551
Submodule repository is not accessible; this will break clones and CI.
The private/cli-mcp-tests submodule points to https://github.com/Cap-go/cli-mcp-tests.git, but that repository is not found or is inaccessible. Any attempt to run git submodule update --init will fail with fatal: repository not found. This must be resolved before merging:
- Confirm the repository URL is correct.
- If the repository was deleted or made private, update the submodule URL in
.gitmodules. - If the repository should exist, ensure it is created and the commit
66665b74dcab2024e05389ce29511363693780fdis pushed and accessible.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@private/cli-mcp-tests` at line 1, The private/cli-mcp-tests submodule
references an inaccessible repository at
https://github.com/Cap-go/cli-mcp-tests.git, which will cause git clone and CI
to fail. Update the .gitmodules file to correct the submodule URL to point to an
accessible repository location, or if the repository should remain at that URL,
ensure the repository is created or made accessible and that the commit
66665b74dcab2024e05389ce29511363693780fd is pushed and available. Verify the
corrected URL by running git submodule update --init to confirm the submodule
can be properly cloned.
There was a problem hiding this comment.
Risk: medium. Not approving: Cursor Bugbot passed on the latest commit but no BUGBOT_REVIEW comment was posted, and this CLI native-checksum refactor exceeds the low-risk approval threshold. WcaleNieWolny is already requested for human review.
Sent by Cursor Approval Agent: Pull Request Approver External
Include config-only packages in native detection, length-prefix hash inputs for unambiguous digests, and add docstrings plus a config-only fixture test. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fd5f50f. Configure here.
| const roots = getNativeScanRoots(dependencyFolderPath, platform) | ||
| const nativeFiles = collectNativeFilesFromRoots(roots) | ||
| const configFiles = getPlatformConfigFiles(dependencyFolderPath, platform) | ||
| const allFiles = [...new Set([...nativeFiles, ...configFiles])].sort((a, b) => a.localeCompare(b)) |
There was a problem hiding this comment.
Absolute path sort breaks checksums
High Severity
calculatePlatformChecksums orders files with localeCompare on absolute paths before hashing, while hashed entries use POSIX paths from the dependency root. When both Capacitor/ and CapacitorCordova/ contribute files (e.g. @capacitor/ios), macOS and Windows can sort those trees differently, producing different iOS checksums for identical native content and reviving cross-OS compatibility drift.
Reviewed by Cursor Bugbot for commit fd5f50f. Configure here.
|







Summary (AI generated)
cli/src/native-checksum.tswith cross-OS normalization (LF line endings, POSIX relative paths).@capacitor/ios(Capacitor/,CapacitorCordova/) and@capacitor/android(capacitor/) layouts so platform packages get realios_checksum/android_checksumvalues.capacitor/is not treated asCapacitor/on case-insensitive filesystems.Motivation (AI generated)
Compatibility events were false-positive for users uploading consecutive OTA bundles with identical plugin versions because checksums differed across OS/environments while
@capacitor/android/@capacitor/ioswere skipped entirely. This aligns platform packages with plugin checksum behavior and makes hashing stable across macOS/Windows uploads.Business Impact (AI generated)
Reduces noisy "native build required" compatibility warnings for customers shipping web-only OTA updates, while keeping checksum-based detection when native code actually changes (checksum remains the source of truth over semver).
Test Plan (AI generated)
cd cli && bun run lintcd cli && bun run buildcd cli && bun run test:native-checksumbun test tests/backend-bundle-compatibility.unit.test.tsGenerated with AI
Made with Cursor
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Refactor