Repository navigation
feat(cli): add Microsoft Store submission preflight - #97
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e944c5681c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a Microsoft Store submission preflight that validates configuration, PWA manifests, listings, screenshots, commerce settings, and output paths. The CLI writes deterministic JSON and Markdown evidence, with templates, documentation, and smoke coverage. ChangesMicrosoft Store preflight
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Developer
participant CLI
participant Preflight
participant GameFiles
Developer->>CLI: run target preflight microsoft-store
CLI->>GameFiles: resolve targets and configuration
CLI->>Preflight: validate submission inputs
Preflight->>GameFiles: read manifest and screenshots
Preflight->>GameFiles: write JSON and Markdown evidence
Preflight-->>CLI: return evidence summary
CLI-->>Developer: report locales and warnings
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/index.ts`:
- Around line 1062-1064: Update the parent target command help text and fallback
message to include preflight alongside build and smoke, using the definitions
associated with the target command. Ensure invoking mpgd target clearly
advertises all three available subcommands.
In `@packages/cli/src/microsoft-store-submission.ts`:
- Around line 168-171: Update the evidence-output validation before the
writeFileSync calls to canonicalize and compare input.jsonFile and
input.markdownFile against configFile, manifest, and each other, rejecting any
aliases while retaining the existing assertOutputFileInside checks. Ensure both
evidence outputs are validated before either file is written.
- Around line 69-80: Update the evidence model and generation logic around the
listing, JSON, and Markdown output to retain and serialize the complete
personalData declaration, including accessedOrTransmitted. Ensure both true and
false values remain distinguishable even when privacyPolicyUrl is identical, and
include the same personalData object in every generated evidence format.
- Around line 109-115: Update the manifest handling around manifestFile,
parseManifest, and the later hashing logic to read the manifest contents once
into a buffer, then use that same buffer for both JSON parsing and SHA-256
hashing. Remove the later file reopen so evidence fields and the recorded hash
always represent the identical manifest snapshot.
- Around line 384-405: Update the listing validation flow around the locale
mapping and screenshot processing to enforce Microsoft Store limits before
preflight: validate each description against the maximum allowed length, and
validate every screenshot’s file type, supported image format, and size before
returning the normalized listing. Reuse the existing validation utilities or
constants where available, while preserving the current locale and non-empty
screenshot checks.
- Around line 430-447: Extend the public URL validation condition around
hostname checks to reject reserved special-use domains: the exact `.invalid`,
`.test`, and `.example` domains and any hostnames ending with those suffixes.
Preserve the existing localhost, example subdomain, and IP-address rejection
behavior.
- Around line 190-198: Update the identity validation around
requireIdentityToken, requireProductionString, and the packageId/publisherId
checks to enforce the complete Microsoft Partner Center rules before submission.
Validate packageId length and reserved-name restrictions instead of accepting
arbitrary periods or lengths, and replace the publisherId prefix-only check with
validation of a complete distinguished-name publisher. Apply the same rules
consistently at both validation sites.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d165a304-a130-4a27-87ec-ed399b9af3e3
📒 Files selected for processing (11)
.sampo/changesets/microsoft-store-submission-preflight.mdREADME.mddocs/PUBLIC_RELEASE_CHECKLIST.mdexamples/phaser-starter/mpgd.microsoft-store.jsonpackage.jsonpackages/cli/src/index.tspackages/cli/src/microsoft-store-submission.tspackages/cli/templates/phaser-game/README.mdpackages/cli/templates/phaser-game/mpgd.microsoft-store.jsonpackages/cli/templates/phaser-game/package.jsontools/smoke/cli-microsoft-store-submission.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfd6500fdb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 761cf07070
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3520eff05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review exact head 2d18324ff7634641647256243fca4897a593a9a0 |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de87b5a787
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
tools/smoke/cli-microsoft-store-submission.ts (2)
111-133: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert that both evidence files are deterministic.
The test validates content only once, so unstable ordering or nondeterministic fields would still pass. Generate the same evidence again and compare the JSON and Markdown bytes exactly.
Proposed coverage
+ const originalJsonEvidence = readFileSync( + join(outputDir, 'submission-preflight.json'), + 'utf8', + ); + const originalMarkdownEvidence = readFileSync( + join(outputDir, 'submission-preflight.md'), + 'utf8', + ); + + runMicrosoftStoreSubmissionPreflight({ + gameRoot, + artifactRoot, + configFile: submissionFile, + jsonFile: join(outputDir, 'submission-preflight.json'), + markdownFile: join(outputDir, 'submission-preflight.md'), + }); + + assert.equal( + readFileSync(join(outputDir, 'submission-preflight.json'), 'utf8'), + originalJsonEvidence, + ); + assert.equal( + readFileSync(join(outputDir, 'submission-preflight.md'), 'utf8'), + originalMarkdownEvidence, + );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/smoke/cli-microsoft-store-submission.ts` around lines 111 - 133, Update the smoke test around the existing evidence assertions to generate the submission-preflight evidence a second time, then compare the JSON and Markdown file contents byte-for-byte with the first generation. Preserve the current semantic assertions while adding exact comparisons for both evidence files to verify deterministic ordering and fields.
356-412: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winVerify rejected symlink outputs cannot mutate external targets.
These tests pass even if validation occurs after an external file is truncated or evidence is written into the linked directory. Assert both targets remain untouched.
Proposed coverage
-import { mkdirSync, readFileSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'; +import { + mkdirSync, + readFileSync, + readdirSync, + rmSync, + symlinkSync, + writeFileSync, +} from 'node:fs';assert.throws( () => runMicrosoftStoreSubmissionPreflight({ ... }), /must not be a symbolic link/u, ); + assert.equal(readFileSync(outsideOutputFile, 'utf8'), 'outside');assert.match(linkedResult.stderr || linkedResult.stdout, /must stay inside the game root/u); + assert.deepEqual(readdirSync(outsideDirectory), []);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/smoke/cli-microsoft-store-submission.ts` around lines 356 - 412, Extend the symlink-output coverage around runMicrosoftStoreSubmissionPreflight and the linkedResult CLI invocation to verify external targets remain unchanged after rejection. Assert outsideOutputFile still contains its original content after the file-symlink failure, and record the initial contents of outsideDirectory before execution, then assert they are identical afterward with no evidence or output written through linkedOutputDirectory.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/index.ts`:
- Line 1149: Update the artifact-root resolution in the callers around the
artifact preflight and attestation flows, including the code using artifactRoot
and the related range, to resolve relative target.output paths against gameRoot
rather than preparedTargetsFile. Preserve absolute output handling and ensure
both validation and attestation use the same game-root-based resolution.
In `@packages/cli/src/microsoft-store-submission.ts`:
- Around line 933-973: Update the PNG chunk validation in the parsing loop to
reject unknown critical chunks rather than treating them as ancillary data,
while preserving acceptance of recognized chunk types. In the PLTE handling
branch, also reject any chunk encountered after foundPalette is already true,
ensuring at most one palette chunk reaches decoding.
---
Nitpick comments:
In `@tools/smoke/cli-microsoft-store-submission.ts`:
- Around line 111-133: Update the smoke test around the existing evidence
assertions to generate the submission-preflight evidence a second time, then
compare the JSON and Markdown file contents byte-for-byte with the first
generation. Preserve the current semantic assertions while adding exact
comparisons for both evidence files to verify deterministic ordering and fields.
- Around line 356-412: Extend the symlink-output coverage around
runMicrosoftStoreSubmissionPreflight and the linkedResult CLI invocation to
verify external targets remain unchanged after rejection. Assert
outsideOutputFile still contains its original content after the file-symlink
failure, and record the initial contents of outsideDirectory before execution,
then assert they are identical afterward with no evidence or output written
through linkedOutputDirectory.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b471c71e-7380-474d-8963-8f9a1e0a898e
📒 Files selected for processing (11)
.sampo/changesets/microsoft-store-submission-preflight.mdREADME.mddocs/PUBLIC_RELEASE_CHECKLIST.mdexamples/phaser-starter/mpgd.microsoft-store.jsonpackage.jsonpackages/cli/src/index.tspackages/cli/src/microsoft-store-submission.tspackages/cli/templates/phaser-game/README.mdpackages/cli/templates/phaser-game/mpgd.microsoft-store.jsonpackages/cli/templates/phaser-game/package.jsontools/smoke/cli-microsoft-store-submission.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af7957e7b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/microsoft-store-submission.ts`:
- Line 393: Update the icon purpose handling around purposes.add so the purpose
string is split on whitespace, each token is normalized to lowercase, and every
token is added to the purposes set. Preserve the subsequent any and maskable
purpose checks using these normalized individual tokens.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: dc560ad8-ec0c-4bf0-ac19-cde6b12d1da0
📒 Files selected for processing (3)
packages/cli/src/microsoft-store-submission.tspackages/cli/templates/phaser-game/README.mdtools/smoke/cli-microsoft-store-submission.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/cli/templates/phaser-game/README.md
- tools/smoke/cli-microsoft-store-submission.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad555aed1a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c12d78ef4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 242caa2c15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
41585f2 to
8d25a94
Compare
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Validation
mise exec -- pnpm checkmise exec -- node tools/run-ttsx.mjs --no-plugins tools/smoke/cli-microsoft-store-submission.tsmise exec -- pnpm validate:target-configmise exec -- pnpm validate:targetsmise exec -- pnpm smoke:adapter-effective-configSAMPO_RELEASE_BRANCH=main mise exec -- pnpm sampo:release:dry-runRelease
Includes a Sampo minor changeset for
@mpgd/clibecause this adds a public CLI command, exported APIs, and starter integration contract.Summary by CodeRabbit
New Features
Documentation
Tests