Fix --packageRolloutPercentage being silently ignored - #164
Fix --packageRolloutPercentage being silently ignored#164Alexandre Zollinger Chohfi (azchohfi) wants to merge 1 commit into
--packageRolloutPercentage being silently ignored#164Conversation
`PublishAsync` only applied the requested rollout when the submission it
had just retrieved already carried a `PackageDeliveryOptions.PackageRollout`
object:
if (submission.PackageDeliveryOptions?.PackageRollout != null && packageRolloutPercentage != null)
A newly created submission generally has no rollout configured, so that
guard was false in the common case and `--packageRolloutPercentage` was
dropped without any error or warning - the package then shipped to 100%
of users while the caller believed it was staged.
Materialize `PackageDeliveryOptions` and `PackageRollout` when a
percentage is supplied instead of requiring them to pre-exist. Both the
app and flight paths benefit, since the flight update copies
`PackageDeliveryOptions` onto `DevCenterFlightSubmissionUpdate`.
Adds regression coverage for the app and flight paths (both fail without
the fix), plus a test pinning that omitting the option leaves the
submission's delivery options untouched.
Reported in #149.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 134c8b3a-091c-45f1-bca6-61798d1bcfc0
There was a problem hiding this comment.
Pull request overview
Fixes staged rollout percentages being ignored when submissions lack rollout configuration.
Changes:
- Materializes missing rollout objects before applying the percentage.
- Adds regression coverage for app, flight, and omitted-percentage paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
MSStore.CLI/Helpers/IStorePackagedAPIExtensions.cs |
Initializes and applies rollout settings. |
MSStore.CLI.UnitTests/PublishCommandUnitTests.cs |
Adds rollout regression tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Closing this - the premise doesn't hold up against the live API. I claimed that a newly created submission comes back without a Verified against Partner Center across 6 real submissions (5 apps plus 1 flight submission, covering Every one returns a populated object rather than omitting it: "PackageRollout": {
"IsPackageRollout": false,
"PackageRolloutPercentage": 0,
"PackageRolloutStatus": "PackageRolloutNotStarted",
"FallbackSubmissionId": "0"
}So the existing guard evaluates true in practice and the rollout percentage is applied correctly. There is no user-facing bug here. The reason the added tests failed on The null-coalescing itself was harmless defensive hardening, but not worth the churn for a branch that doesn't occur, and the PR description asserted a bug that doesn't exist. Closing rather than leaving a misleading record. Worth noting separately: the test fixtures not matching the real API response shape is what made this look real. If they ever get revisited, populating |
Problem
msstore publish --packageRolloutPercentage <n>is silently ignored in the common case, and the package ships to 100% of users while the caller believes the rollout is staged at<n>%.PublishAsynconly applied the requested percentage when the submission it had just retrieved already carried aPackageDeliveryOptions.PackageRolloutobject:A freshly created submission generally has no rollout configured, so the guard is false exactly when the user asked for a rollout. There is no error, no warning, and no non-zero exit code — the flag just evaporates.
This is a bad failure mode: it fails open, toward the widest possible audience, and it's invisible until telemetry shows the update reached everyone.
Fix
Materialize the objects when a percentage is supplied, rather than requiring them to pre-exist:
Both the app and flight paths are covered — the mutation happens before the
DevCenterSubmission/DevCenterFlightSubmissioncast, and the flight update already copiesPackageDeliveryOptionsontoDevCenterFlightSubmissionUpdate.Behavior when the option is omitted is unchanged:
packageRolloutPercentageisnull, so nothing is allocated and the submission's delivery options are left exactly as the service returned them.Tests
Three tests added to
PublishCommandUnitTests:...ShouldApplyPackageRolloutPercentageWhenSubmissionHasNoRolloutConfiguredUpdateSubmissionAsyncreceivesIsPackageRollout: true/5%...ShouldApplyPackageRolloutPercentageForFlightsUpdateFlightSubmissionAsync...ShouldNotEnableRolloutWhenPercentageIsNotProvidedPackageDeliveryOptionsuntouchedThe default fixtures (
AddDefaultFakeSubmission/AddDefaultFakeFlightSubmission) already build submissions with noPackageDeliveryOptions, so they reproduce the bug without modification. Verified both new rollout tests fail onmainand pass with this change:Full suite green on both target frameworks:
Notes
Reported in #149, where the user hit this while trying to build a flight → metadata → staged-rollout pipeline and concluded rollout was flights-only.
Worth calling out separately:
msstore submission rollout get|update|halt|finalizealready works for non-flighted submissions, but is missing from the Learn commands page, which is what sent that user down the wrong path. That's a docs fix I'll do inwindows-dev-docs.Users on the current release can work around this bug by setting
PackageDeliveryOptions.PackageRolloutexplicitly in the JSON passed tomsstore submission update, which is unaffected.