Skip to content

Deployment: derive Main/Singleton short tag via canonical v2 helper (experimentalA fix) - #6657

Open
agniuks wants to merge 4 commits into
mainfrom
agnel/deploymentmanager-shorttag-v2
Open

Deployment: derive Main/Singleton short tag via canonical v2 helper (experimentalA fix)#6657
agniuks wants to merge 4 commits into
mainfrom
agnel/deploymentmanager-shorttag-v2

Conversation

@agniuks

@agniuks agniuks commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #6656 (which fixed the experimentalA -> -eA short-tag bug on release/2.0-experimental with a self-contained regex). This applies the cleaner fix on main per Jesse Collins (@JesseCol)'s review: instead of adding a third private copy of the short-tag rule, delegate to the canonical v2 helper that the DDLM/Bootstrap path already uses.

Background

DeploymentManager::ExtractFormattedVersionTag re-derived the Main/Singleton short channel tag with its own rule that appended only a numeric suffix (swscanf %u). A letter suffix (the "A" in experimentalA) was dropped, so GetStatus built ...WinAppRuntime.Main.2-e_... while the installed package is ...WinAppRuntime.Main.2-eA_..., mis-detected the runtime as not installed, and forced a spurious repair that fails with access denied on Server 2019 / RS5 (~40s AppLaunchWaiter timeouts in the CppWinuiPackaged sample tests). Same root cause as bug 63309642 / bug 62727253.

Change

  • ExtractFormattedVersionTag now delegates to AppModel::Identity::GetVersionShortTagFromVersionTagV2 (dev/Common/AppModel.Identity.h), the v2.x rule already used by MddBootstrap.cpp. It derives first-char + trailing base-36 [0-9A-Z]{0,2} suffix, which matches the build (CreateBuildInfo.ps1).
  • Spec specs/Deployment/MSIXPackages.md: the short tag was described as "digits"; corrected to base-36 (0-9, A-Z).

Why this over the regex in #6656

  • Removes duplication rather than adding a fourth copy of the rule (build PS1, spec C#, v1 helper, v2 helper). One source of truth means the runtime can't drift from Bootstrap again.
  • Off the hot startup path: GetStatus runs from the packaged-app auto-initializer before wWinMain; this drops std::regex/swscanf construction cost there.
  • Fails loud: GetVersionShortTagFromVersionTagV2 validates via IsValidVersionShortTag and throws E_INVALIDARG on a malformed tag instead of silently emitting a wrong short tag (the exact failure mode that was so hard to diagnose).

Verification

GetVersionShortTagFromVersionTagV2 produces identical output to #6656 and to the build across the tag table (experimental->-e, experimental10->-e10, experimentalA->-eA, experimentalZ->-eZ, experimental1M->-e1M, preview3->-p3, stable->-s). Caller passes the dash-prefixed tag (substr(versionTagPos)); the helper is called on the tag without the dash and the dash is re-prepended.

Notes / follow-ups

  • No repo test currently exercises ExtractFormattedVersionTag or the short-tag helpers. A parity unit test (runtime short-tag == build short-tag over a tag table) is worth adding but needs a TAEF home; deferring rather than bloating this PR.
  • Branch coverage: release/2.0-stable still carries the old swscanf (no symptom today since it has no version tag, but a snap stable->experimental could reintroduce it). Recommend a defensive port there as well.

Bugs: 63309642, 62727253

Investigation and change drafted by an AI assistant on behalf of agniuks; review feedback incorporated from Jesse Collins (@JesseCol).

ExtractFormattedVersionTag in DeploymentManager reconstructed the short channel
tag with its own private rule that appended only a numeric suffix
(swscanf %u). A non-numeric channel suffix such as the trailing "A" in
"experimentalA" was dropped, so GetStatus derived "-e" instead of "-eA",
built a Main/Singleton package family name that never matched the installed
package, reported the runtime as not installed, and forced a spurious repair
that fails with access denied on Server 2019 / RS5.

The v2.x short-tag rule (first character + trailing base-36 [0-9A-Z]{0,2}
suffix) already exists and is used by the DDLM/Bootstrap path via
AppModel::Identity::GetVersionShortTagFromVersionTagV2. Delegate to it instead
of re-deriving. This removes a duplicate implementation, keeps the runtime in
agreement with the build (CreateBuildInfo.ps1), drops std::regex/swscanf from
the packaged-app startup path, and validates the result (throws E_INVALIDARG
on a malformed tag) rather than silently producing a wrong short tag.

Also corrects the MSIXPackages.md spec, which described the suffix as digits
only; it is base-36 (0-9, A-Z).

AB#63309642
AB#62727253
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@agniuks

agniuks commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

Comment thread dev/Deployment/DeploymentManager.cpp
Comment thread dev/Deployment/DeploymentManager.cpp
@guimafelipe

Copy link
Copy Markdown
Contributor

Also, is it a new behavior to have experimentalA, experimentalB and etc now?

And this should definitely have tests that defines its expected behavior, it is not the first time we had problems with version tags and it would be better to catch them earlier.

@agniuks

agniuks commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

@agniuks

agniuks commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Also, is it a new behavior to have experimentalA, experimentalB and etc now?

And this should definitely have tests that defines its expected behavior, it is not the first time we had problems with version tags and it would be better to catch them earlier.

It's been the case since semver implementation for 2.0. This is an interim fix to unblock until Chris is back, we've discussed removing the experimental suffix altogether from the NuGet.

@agniuks

agniuks commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

@agniuks

agniuks commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants