Skip to content

feat(cli): enforce production target readiness - #46

Merged
imjlk merged 8 commits into
mainfrom
codex/production-target-readiness
Jul 12, 2026
Merged

imjlk merged 8 commits into
mainfrom
codex/production-target-readiness

Conversation

@imjlk

@imjlk imjlk commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a shared production preflight for AIT, Android, and iOS target builds
  • require game-owned wrapper/shell paths using canonical real-path containment checks
  • require a public HTTPS game-services endpoint and reject credentials, local hosts, and non-public literal IPs
  • keep reference-wrapper starter validation on the staging profile and document the production handoff

Validation

  • pnpm check
  • pnpm smoke:production-target-readiness
  • pnpm smoke:cli-game-release-inputs
  • Open Code Review on each commit; actionable profile deduplication feedback applied, follow-up review clean

Release

  • adds a Sampo minor changeset for @mpgd/cli

Summary by CodeRabbit

  • New Features

    • Added production build readiness checks for AIT, Android, and iOS targets.
    • Production builds now require dedicated in-game wrappers or shells and a public HTTPS game-services endpoint.
    • Added safeguards against unsafe paths, symlink escapes, private networks, localhost, and embedded URL credentials.
  • Documentation

    • Updated build instructions and starter templates to use explicit staging profiles where appropriate.
    • Added guidance on production target requirements.
  • Bug Fixes

    • Standardized platform build commands across staging CI workflows.

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai

coderabbitai Bot commented Jul 12, 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: 9 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: 163da977-ce58-47d2-b391-ae98f8b6fbc8

📥 Commits

Reviewing files that changed from the base of the PR and between 7228ddd and e55de42.

📒 Files selected for processing (6)
  • packages/cli/src/index.ts
  • packages/cli/src/production-target-readiness.ts
  • tools/smoke/android-emulator.ts
  • tools/smoke/build-target-artifacts.ts
  • tools/smoke/ios-simulator.ts
  • tools/smoke/production-target-readiness.ts
📝 Walkthrough

Walkthrough

Production target builds now enforce ownership, path, and public HTTPS readiness checks. CLI and build tooling invoke the checks, smoke coverage exercises valid and invalid cases, and CI, templates, and documentation use explicit staging profiles.

Changes

Production target readiness

Layer / File(s) Summary
Readiness validation contract and rules
packages/cli/src/production-target-readiness.ts
Adds production-only validation for prepared target configuration, canonical game-owned paths, dedicated wrapper/shell directories, and public HTTPS game-services URLs.
Build and CLI integration
packages/cli/src/index.ts, tools/target/build-target.ts
Exports the readiness assertion, passes explicit profiles through target builds, and runs readiness checks before Vite builds.
Readiness smoke coverage and command wiring
tools/smoke/production-target-readiness.ts, package.json
Adds fixture-based success and failure coverage for URL, target configuration, path, and symlink cases, exposed through a new smoke script.
Staging workflow and guidance
.github/workflows/ci.yml, docs/GAME_DEVELOPMENT.md, packages/cli/templates/phaser-game/*, .sampo/changesets/*
Uses staging profiles for platform and template builds and documents production readiness constraints.

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

Sequence Diagram(s)

sequenceDiagram
  participant BuildTarget
  participant ReadinessCheck
  participant Vite
  BuildTarget->>ReadinessCheck: validate production target inputs
  ReadinessCheck-->>BuildTarget: approve or reject build
  BuildTarget->>Vite: invoke target build after approval
Loading

Possibly related PRs

  • imjlk/mpgd-kit#36: Overlaps in tools/target/build-target.ts while extending build-time environment and preflight handling.

Poem

A bunny checks the paths with care,
And guards the HTTPS gateway there.
Staging hops through every build,
While unsafe routes are firmly stilled.
CI thumps its happy feet—
Production readiness is complete!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% 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 clearly and concisely summarizes the main change: enforcing production target readiness in the CLI.
Description check ✅ Passed The description matches the template well with Summary and Validation, but it is missing the required Notes section.
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/production-target-readiness

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.

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 7aae51eaa4

ℹ️ 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 packages/cli/src/index.ts Resolved
Comment thread packages/cli/src/index.ts Resolved
@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 7228dddc73

ℹ️ 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/target/build-target.ts Resolved
@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 0bc254d1cd

ℹ️ 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 packages/cli/src/index.ts Resolved
Comment thread tools/target/build-target.ts Resolved
@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 3b397520c1

ℹ️ 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 commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: e55de423f4

ℹ️ 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 fd32478 into main Jul 12, 2026
6 checks passed
@imjlk
imjlk deleted the codex/production-target-readiness branch July 12, 2026 17:02
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