fix(deploy): make storev2 and admin staging builds runnable#331

closed3
feat/027-phase7b-staging-safety
feat/027-phase7c-staging-deploy-builds
openedSep 3, 2026byAAviddaram
View on GitHubTwo-way sync enabledPR last imported 19d ago

Summary

Unblocks Alchemy staging deploys for storefront + admin after #330.

  • storev2: build is astro build only. astro check stays on check-types โ€” it crashes under TypeScript 7 (ts.sys is empty, so @astrojs/language-server blows up on fileExists).
  • admin: Alchemy Vite defaulted to bunx vite build; this app builds with Vite+ (bun run build โ†’ vp build). Also load root .env.${stage} like storev2.

Stacks on #330.

Test plan

  • bunx alchemy deploy --app admin --stage staging --env-file ../../.env.staging
  • bunx alchemy deploy --app storev2 --stage staging --env-file ../../.env.staging
  • admin-staging.amerikvitamin.mn and staging.amerikvitamin.mn respond

Checks

2 failing ยท 3 successful ยท 1 skipped
Some checks failed

Failing2

3979420

Added 1 commit

  • fix(deploy): make storev2 and admin staging builds runnablec732b3f
Synced from GitHub

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

๐Ÿ—‚๏ธ Base branches to auto review (1)
  • v2

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

โš™๏ธ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 43941c6c-9a7b-4e84-b611-77cdf44ca8e9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ๐Ÿ” Trigger review

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.

Synced from GitHub

Greptile Summary

The PR adjusts staging/deployment builds to use repository-root environment files, invokes the admin application's Vite+ build script through Alchemy, and lets StoreV2 builds proceed without the currently broken inline Astro check.

  • Aligns the admin Alchemy environment path with sibling applications and deployment scripts.
  • Configures the admin deployment to run its package build command.
  • Keeps StoreV2 type checking as a separate command and CI validation rather than part of every build.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure identified.

The admin environment and build changes match existing repository paths and scripts, while StoreV2 retains independent Astro validation in CI despite removing it from the deployment build command.

Important Files Changed

FilenameOverview
apps/admin/alchemy.run.tsAligns stage environment loading with repository conventions and configures Alchemy to invoke the admin Vite+ build command with matching working and output directories.
apps/storev2/package.jsonRemoves the incompatible inline Astro check from builds while retaining the dedicated check-types script and separate CI checks.

Reviews (1): Last reviewed commit: "fix(deploy): make storev2 and admin stag..." | Re-trigger Greptile

Added 1 commit

  • fix(storev2): drop valibot from unbundled worker entrypointbc49e2b

Follow-up: storev2 build succeeded on staging but worker upload failed with No such module "valibot" from unbundled worker.mjs. Removed the bare valibot import; cache-tag checks now use JSON string shape + Cloudflare tag grammar.

Cchatgpt-codex-connectorBotreviewed ยท 1 inline threadSep 3, 2026
Synced from GitHub

๐Ÿ’ก Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc49e2b1c2

โ„น๏ธ 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".

apps/storev2/worker.mjslines 11โ€“15Outdated ยท bc49e2bOpen thread
โ€ฆโ€ฆ@@ -1,9 +1,20 @@
12+ if (encoded === undefined || encoded[0] !== '"' || encoded.at(-1) !== '"') {
13+ return false;
14+ }
15+ return CACHE_TAG.test(JSON.parse(encoded));
Cchatgpt-codex-connectorBoton lines 11โ€“15Sep 3, 2026

P2 Badge Reject nonprimitive cache tags before purging

When a service-binding caller supplies a boxed string such as new String("products"), or another value whose JSON representation is a string, isCacheTag returns true even though the original value is not a string. purgeCache then forwards that original object to cache.purge, whose local contract expects Array<string> (packages/api/src/lib/context.ts:24), so malformed RPC input can make cache invalidation fail and leave stale storefront content. Reject nonprimitive values or return and use the decoded string instead of validating a transformed copy.

AGENTS.md reference: AGENTS.md:L43-L46

Useful? React with ๐Ÿ‘ย / ๐Ÿ‘Ž.

Added 1 commit

  • fix(api): return txResult.total from addOrder3979420

Staging dogfood (search โ†’ cart โ†’ checkout โ†’ QPay)

Went through https://staging.amerikvitamin.mn with agent-browser:

  1. Search `ะผะฐะณะฝะธ` โ†’ add Naturebell Magnesium Complex
  2. Cart โ†’ checkout form (phone + address)
  3. First `addOrder` 500 โ€” Phase 7 left `resolvedTotal` undefined in `order.addOrder`
  4. Fixed in `3979420`, redeployed `server` staging
  5. Resume unfinished payment โ†’ QPay QR invoice live at `/payment/Y75FSANAUC` (order `#64G85RE5`, โ‚ฎ116,000)

Closing: this branch's head commit is already in main (Plan 027 lint stack landed via merge 4bf54d3).