fix(desktop): close two pre-ship rollout edge cases

Bucket divisor now produces [0, 1) so the single UUID hashing to
0xFFFFFFFF is no longer permanently excluded by the strict-less-than
admit condition.

Mirrors the post-stamp manifest validation step from desktop-rollout.yml
into desktop-release.yml's finalize-rollout job so a stamp-rollout.mjs
regression can't silently ship a broken manifest.

Adds boundary tests: bucket=0 stays blocked at exact release time,
max-bucket admits at and past rollout end, unparseable releaseDate
admits, bucketFromStagingUserId is strictly < 1 at the upper bound.
This commit is contained in:
Mohamed Boudra
2026-04-28 16:58:54 +07:00
parent 25eb26db0f
commit e41fee0366
3 changed files with 92 additions and 3 deletions
@@ -69,8 +69,8 @@ export function shouldAdmitToRollout(args: {
return args.bucket * 100 < pct;
}
function bucketFromStagingUserId(stagingUserId: string): number {
return UUID.parse(stagingUserId).readUInt32BE(12) / 0xffffffff;
export function bucketFromStagingUserId(stagingUserId: string): number {
return UUID.parse(stagingUserId).readUInt32BE(12) / 0x100000000;
}
export async function resolveStagingUserId(filePath: string): Promise<string> {