Fix ExtractFormattedVersionTag to preserve non-numeric channel suffixes (e.g. experimentalA) - #6656
Conversation
DeploymentManager::GetStatus derives the short channel tag for the Main and
Singleton package family names via ExtractFormattedVersionTag. The old code
only appended a numeric suffix (swscanf %u), so a trailing letter suffix such
as the "A" in "experimentalA" was dropped, yielding "-e" instead of "-eA".
GetStatus then built a package family name that never matched the installed
Main/Singleton packages, reported the runtime as not installed, and forced a
spurious deployment that fails with access denied on Server 2019 / RS5.
Mirror the build-time short-tag derivation in CreateBuildInfo.ps1
(regex ^([a-z.]+)([A-Z0-9]{0,2})$) so runtime and build agree for numeric and
letter suffixes. Verified: identical output for plain/numeric tags
(experimental -> -e, experimental10 -> -e10) and corrected for letter suffixes
(experimentalA -> -eA).
AB#62727253
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
|
This content was largely generated by AI. AI makes mistakes. I investigated the underlying failure (AB#63309642) and independently arrived at the same root cause, so I went through this closely. The fix is correct — I reimplemented old, new,
Backward compatible as claimed. The regex correctly expects the leading hyphen ( That said, I have one substantive suggestion and a few smaller items. Main suggestion: this logic already exists, correctly, in the codebase
/// VersionShortTag for v2.x+ = VersionTag[0] + ChannelBuildString
/// The Tag portion uses only lowercase letters and dots [a-z.], while the
/// ChannelBuildString (base-36 encoded) uses only digits and uppercase [0-9A-Z].
/// These disjoint character sets allow deterministic extraction.
inline std::wstring GetVersionShortTagFromVersionTagV2(PCWSTR versionTag)I verified it produces identical output to this PR on every valid tag. So the base36 channel revision scheme was already known, already implemented correctly, and already shipped for the Bootstrap/DDLM path with an explicit V1/V2 split on This PR adds a third in-tree implementation of the same rule (plus the PowerShell in Suggested instead: call Three concrete benefits beyond dedup: 1. Avoids 2. Validation instead of silent failure. If the regex doesn't match, this PR still returns 3. Guaranteed agreement with the DDLM/Bootstrap path. Two independent implementations of one naming rule can drift apart again. One can't. Branch coverage — worth confirming before merge
There's a specific hazard: I see recurring "Snap release/2.0-stable to release/2.0-experimental" PRs (#6634, #6527). A future snap could revert this fix if stable isn't also fixed. TestsNothing in the repo currently references The table in your PR description is a test table — Spec doc still documents the bug
If the code is fixed and the spec isn't, the next person implementing against the spec reproduces the bug. Worth updating in this PR. Nit: work item reference
VerdictApprove on correctness — this does fix the bug, and the verification table in the description is exactly the right way to demonstrate it. I'd advocate for switching to If schedule pressure means shipping as-is, that's a reasonable call — but the branch coverage point is the one I'd not defer, because a snap from |
Root cause
DeploymentManager::GetStatusderives the short channel tag for the Main and Singleton package family names viaExtractFormattedVersionTag. The old implementation only appended a numeric suffix (swscanf %u), so a trailing letter suffix such as the "A" inexperimentalAwas dropped, yielding-einstead of-eA.As a result GetStatus built
...WinAppRuntime.Main.2-e_...while the installed package is...WinAppRuntime.Main.2-eA_.... The runtime was reported as not installed, triggering a spurious deploy/repair that fails with access denied on Server 2019 / RS5. This surfaced as ~40sAppLaunchWaitertimeouts in the five*CppWinuiPackagedsample-launch tests on the two Windows 10 17763 (RS5) legs of the 2.0-experimental release build.Fix
Rework
ExtractFormattedVersionTagto mirror the build-time short-tag derivation inCreateBuildInfo.ps1(regex^([a-z.]+)([A-Z0-9]{0,2})$), appending the trailing[A-Z0-9]{0,2}suffix so runtime and build agree for both numeric and letter suffixes.Verification
Compared old vs new vs build derivation over a tag table:
Behavior changes only for the previously-broken letter-suffix tags; all numeric/plain tags are unchanged (backward compatible).
AB#62727253