Skip to content

Share Microsoft Store PWA release checks - #81

Merged
imjlk merged 3 commits into
mainfrom
codex/pwa-release-contract
Jul 15, 2026
Merged

imjlk merged 3 commits into
mainfrom
codex/pwa-release-contract

Conversation

@imjlk

@imjlk imjlk commented Jul 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • expose Playwright-compatible helpers for reading PWA release evidence, requesting service-worker updates, and verifying deployment-scoped atomic cache transitions
  • reuse the public release-evidence contract in target generation and verify emitted manifests preserve source metadata
  • add focused smoke coverage, documentation, and a Sampo minor changeset for @mpgd/cli

Why

Game harnesses were duplicating cache-name resolution and A→B update assertions, while artifact smoke only checked manifest shape. That allowed drift between generated release evidence, runtime playtests, and source manifest metadata.

Impact

Games keep Playwright, server switching, and game-specific selectors locally, while importing the shared PWA contract and transition assertions from @mpgd/cli. Production target smoke now rejects non-icon manifest metadata drift.

Review

OpenCodeReview was run against the final change. Its valid findings were addressed by restoring the producer's strict 40-character lowercase Git SHA contract, trimming validated strings, and correcting the cache-name smoke expectation.

Validation

  • pnpm check
  • pnpm test
  • fresh-cache ttsx Microsoft Store PWA browser helper smoke
  • production Microsoft Store build with clean provenance
  • pnpm smoke:target microsoft-store

Summary by CodeRabbit

  • New Features
    • Added Microsoft Store PWA browser testing helpers for reading release evidence, requesting updates, and verifying cache transitions between releases.
    • Added validation for release metadata, cache state, stale content exclusion, and preserved caches.
  • Documentation
    • Documented Microsoft Store PWA update testing workflows and verification responsibilities.
  • Bug Fixes
    • Added manifest consistency checks to detect mismatches between source and built PWA manifests.
  • Tests
    • Added smoke coverage for Microsoft Store PWA update behavior and manifest validation.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@imjlk, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d985ccd3-96b1-4f72-be2f-702d3626e6b2

📥 Commits

Reviewing files that changed from the base of the PR and between cf70759 and cc4f876.

📒 Files selected for processing (5)
  • packages/cli/src/index.ts
  • packages/cli/src/microsoft-store-pwa-e2e.ts
  • tools/smoke/cli-microsoft-store-pwa-e2e.ts
  • tools/smoke/verify-target-artifacts.ts
  • tools/target/microsoft-store-pwa.ts
📝 Walkthrough

Walkthrough

Adds Microsoft Store PWA browser E2E helpers, shared release-evidence validation, cache-transition assertions, smoke coverage, public exports, documentation, and source-to-built manifest contract checks.

Changes

Microsoft Store PWA validation and E2E flow

