Skip to content

fix(channel): auto-unlink second bundle when disabling progressive rollout - #2821

Merged
riderx merged 3 commits into
mainfrom
fix/auto-unlink-rollout-on-disable
Aug 3, 2026
Merged

fix(channel): auto-unlink second bundle when disabling progressive rollout#2821
riderx merged 3 commits into
mainfrom
fix/auto-unlink-rollout-on-disable

Conversation

@riderx

@riderx riderx commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary (AI generated)

  • When progressive rollout is disabled, automatically unlink rollout_version (the second bundle) and clear pause state
  • Applied in channel API (POST /channel), Capgo console channel page, and CLI --rollout-disable
  • Added unit coverage for the API disable path

Motivation (AI generated)

Disabling progressive rollout previously only flipped rollout_enabled to false, so both the stable and rollout bundles stayed linked to the channel. That looked odd and confusing in the console.

Business Impact (AI generated)

Clearer channel state for users managing progressive rollouts; less accidental leftover second-bundle linkage after turning rollout off.

Test Plan (AI generated)

  • bunx vitest run tests/channel-post.unit.test.ts
  • In console: enable progressive rollout with a second bundle, click Disable, confirm only the stable bundle remains linked
  • Via API/CLI: rollout_enabled: false / --rollout-disable clears rollout_version
  • Rollback and promote still behave as before

Generated with AI

Made with Cursor

Review in cubic

Summary by CodeRabbit

  • New Features

    • Disabling a progressive rollout now clears its target, pause details, and rollout bundle link.
    • Added clearer permission handling for enabling and disabling rollouts.
    • Disabling a rollout no longer requires promotion permission when no bundle is linked.
  • Bug Fixes

    • Rollout unlinking now works reliably, including when another rollout version is provided.
    • Added update notifications after disabling a rollout.
  • Tests

    • Added coverage for rollout cleanup, unlinking, and permission behavior.

Leaving the second bundle attached after disable looked broken in the console; clear rollout_version (and pause state) across API, console, and CLI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3aa0dabb-e159-4408-ab89-e9fe5c3d8837

📥 Commits

Reviewing files that changed from the base of the PR and between 48bd5a6 and 23bcf1b.

📒 Files selected for processing (2)
  • cli/src/channel/set.ts
  • src/pages/app/[app].channel.[channel].vue
📝 Walkthrough

Walkthrough

Disabling a rollout now unlinks its bundle and clears rollout pause metadata. The backend, CLI, and channel UI apply this behavior with updated permission checks and test coverage.

Changes

Rollout disable unlinking

Layer / File(s) Summary
Backend rollout clearing and validation
supabase/functions/_backend/public/channel/post.ts, tests/channel-post.unit.test.ts
The endpoint clears rollout linkage and pause metadata when disabling a rollout. Tests cover linked bundles, conflicting rollout versions, and missing bundles.
CLI rollout disable integration
cli/src/channel/set.ts, cli/src/index.ts
The CLI treats disable operations as target changes, records bundle-link changes, clears rollout metadata, and documents the unlinking behavior.
Channel UI rollout disable integration
src/pages/app/[app].channel.[channel].vue
The UI adds a disable flow that clears rollout metadata, requests update notification, and uses separate permissions for enabling and disabling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant ChannelUI as Channel UI
  participant ChannelPost as channel post endpoint
  participant RolloutState as rollout state

  Operator->>ChannelUI: Disable rollout
  ChannelUI->>ChannelPost: Save disabled rollout with cleared target
  ChannelPost->>RolloutState: Clear rollout link and pause metadata
  ChannelPost-->>ChannelUI: Return save result
  ChannelUI-->>Operator: Request update notification
Loading

Possibly related PRs

  • Cap-go/capgo.app#2698: Both changes update channel rollout target and bundle-link handling in channel/post.ts.

Suggested labels: codex

Suggested reviewers: wcaleniewolny

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: disabling progressive rollout automatically unlinks the second bundle.
Description check ✅ Passed The description explains the behavior, motivation, scope, and automated test coverage, but omits optional screenshots and checklist details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing fix/auto-unlink-rollout-on-disable (23bcf1b) with main (62fdcfc)

Open in CodSpeed

Footnotes

  1. 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.

@riderx
riderx marked this pull request as ready for review August 1, 2026 08:05
@cursor

cursor Bot commented Aug 1, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2c9396d8-bf81-433f-8aab-45eaae3a5d66)

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread supabase/functions/_backend/public/channel/post.ts
Comment thread supabase/functions/_backend/public/channel/post.ts Outdated
Require promote when unlinking on disable, and always clear rollout_version even if the request also sends a rollout target.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 48bd5a6. Configure here.

Comment thread cli/src/channel/set.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: medium. Left a non-blocking comment: Cursor Bugbot finished as skipped with an unresolved finding, and this progressive-rollout unlink change exceeds the low-risk approval threshold. Assigned WcaleNieWolny and Dalanir for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor
cursor Bot requested review from Dalanir and WcaleNieWolny August 2, 2026 12:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 `@cli/src/channel/set.ts`:
- Line 193: Update the hasRolloutTargetChange calculation to count
rolloutDisable only when existingChannel.rollout_version is non-null, while
preserving the existing rolloutBundle, rolloutRollback, and rolloutPromote
conditions. This should align the later permission check with the channel
endpoint and allow settings-only disable requests when no rollout bundle is
linked.
🪄 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: c20ede82-d406-4573-ad19-ad4b8f4dc6d5

📥 Commits

Reviewing files that changed from the base of the PR and between 7c8e132 and 48bd5a6.

📒 Files selected for processing (5)
  • cli/src/channel/set.ts
  • cli/src/index.ts
  • src/pages/app/[app].channel.[channel].vue
  • supabase/functions/_backend/public/channel/post.ts
  • tests/channel-post.unit.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

Comment thread cli/src/channel/set.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread cli/src/channel/set.ts Outdated
Comment thread src/pages/app/[app].channel.[channel].vue Outdated
CLI checks promote_bundle on --rollout-disable only if a rollout bundle is linked; console Disable needs both promote and update_settings.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: medium. Left a non-blocking comment: Cursor Bugbot passed with its prior finding resolved, but this progressive-rollout unlink change across API/CLI/UI exceeds the low-risk approval threshold. Human review is still needed; reviewers are already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

@riderx
riderx merged commit 001a47e into main Aug 3, 2026
89 checks passed
@riderx
riderx deleted the fix/auto-unlink-rollout-on-disable branch August 3, 2026 11:50
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.

1 participant