Skip to content

feat(cli): capture ios_package_manager in telemetry#8482

Merged
alexgerardojacinto merged 1 commit into
mainfrom
feat/RMET-5208/cli-telemetry-ios-dep
May 27, 2026
Merged

feat(cli): capture ios_package_manager in telemetry#8482
alexgerardojacinto merged 1 commit into
mainfrom
feat/RMET-5208/cli-telemetry-ios-dep

Conversation

@alexgerardojacinto
Copy link
Copy Markdown
Contributor

@alexgerardojacinto alexgerardojacinto commented May 26, 2026

Description

Adds ios_package_manager to the Capacitor CLI's telemetry payload so every command emitted from a project with an iOS platform reports the dependency manager in use (Cocoapods | bundler | SPM | unknown). Detection reuses the existing memoized config.ios.packageManager promise and is guarded so non-iOS projects or detection failures yield 'unknown' and never throw out of telemetryAction. The existing app_id continues to be sent unchanged and remains the dedup key — no new identifier, no paths, no bundle IDs.

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation

Rationale / Problems Fixed

Need real-world data to prioritize SPM tooling work and plan CocoaPods deprecation; the CLI is the only signal source. Because cap sync runs many times per day, raw event counts would overstate adoption — emitting the new field alongside the existing app_id lets downstream consumers dedup per project. Dashboard and metrics-backend work to consume this signal is intentionally out of scope and will be tracked in a separate follow-up.

Tests or Reproductions

Unit tests in cli/test/telemetry.spec.ts cover the three behavioral branches of getIOSPackageManager:

  • iOS platform dir missing → 'unknown'
  • iOS present, packageManager resolves → returns the value
  • iOS present, packageManager rejects → 'unknown'

Manually verified against four fixture apps with DEBUG=capacitor:telemetry npx cap sync <platform>:

Also, and more importantly, checked that the new ios_package_manager field is getting to our endpoint and then being sent to Snowflake.

Fixture Setup ios_package_manager
SPM app CapApp-SPM/ (default iOS template) 'SPM'
CocoaPods app Podfile, no Gemfile 'Cocoapods'
Bundler app Podfile + Gemfile with gem 'cocoapods' + bundle on PATH 'bundler'
Android-only app no iOS platform dir 'unknown'

Each fixture emits a distinct app_id, confirming the dedup key still works per project. AC coverage for sync, update, copy, build, run, open is automatic: the new field is added inside telemetryAction itself, so every wrapped command picks it up.

Screenshots / Media

n/a

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

Includes a debug('metric payload: %O', data) line in telemetry.ts to make local inspection cheap (silent unless DEBUG=capacitor:telemetry is set). Happy to drop it before merge if reviewers prefer to keep the diff strictly scoped to the AC.

Extend the CLI telemetry payload with `ios_package_manager` (Cocoapods | bundler | SPM | unknown), resolved from `config.ios.packageManager` and guarded so non-iOS projects or detection failures yield `unknown` without breaking `telemetryAction`. The existing `app_id` continues to be sent unchanged as the dedup key, and the telemetry opt-out path is preserved.
@alexgerardojacinto alexgerardojacinto merged commit b4b297a into main May 27, 2026
7 checks passed
@alexgerardojacinto alexgerardojacinto deleted the feat/RMET-5208/cli-telemetry-ios-dep branch May 27, 2026 18:49
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