From 6992df4cdc8eddbf325d7bbc6cc0c4e1589fa2a8 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Sun, 11 Oct 2026 16:56:45 -0700 Subject: [PATCH] fix(release): the Store submit reads the CLI's PascalCase submission keys rc.13-v0.21.7 failed 'Submit the verified Store package' with 'unreadable submission: {"Id": ..., "ApplicationCategory": ...'. msstore submission get serializes the .NET DevCenterSubmission property names (Status, TargetPublishMode), not the REST API's camelCase, so the in-flight check never found 'status' and the Manual-publish write added a second 'targetPublishMode' key the CLI would ignore. Both now use the key as the CLI spells it. The test fake emits the CLI's casing; with it main fails 5 tests with the production error. --- scripts/releases/store.py | 13 ++++++++++--- tests/scripts/test_release_store.py | 8 +++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/releases/store.py b/scripts/releases/store.py index 239d527f16..ea1b1deed8 100644 --- a/scripts/releases/store.py +++ b/scripts/releases/store.py @@ -110,9 +110,16 @@ def _has_in_flight(submission_output: str) -> bool: submission = json.loads(submission_output) except json.JSONDecodeError: raise StoreError(f"unreadable submission: {submission_output[:200]!r}") - if not isinstance(submission, dict) or "status" not in submission: + key = _key(submission, "status") if isinstance(submission, dict) else None + if key is None: raise StoreError(f"unreadable submission: {submission_output[:200]!r}") - return submission["status"] not in _NOT_IN_FLIGHT + return submission[key] not in _NOT_IN_FLIGHT + + +def _key(submission: dict, name: str) -> str | None: + """The submission's own spelling of ``name``. The CLI serializes .NET property names + (``Status``, ``TargetPublishMode``); the REST API documents camelCase.""" + return next((k for k in submission if k.lower() == name.lower()), None) def submit(package: str, *, product_id: str, run=_cli_run) -> dict: @@ -121,7 +128,7 @@ def submit(package: str, *, product_id: str, run=_cli_run) -> dict: run(["msstore", "submission", "delete", product_id, "--no-confirm"]) run(["msstore", "publish", package, "--appId", product_id, "--noCommit"]) submission = json.loads(run(["msstore", "submission", "get", product_id])) - submission["targetPublishMode"] = "Manual" + submission[_key(submission, "targetPublishMode") or "TargetPublishMode"] = "Manual" run(["msstore", "submission", "update", product_id, json.dumps(submission, separators=(",", ":"))]) run(["msstore", "submission", "publish", product_id]) diff --git a/tests/scripts/test_release_store.py b/tests/scripts/test_release_store.py index 563d413d0a..b41aa36600 100644 --- a/tests/scripts/test_release_store.py +++ b/tests/scripts/test_release_store.py @@ -23,9 +23,10 @@ class _Cli: uploaded = any(kind == "submit" for kind, _ in self.events) # Before the upload: the last submission (in flight or published). After: the new draft. status = "PendingCommit" if uploaded else ("Certification" if self.pending else "Published") + # The CLI serializes .NET property names (rc.13-v0.21.7: '{"Id": ..., "ApplicationCategory": ...'). return json.dumps({ - "status": status, "targetPublishMode": "Immediate", - "friendlyName": "Submission 2", "listings": {}}) + "Status": status, "TargetPublishMode": "Immediate", + "FriendlyName": "Submission 2", "Listings": {}}) if argv[:3] == ["msstore", "submission", "delete"]: self.events.append(("delete-pending", name)) return "" @@ -76,7 +77,8 @@ def test_submit_turns_auto_publish_off(): cli = _Cli(pending=False) submit("verified/Store-1.2.3.msixbundle", product_id="9NTEST", run=cli) - assert cli.updated["targetPublishMode"] == "Manual" + assert cli.updated["TargetPublishMode"] == "Manual" + assert "targetPublishMode" not in cli.updated def test_submit_commits_the_held_submission():