Skip to content

Conversation

@riderx
Copy link
Member

@riderx riderx commented Dec 26, 2025

Introduce options for allowing physical devices and production builds in channel settings, enhancing configuration flexibility for users.

Summary by CodeRabbit

  • New Features
    • Added --prod and --no-prod flags to control production build targeting in channel configurations.
    • Added --device and --no-device flags to control physical device targeting in channel configurations.
    • Extended channel settings to support enabling/disabling updates for production environments and physical devices.

✏️ Tip: You can customize this high-level summary in your review settings.

@cursor
Copy link

cursor bot commented Dec 26, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 17.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

This PR extends channel targeting capabilities by adding support for production builds and physical devices. New boolean fields (allow_device, allow_prod) are introduced across the API layer, internal options, SDK interface, CLI arguments, and database schema, enabling channels to control updates for physical devices and production builds.

Changes

Cohort / File(s) Summary
Database and Type Schema
src/types/supabase.types.ts
Added allow_device and allow_prod boolean fields to channels schema (Row, Insert, Update). Extended stats_action enum with disableProdBuild and disableDevice actions.
API Layer
src/api/channels.ts
Extended Channel interface with allow_device and allow_prod boolean properties. Updated getActiveChannels query to select new fields and displayChannels to render additional Device/Prod columns.
Internal Channel Configuration
src/channel/set.ts
Added device and prod optional boolean properties to OptionsSetChannel interface. Implemented conditional handling to set channelPayload.allow_device and channelPayload.allow_prod when options provided. Updated validation to require at least one option.
Public SDK Interface
src/sdk.ts
Added device and prod optional boolean fields to UpdateChannelOptions interface. Propagated these fields from SDK method into internal setChannelInternal call.
CLI Interface
src/index.ts
Added --prod/--no-prod and --device/--no-device options to the channel set command. Updated command description to reflect expanded targeting capabilities.
Debug Logging
src/app/debug.ts
Added two new error-action mappings: disableProdBuild and disableDevice with corresponding summary messages to summarizeAction action map.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A hop through channels, two flags take flight,
Device and prod now shine so bright!
From CLI clicks to database rows,
Our targeting power steadily grows! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding device and production build options to channel settings, which aligns with the core modifications across all affected files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore_device_type_key

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.

@sonarqubecloud
Copy link

Copy link

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

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6235eb and 3a632d2.

📒 Files selected for processing (6)
  • src/api/channels.ts
  • src/app/debug.ts
  • src/channel/set.ts
  • src/index.ts
  • src/sdk.ts
  • src/types/supabase.types.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: check-posix-paths-macos
  • GitHub Check: Run tests
🔇 Additional comments (14)
src/types/supabase.types.ts (3)

546-547: LGTM! Consistent schema extension for device targeting.

The new allow_device field is properly added across Row, Insert, and Update types for the channels table, following the same pattern as existing allow_emulator and allow_dev fields.

Also applies to: 566-567, 586-587


549-549: LGTM! Consistent schema extension for production build targeting.

The new allow_prod field is properly added across Row, Insert, and Update types for the channels table, following existing patterns.

Also applies to: 569-569, 589-589


2904-2904: LGTM! New stats actions aligned with channel filtering.

The new disableProdBuild and disableDevice enum values properly extend the observable actions for the new channel targeting options.

Also applies to: 2906-2906

src/app/debug.ts (1)

117-117: LGTM! Debug action mappings properly extended.

The new disableProdBuild and disableDevice action mappings are consistent with existing patterns and provide clear, actionable error messages.

Also applies to: 119-119

src/api/channels.ts (2)

188-188: LGTM! Channel interface properly extended.

The new allow_device and allow_prod boolean fields are added consistently to the Channel interface, following the pattern of existing fields like allow_dev and allow_emulator.

Also applies to: 190-190


236-236: LGTM! Query properly selects new fields.

The getActiveChannels query correctly selects allow_device and allow_prod to populate the Channel interface.

Also applies to: 238-238

src/channel/set.ts (4)

34-35: LGTM! Interface properly extended for new targeting options.

The device and prod optional boolean fields are added to OptionsSetChannel, following the existing pattern for dev and emulator options.


86-87: LGTM! Options properly destructured.

The new device and prod options are correctly destructured alongside existing channel options.


119-120: LGTM! Validation properly updated to include new options.

The no-op guard correctly includes device and prod in the check to ensure at least one channel option is provided.


293-303: LGTM! Consistent implementation of device and prod targeting.

The handling of device and prod options follows the exact same pattern as existing dev and emulator options, with appropriate logging and payload updates.

src/index.ts (2)

405-405: LGTM! Command description updated to reflect new targeting options.

The channel set command description now accurately mentions device targeting including production builds and physical devices.


429-430: LGTM! CLI options properly added for device and prod targeting.

The new --prod/--no-prod and --device/--no-device options follow the existing pattern for boolean flags and have clear, descriptive help text.

Also applies to: 433-434

src/sdk.ts (2)

256-259: LGTM! SDK interface properly extended with documentation.

The device and prod optional boolean fields are added to UpdateChannelOptions with clear JSDoc comments, following the pattern of existing targeting options.


1145-1146: LGTM! Options properly propagated to internal implementation.

The device and prod options are correctly passed from the public SDK options to the internal OptionsSetChannel, ensuring the targeting settings are applied when updating channels.

const t = new Table()
t.theme = Table.roundTheme
t.headers = ['Name', 'Version', 'Public', 'iOS', 'Android', 'Auto Update', 'Native Auto Update', 'Device Self Set', 'Progressive Deploy', 'Secondary Version', 'Secondary Version Percentage', 'AB Testing', 'AB Testing Version', 'AB Testing Percentage', 'Emulator', 'Dev']
t.headers = ['Name', 'Version', 'Public', 'iOS', 'Android', 'Auto Update', 'Native Auto Update', 'Device Self Set', 'Progressive Deploy', 'Secondary Version', 'Secondary Version Percentage', 'AB Testing', 'AB Testing Version', 'AB Testing Percentage', 'Emulator', 'Device', 'Dev', 'Prod']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical mismatch between table header and row values.

The header array at line 200 contains 18 columns, but the row array (lines 204-217) only pushes 12 values. This will cause misaligned table display.

The header includes columns like 'Progressive Deploy', 'Secondary Version', 'Secondary Version Percentage', 'AB Testing', 'AB Testing Version', and 'AB Testing Percentage' that have no corresponding values in the row data.

🔎 Proposed fix

Either remove the extra columns from the header or add the missing row values:

-  t.headers = ['Name', 'Version', 'Public', 'iOS', 'Android', 'Auto Update', 'Native Auto Update', 'Device Self Set', 'Progressive Deploy', 'Secondary Version', 'Secondary Version Percentage', 'AB Testing', 'AB Testing Version', 'AB Testing Percentage', 'Emulator', 'Device', 'Dev', 'Prod']
+  t.headers = ['Name', 'Version', 'Public', 'iOS', 'Android', 'Auto Update', 'Native Auto Update', 'Device Self Set', 'Emulator', 'Device', 'Dev', 'Prod']

Also applies to: 204-217

@riderx riderx merged commit 46fe44e into main Dec 27, 2025
13 checks passed
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