From c65b225ba7da85a59929cfb4fc8d2f785ad61f45 Mon Sep 17 00:00:00 2001 From: "Arjun (OpenClaw)" Date: Sat, 7 Feb 2026 15:57:25 +0000 Subject: [PATCH 1/2] fix: dockerfiles build in compose context - backend: copy dependency lockfiles from backend/ when build context is repo root - frontend: don't copy public/ when it doesn't exist --- backend/Dockerfile | 3 ++- frontend/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 6e0a28e5..9fc59a1c 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -20,7 +20,8 @@ ENV PATH="/root/.local/bin:${PATH}" FROM base AS deps # Copy only dependency metadata first for better build caching -COPY pyproject.toml uv.lock ./ +# NOTE: compose builds backend with repo-root context, so files live under /backend. +COPY backend/pyproject.toml backend/uv.lock ./ # Create venv and sync deps (including runtime) RUN uv sync --frozen --no-dev diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 4a87dcd6..fb396bf9 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -28,7 +28,8 @@ ENV NODE_ENV=production ENV NEXT_PUBLIC_API_URL=http://localhost:8000 COPY --from=builder /app/.next ./.next -COPY --from=builder /app/public ./public +# `public/` is optional in Next.js apps; repo may not have it. +# Avoid failing the build when the directory is absent. COPY --from=builder /app/package.json ./package.json COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/next.config.ts ./next.config.ts From 8f08a8e9dce0552ed8f7af46ffe9fe5d162829fc Mon Sep 17 00:00:00 2001 From: Riya Date: Sat, 7 Feb 2026 17:33:52 +0000 Subject: [PATCH 2/2] test(e2e): add Clerk OTP login helper (cy.origin) --- frontend/cypress/e2e/clerk_login.cy.ts | 19 +++++ frontend/cypress/support/commands.ts | 100 +++++++++++++++++++++++++ frontend/cypress/support/e2e.ts | 2 + frontend/src/app/activity/page.tsx | 4 +- 4 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 frontend/cypress/e2e/clerk_login.cy.ts create mode 100644 frontend/cypress/support/commands.ts diff --git a/frontend/cypress/e2e/clerk_login.cy.ts b/frontend/cypress/e2e/clerk_login.cy.ts new file mode 100644 index 00000000..369213a5 --- /dev/null +++ b/frontend/cypress/e2e/clerk_login.cy.ts @@ -0,0 +1,19 @@ +describe("Clerk login (OTP)", () => { + it("can sign in via Clerk modal", () => { + // Skip unless explicitly configured. + const clerkOrigin = Cypress.env("CLERK_ORIGIN"); + const email = Cypress.env("CLERK_TEST_EMAIL"); + const otp = Cypress.env("CLERK_TEST_OTP"); + + if (!clerkOrigin || !email || !otp) { + cy.log("Skipping: missing CYPRESS_CLERK_ORIGIN / CYPRESS_CLERK_TEST_EMAIL / CYPRESS_CLERK_TEST_OTP"); + return; + } + + cy.visit("/activity"); + cy.loginWithClerkOtp(); + + // After login, the SignedIn UI should render. + cy.contains(/live feed/i, { timeout: 20_000 }).should("be.visible"); + }); +}); diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts new file mode 100644 index 00000000..43e0a070 --- /dev/null +++ b/frontend/cypress/support/commands.ts @@ -0,0 +1,100 @@ +/// + +type ClerkOtpLoginOptions = { + clerkOrigin: string; + email: string; + otp: string; +}; + +function requireEnv(name: string): string { + const value = Cypress.env(name) as string | undefined; + if (!value) { + throw new Error( + `Missing Cypress env var ${name}. ` + + `Set it via CYPRESS_${name}=... in CI/local before running Clerk login tests.`, + ); + } + return value; +} + +function normalizeOrigin(value: string): string { + try { + const url = new URL(value); + return url.origin; + } catch { + // allow providing just an origin-like string + return value.replace(/\/$/, ""); + } +} + +Cypress.Commands.add("loginWithClerkOtp", () => { + const clerkOrigin = normalizeOrigin(requireEnv("CLERK_ORIGIN")); + const email = requireEnv("CLERK_TEST_EMAIL"); + const otp = requireEnv("CLERK_TEST_OTP"); + + const opts: ClerkOtpLoginOptions = { clerkOrigin, email, otp }; + + // Trigger the modal from the app first. + cy.get('[data-testid="activity-signin"]').click({ force: true }); + + // The Clerk UI is typically hosted on a different origin (clerk.accounts.dev / clerk.com). + // Use cy.origin to drive the UI in Chrome. + cy.origin( + opts.clerkOrigin, + { args: { email: opts.email, otp: opts.otp } }, + ({ email, otp }) => { + // Email / identifier input + cy.get('input[type="email"], input[name="identifier"], input[autocomplete="email"]', { + timeout: 20_000, + }) + .first() + .clear() + .type(email, { delay: 10 }); + + // Submit / continue + cy.get('button[type="submit"], button') + .contains(/continue|sign in|send|next/i) + .click({ force: true }); + + // OTP input - Clerk commonly uses autocomplete=one-time-code + cy.get('input[autocomplete="one-time-code"], input[name*="code"], input[inputmode="numeric"]', { + timeout: 20_000, + }) + .first() + .clear() + .type(otp, { delay: 10 }); + + // Final submit (some flows auto-submit) + cy.get("body").then(($body) => { + const hasSubmit = $body + .find('button[type="submit"], button') + .toArray() + .some((el) => /verify|continue|sign in|confirm/i.test(el.textContent || "")); + if (hasSubmit) { + cy.get('button[type="submit"], button') + .contains(/verify|continue|sign in|confirm/i) + .click({ force: true }); + } + }); + }, + ); +}); + +declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Cypress { + interface Chainable { + /** + * Logs in via the real Clerk modal using deterministic OTP credentials. + * + * Requires env vars: + * - CYPRESS_CLERK_ORIGIN (e.g. https://.clerk.accounts.dev) + * - CYPRESS_CLERK_TEST_EMAIL + * - CYPRESS_CLERK_TEST_OTP + */ + loginWithClerkOtp(): Chainable; + } + } +} + +export {}; diff --git a/frontend/cypress/support/e2e.ts b/frontend/cypress/support/e2e.ts index 818758dd..8c97169f 100644 --- a/frontend/cypress/support/e2e.ts +++ b/frontend/cypress/support/e2e.ts @@ -1,2 +1,4 @@ // Cypress support file. // Place global hooks/commands here. + +import "./commands"; diff --git a/frontend/src/app/activity/page.tsx b/frontend/src/app/activity/page.tsx index 73257eb0..2b8ba0d1 100644 --- a/frontend/src/app/activity/page.tsx +++ b/frontend/src/app/activity/page.tsx @@ -302,7 +302,9 @@ export default function ActivityPage() { forceRedirectUrl="/activity" signUpForceRedirectUrl="/activity" > - +