Layer / File(s) Summary
Release evidence contract and validation
packages/cli/src/microsoft-store-pwa-e2e.ts
Defines release evidence types and validates schema, cache identity, URL ordering, revision, and Git SHA constraints.
Browser update and cache transition flow
packages/cli/src/microsoft-store-pwa-e2e.ts
Reads browser evidence, requests service-worker updates, inspects scoped caches, and verifies release A-to-B transition invariants.
Target evidence reuse and manifest verification
tools/target/microsoft-store-pwa.ts, tools/smoke/verify-target-artifacts.ts, tools/smoke/verify-target-artifacts.test.ts
Delegates target evidence validation to the shared helper and checks built Microsoft Store manifests against source manifests, excluding icons.
Public exports, smoke coverage, and usage documentation
packages/cli/src/index.ts, tools/smoke/cli-microsoft-store-pwa-e2e.ts, package.json, docs/GAMEPLAY_E2E.md, .sampo/changesets/*
Exports the helpers, adds prepared smoke-test execution and simulated browser coverage, documents the flow, and records the CLI minor release.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant CLIHelpers
  participant CacheStorage
  Browser->>CLIHelpers: read release evidence
  CLIHelpers->>Browser: request service-worker update
  Browser->>CLIHelpers: inspect activated caches
  CLIHelpers->>CacheStorage: read release B index and cache keys
  CacheStorage-->>CLIHelpers: transition observations
  CLIHelpers-->>Browser: validated transition evidence
Loading

Possibly related PRs

  • imjlk/mpgd-kit#17: Related Microsoft Store PWA manifest verification changes.
  • imjlk/mpgd-kit#50: Related Microsoft Store PWA release evidence and service-worker validation.

Poem

A bunny hops from A to B,
Through scoped caches carefully.
The worker wakes, old crumbs depart,
New release indexes play their part.
With tests and docs in tidy rows,
The PWA update safely grows.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: sharing Microsoft Store PWA release checks.
Description check ✅ Passed The description covers summary, motivation, impact, review, and validation; only the Notes section from the template is missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/pwa-release-contract

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/cli/src/microsoft-store-pwa-e2e.ts (1)

106-112: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Correct getRegistration parameter typing and usage.

The parameter for ServiceWorkerContainer.getRegistration() is an optional clientURL, not a scope. Supplying no arguments guarantees returning the registration that controls the current document exactly, mitigating the risk of mismatch from './' relative resolution.

♻️ Proposed refactor
-          getRegistration(scope: string): Promise<{
+          getRegistration(clientURL?: string): Promise<{
             update(): Promise<unknown>;
           } | undefined>;
         };
       };
     };
-    const registration = await browser.navigator.serviceWorker.getRegistration('./');
+    const registration = await browser.navigator.serviceWorker.getRegistration();
🤖 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 `@packages/cli/src/microsoft-store-pwa-e2e.ts` around lines 106 - 112, Update
the local ServiceWorkerContainer declaration around getRegistration so its
parameter is optional and represents clientURL rather than a required scope,
then call getRegistration without arguments in the registration lookup. Preserve
the existing registration update flow.
🤖 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-pwa-e2e.ts`:
- Around line 155-171: In the cache inspection flow, capture the result of
browser.caches.keys() before calling browser.caches.open for scopedCacheNames.b.
Update the return in the surrounding function to reuse that pre-open cache-name
snapshot, while preserving the existing cache match and missing-index
validation.
- Around line 356-358: Update the protocol validation near the service worker
registration scope check to accept file: alongside http: and https:. Keep
rejecting all other protocols and preserve the existing error behavior for
unsupported values.

---

Nitpick comments:
In `@packages/cli/src/microsoft-store-pwa-e2e.ts`:
- Around line 106-112: Update the local ServiceWorkerContainer declaration
around getRegistration so its parameter is optional and represents clientURL
rather than a required scope, then call getRegistration without arguments in the
registration lookup. Preserve the existing registration update flow.
🪄 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: 3486bee1-6c76-43c7-afb2-6db9f63de571

📥 Commits

Reviewing files that changed from the base of the PR and between 8934ce1 and cf70759.

📒 Files selected for processing (9)
  • .sampo/changesets/microsoft-store-pwa-browser-e2e.md
  • docs/GAMEPLAY_E2E.md
  • package.json
  • packages/cli/src/index.ts
  • packages/cli/src/microsoft-store-pwa-e2e.ts
  • tools/smoke/cli-microsoft-store-pwa-e2e.ts
  • tools/smoke/verify-target-artifacts.test.ts
  • tools/smoke/verify-target-artifacts.ts
  • tools/target/microsoft-store-pwa.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf70759d01

ℹ️ 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".

Comment thread tools/smoke/verify-target-artifacts.ts Resolved
@imjlk

imjlk commented Jul 15, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review\n\nAddressed the valid cache-observation and getRegistration findings in cec4329. The file: suggestion was intentionally declined with rationale in its thread. Please re-review the updated commit.

@imjlk

imjlk commented Jul 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review\n\nAddressed all four P2 findings in cc4f876 and resolved their threads. Please review the updated commit.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: cc4f876077

ℹ️ 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".

@imjlk
imjlk merged commit 59640c1 into main Jul 15, 2026
6 checks passed
@imjlk
imjlk deleted the codex/pwa-release-contract branch July 15, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant