Releases: register new releases at 0% rollout - #89
Conversation
A newly registered release went to 10% of devices at once. It now starts at 0%: registered, but served to no device until an operator raises it. Existing rows keep their percentage.
f19c527 to
2235e01
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2235e014d5
ℹ️ 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".
|
|
||
| export const DEFAULT_ROLLOUT_PERCENTAGE = 10; | ||
| /** A new release is registered but served to no device until an operator raises it. */ | ||
| export const DEFAULT_ROLLOUT_PERCENTAGE = 0; |
There was a problem hiding this comment.
Keep zero-percent releases from shadowing active rollouts
When an older release is still rolling out (for example, v2 at 50%), syncing v3 with this new 0% default makes v3 the result of getLatestRelease; Retrieve rejects it for every device and getDefaultRelease only considers 100% rows, so v2 immediately stops being offered and clients fall back to v1. Registering an inactive release therefore interrupts any in-progress rollout; release selection should ignore 0% releases or retain the previous staged candidate until the new release is raised.
Useful? React with 👍 / 👎.
Selection took the single newest release as the rollout candidate, so registering the next version at 0% pushed every device off an older release still mid-rollout and onto the last 100% one. The latest lookup now ignores rows at 0%. Version-constrained requests, which skip rollout, still see them.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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.
Copilot review overview
🟢 Approval recommended
The behavior matches the stated rollout policy and has focused regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Registers new releases at 0% rollout so they remain inactive until explicitly promoted.
Changes:
- Default new releases to 0%.
- Exclude 0% releases from latest-rollout selection.
- Add focused regression coverage.
| File | Description |
|---|---|
| test/sync-releases.test.ts | Updates synchronization expectations to 0%. |
| test/releases.test.ts | Tests that 0% releases do not shadow active rollouts. |
| src/releases.ts | Filters inactive releases from latest selection. |
| src/release-sync.ts | Changes the default rollout percentage to 0%. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A newly registered release went to 10% of devices at once. It now starts at 0%: registered, visible in the table, served to nobody until an operator raises it. A 0% row is also ignored when picking the latest release, so registering one does not interrupt a rollout in progress.
Version-constrained requests, which skip rollout, still see 0% rows.
Code only, no migration. The schema default stays at 10; every insert sets the value.
Note
Medium Risk
Changes default OTA behavior for newly registered releases and how devices pick the “latest” rollout target; incorrect rollout selection could affect firmware delivery until an operator raises percentages.
Overview
Newly synced releases start at 0% rollout instead of 10%, so registering a version no longer pushes it to any devices until an operator raises the percentage.
Retrieve (background OTA checks) now treats “latest” as the newest release with
rolloutPercentage > 0, so a 0% row stays visible in the DB but does not replace an older release that is still rolling out. Version-pinned requests are unchanged and can still resolve 0% rows.Tests expect 0% on sync-created rows and add coverage for the case where a newer 0% release must not shadow an in-progress rollout.
Reviewed by Cursor Bugbot for commit 2c64c11. Bugbot is set up for automated code reviews on this repo. Configure here.