feat: track Bundle Upload Compatibility Checked event#2364
Conversation
|
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 (2)
📝 WalkthroughWalkthroughBundle compatibility checks now emit analytics events. A new summarization contract in ChangesBundle Compatibility Analytics
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
Merging this PR will improve performance by ×2
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | /updates manifest response with metadata |
235.1 µs | 115.6 µs | ×2 |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/track-bundle-upload-compatibility (8de7275) with main (e9321fb)
Footnotes
-
2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52149eca35
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/upload-compatibility-summary.unit.test.ts`:
- Around line 38-90: Update the test cases in the describe block for
summarizeUploadCompatibility to use it.concurrent() instead of it() so they run
in parallel; change each test call (the ones invoking
summarizeUploadCompatibility, e.g., the tests for undefined input, empty array,
compatibleSameVersion/removedRemoteOnly, newPlugin, aggregation of
versionMismatch and iosCodeChanged, and de-duplication of versionMismatch) to
it.concurrent(...) while keeping test bodies and expectations unchanged.
🪄 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: b1060e4a-2dfe-4319-b963-0770f8e2cdc8
📒 Files selected for processing (3)
cli/src/bundle/compatibility.tscli/src/bundle/upload.tstests/upload-compatibility-summary.unit.test.ts
bundle upload runs the native-compatibility check internally but never emitted an analytics event for it — only the standalone `bundle compatibility` command did. PostHog confirmed the gap (8 events, all from the standalone command, vs 320 `bundle upload` invocations). Emit `Bundle Upload Compatibility Checked` from verifyCompatibility with a three-valued result (compatible | incompatible | skipped), incompatible count, distinct reasons, channel, and a skip_reason. The "skipped" result covers new channels / no remote metadata / --ignore-metadata-check so a skip is never miscounted as compatible. Logic extracted to a pure, unit-tested summarizeUploadCompatibility helper.
52149ec to
8d95972
Compare
…rrently - Thread the already-resolved orgId through verifyCompatibility into the `Bundle Upload Compatibility Checked` event. trackEvent() only auto-resolves the org when both appId and orgId are omitted, so passing appId alone would have sent the event without the PostHog organization group (breaking per-org grouping). (Codex P2) - Use it.concurrent() for the pure summarizeUploadCompatibility tests. (CodeRabbit)
…oad-compatibility
|



Why
bundle uploadruns the native-compatibility check internally (verifyCompatibility→checkCompatibilityCloud) but has never emitted an analytics event for the result. The only emitter ofBundle Compatibility Checkedis the standalonebundle compatibilitycommand, which few people run.PostHog (project 22029) confirms the gap over the period since CLI-usage tracking shipped:
bundle uploadinvocationsbundle compatibilitycommand invocationsBundle Compatibility CheckedeventsSo upload-time compatibility outcomes are invisible in PostHog/LogSnag.
What
Emit a new
Bundle Upload Compatibility Checkedevent fromverifyCompatibility, via the existingtrackEventpipeline (→/private/events→ PostHog + LogSnag, with global props + org group).Tags:
result:compatible|incompatible|skippedincompatible_count: numberreasons: distinct incompatibility reasons (e.g.new_plugin,version_mismatch), when anychannelskip_reason:no_remote_metadata|ignore_metadata_check, when skippedskippedmatters: the internal check doesn't run for new channels / channels without remotenative_packages/--ignore-metadata-check. Reporting those asskippedkeeps the funnel honest instead of silently counting a skip ascompatible.The classification is extracted to a pure, unit-tested helper
summarizeUploadCompatibility()incli/src/bundle/compatibility.ts.This also unblocks the day-by-day compatible-vs-incompatible PostHog graphs (previously fed only by the standalone command) and is the first slice of the planned "native build needed → try Capgo Builder" CTA.
Notes
void trackEvent), consistent with existing CLI telemetry; respectsCAPGO_DISABLE_TELEMETRY/CAPGO_DISABLE_POSTHOG.Test plan
tests/upload-compatibility-summary.unit.test.ts(6 cases: skipped/undefined, empty, compatible, new-plugin incompatible, multi-reason aggregation, reason de-dup) — passing.tsc --noEmitclean.capgo bundle uploadagainst a channel with incompatible native deps and confirm the event appears in PostHog with the expectedresult/reasons.Summary by CodeRabbit
New Features
Tests