fix: VITE_API_URL hardcoding that breaks CI E2E (GRO-1280)

fix: resolve VITE_API_URL hardcoding that breaks CI E2E (GRO-1280)
This commit was merged in pull request #415.
This commit is contained in:
the-dogfather-cto[bot]
2026-05-14 20:11:31 +00:00
committed by GitHub
4 changed files with 15 additions and 5 deletions
+3 -1
View File
@@ -119,6 +119,8 @@ jobs:
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: Build all packages - name: Build all packages
env:
VITE_API_URL: ""
run: pnpm build run: pnpm build
docker: docker:
@@ -340,7 +342,7 @@ jobs:
name: Update Infra Image Tags name: Update Infra Image Tags
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [docker] needs: [docker]
if: github.ref == 'refs/heads/main' && github.event_name == 'push' if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push'
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
+2
View File
@@ -11,6 +11,8 @@ RUN pnpm install --frozen-lockfile
# Build # Build
FROM deps AS builder FROM deps AS builder
ARG VITE_API_URL=
ENV VITE_API_URL=
COPY packages/types/ packages/types/ COPY packages/types/ packages/types/
COPY apps/web/ apps/web/ COPY apps/web/ apps/web/
RUN pnpm --filter @groombook/web build RUN pnpm --filter @groombook/web build
+1 -1
View File
@@ -1,7 +1,7 @@
import { createAuthClient } from "better-auth/react"; import { createAuthClient } from "better-auth/react";
export const authClient = createAuthClient({ export const authClient = createAuthClient({
baseURL: import.meta.env.VITE_API_URL ?? "", baseURL: import.meta.env.VITE_API_URL || window.location.origin,
}); });
export const { signIn, signOut, useSession, changePassword } = authClient; export const { signIn, signOut, useSession, changePassword } = authClient;
+9 -3
View File
@@ -883,6 +883,7 @@ async function seed() {
let appointmentCount = 0; let appointmentCount = 0;
let invoiceCount = 0; let invoiceCount = 0;
let visitLogCount = 0; let visitLogCount = 0;
let paidInvoiceCounter = 0;
// Process in batches per client to keep memory manageable // Process in batches per client to keep memory manageable
const apptBatchSize = 100; const apptBatchSize = 100;
@@ -977,8 +978,11 @@ async function seed() {
const invoiceStatus = rand() < 0.95 ? "paid" as const : "pending" as const; const invoiceStatus = rand() < 0.95 ? "paid" as const : "pending" as const;
const paidAt = invoiceStatus === "paid" ? new Date(endTime.getTime() + randInt(5, 30) * 60 * 1000) : null; const paidAt = invoiceStatus === "paid" ? new Date(endTime.getTime() + randInt(5, 30) * 60 * 1000) : null;
paidInvoiceCounter++;
const stripePaymentIntentId = invoiceStatus === "paid"
? `pi_test_seed_${String(paidInvoiceCounter).padStart(6, "0")}`
: null;
const stripePaymentIntentId = invoiceStatus === "paid" && rand() < 0.2 ? `pi_test_${uuid().replace(/-/g, "").slice(0, 24)}` : null;
invoiceBatch.push({ invoiceBatch.push({
id: invoiceId, id: invoiceId,
appointmentId: apptId, appointmentId: apptId,
@@ -1094,14 +1098,16 @@ async function seed() {
const taxCents = Math.round(effectivePrice * 0.08); const taxCents = Math.round(effectivePrice * 0.08);
const totalCents = effectivePrice + taxCents + tipCents; const totalCents = effectivePrice + taxCents + tipCents;
const paidAt = new Date(endTime.getTime() + randInt(5, 30) * 60 * 1000); const paidAt = new Date(endTime.getTime() + randInt(5, 30) * 60 * 1000);
const stripePaymentIntentId = rand() < 0.2 ? `pi_test_${uuid().replace(/-/g, "").slice(0, 24)}` : null; paidInvoiceCounter++;
invoiceBatch.push({ invoiceBatch.push({
id: invoiceId, appointmentId: apptId, clientId, id: invoiceId, appointmentId: apptId, clientId,
subtotalCents: effectivePrice, taxCents, tipCents, totalCents, subtotalCents: effectivePrice, taxCents, tipCents, totalCents,
status: "paid" as const, status: "paid" as const,
paymentMethod: pick(["cash", "card", "card", "card", "check"]) as "cash" | "card" | "check", paymentMethod: pick(["cash", "card", "card", "card", "check"]) as "cash" | "card" | "check",
paidAt, stripePaymentIntentId, notes: null, paidAt,
stripePaymentIntentId: `pi_test_seed_${String(paidInvoiceCounter).padStart(6, "0")}`,
notes: null,
}); });
lineItemBatch.push({ lineItemBatch.push({
id: uuid(), invoiceId, description: svc.name, quantity: 1, id: uuid(), invoiceId, description: svc.name, quantity: 1,