Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,56 @@ jobs:
path: ${{ steps.openclaw-store.outputs.path }}
key: ${{ steps.openclaw-cache.outputs.cache-primary-key }}

component-upgrade:
name: component-upgrade
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
PLAYWRIGHT_LOCAL_AUTH_BACKEND_VERSION: precompiled-2026-10-22-1447815

steps:
- uses: actions/checkout@v7.0.1

- uses: ./.github/actions/setup-bun

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24.22.1

- name: Fetch the pinned pre-upgrade application
run: git -c maintenance.auto=false -c gc.auto=0 fetch --no-tags --depth=1 origin 252a3f86d05331ea5944ad7749165fafb282097e

- name: Cache the pinned Convex backend
uses: actions/cache@v6
with:
path: ~/.cache/convex/binaries/${{ env.PLAYWRIGHT_LOCAL_AUTH_BACKEND_VERSION }}
key: ${{ runner.os }}-${{ runner.arch }}-convex-${{ env.PLAYWRIGHT_LOCAL_AUTH_BACKEND_VERSION }}-7be627d8a8c9175b

- name: Prepare the pinned Convex backend
timeout-minutes: 5
run: |
set -euo pipefail
backend_dir="$HOME/.cache/convex/binaries/$PLAYWRIGHT_LOCAL_AUTH_BACKEND_VERSION"
if [[ -x "$backend_dir/convex-local-backend" ]]; then
exit 0
fi
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
curl --fail --show-error --location --retry 3 --retry-all-errors \
--retry-delay 5 --connect-timeout 15 --max-time 60 \
--header 'Accept: application/octet-stream' \
--output "$scratch/backend.zip" \
https://api.github.com/repos/convex/convex-backend/releases/assets/667377511
echo "7be627d8a8c9175b66a55cf6c4ab63c5f6bde1c412f59fbbe93f64a24a11bd13 $scratch/backend.zip" | sha256sum --check
unzip -p "$scratch/backend.zip" convex-local-backend > "$scratch/convex-local-backend"
install -D -m 755 "$scratch/convex-local-backend" "$backend_dir/convex-local-backend"

- name: Prove component data survives a forward upgrade
run: bun run test:component-upgrade

unit:
name: unit
needs: component-upgrade
runs-on: ubuntu-24.04
timeout-minutes: 10

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- Browser tests: retain the local Convex backend after its first push with Convex 1.51, while configuring test environment variables before publishing functions.

- Management: show Publisher abuse for unsupported view links instead of an empty page. Selected skill and plugin links keep their existing precedence.

- Link previews: release the rendered image and renderer after PNG generation, including when rendering fails.
Expand Down
120 changes: 60 additions & 60 deletions bun.lock

Large diffs are not rendered by default.

29 changes: 3 additions & 26 deletions convex/componentUpgrade.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/// <reference types="vite/client" />
/* @vitest-environment edge-runtime */
import rateLimiter from "@convex-dev/rate-limiter/test";
import workpool from "@convex-dev/workpool/test";
import { convexTest } from "convex-test";
import previousRateLimiter from "rate-limiter-previous/test";
import { expect, it, vi } from "vitest";
import previousWorkpool from "workpool-previous/test";
import { api, internal } from "./_generated/api";
import { internal } from "./_generated/api";
import schema from "./schema";

type Modules = Record<string, () => Promise<unknown>>;
Expand All @@ -24,7 +22,7 @@ function switchingModules(previous: Modules, current: Modules, upgraded: () => b
);
}

it("retains consumed quota and queued reports when component implementations change", async () => {
it("retains consumed quota when rate limiter implementations change", async () => {
vi.useFakeTimers();
vi.setSystemTime(Date.UTC(2026, 8, 16));
try {
Expand All @@ -36,9 +34,8 @@ it("retains consumed quota and queued reports when component implementations cha
rateLimiter.modules,
() => upgraded,
),
searchReports: switchingModules(previousWorkpool.modules, workpool.modules, () => upgraded),
};
// Register once: replacing registrations would erase component data and queued jobs.
// Register once: replacing registrations would erase the consumed quota.
// The candidate's additive schema is used throughout; this proves runtime continuity,
// not a backend deployment or schema migration.
const registration: typeof t = {
Expand All @@ -47,7 +44,6 @@ it("retains consumed quota and queued reports when component implementations cha
t.registerComponent(name, componentSchema, implementations[name] ?? modules),
};
rateLimiter.register(registration, "rateLimiterV2");
workpool.register(registration, "searchReports");

const quota = {
name: "component-upgrade",
Expand All @@ -57,18 +53,7 @@ it("retains consumed quota and queued reports when component implementations cha
expect(await t.mutation(internal.rateLimits.consumeHttpRateLimitKeyInternal, quota)).toEqual({
ok: true,
});
const staff = await t.run((ctx) => ctx.db.insert("users", { role: "moderator" }));
const signed = t.withIdentity({ subject: staff });
const queued = await signed.mutation(api.searchReports.start, {
view: "recommendations",
artifactKind: "plugin",
});
expect(queued.status).toBe("pending");
const before = await t.run((ctx) => ctx.db.query("searchReportRuns").unique());
expect(before?.workId).toBeTruthy();

upgraded = true;
expect(await t.run((ctx) => ctx.db.query("searchReportRuns").unique())).toEqual(before);
const denied = await t.run(async (ctx) => ({
now: Date.now(),
status: await ctx.runMutation(internal.rateLimits.consumeHttpRateLimitKeyInternal, quota),
Expand All @@ -87,14 +72,6 @@ it("retains consumed quota and queued reports when component implementations cha
expect(await t.mutation(internal.rateLimits.consumeHttpRateLimitKeyInternal, quota)).toEqual({
ok: true,
});
await t.finishAllScheduledFunctions(vi.runAllTimers);
const ready = await signed.action(api.searchReports.get, { reportId: queued.reportId });
expect(ready.status).toBe("ready");
const reused = await signed.mutation(api.searchReports.start, {
view: "recommendations",
artifactKind: "plugin",
});
expect(reused).toMatchObject({ reportId: queued.reportId, status: "ready" });
} finally {
vi.useRealTimers();
}
Expand Down
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"skills-sh:prove-trending": "bun scripts/skills-sh-catalog/prove-trending-test.ts",
"skills:install": "npx --yes skills@1.5.16 add openclaw/carapace --skill openclaw-design openclaw-brand openclaw-carapace openclaw-design-system openclaw-marketing-pages openclaw-design-audit --agent codex --copy --yes",
"test": "vitest run",
"test:component-upgrade": "bun scripts/test-component-upgrade.ts",
"test:e2e": "vitest run -c vitest.e2e.config.ts",
"test:e2e:local": "bash scripts/run-playwright-local.sh",
"test:e2e:prod-http": "vitest run -c vitest.e2e.config.ts e2e/prod-http-smoke.e2e.test.ts",
Expand All @@ -96,9 +97,9 @@
"dependencies": {
"@auth/core": "0.41.3",
"@convex-dev/auth": "0.0.98",
"@convex-dev/migrations": "0.3.8",
"@convex-dev/migrations": "0.3.9",
"@convex-dev/rate-limiter": "0.4.3",
"@convex-dev/workpool": "0.4.15",
"@convex-dev/workpool": "0.5.0",
"@fontsource/bricolage-grotesque": "5.3.0",
"@fontsource/ibm-plex-mono": "5.3.0",
"@fontsource/noto-sans-sc": "5.3.1",
Expand All @@ -121,20 +122,20 @@
"@resvg/resvg-wasm": "2.6.2",
"@shikijs/rehype": "4.6.0",
"@tanstack/react-router": "1.170.46",
"@tanstack/react-start": "1.169.5",
"@vercel/oidc": "4.0.8",
"arktype": "2.2.9",
"@tanstack/react-start": "1.169.7",
"@vercel/oidc": "4.0.9",
"arktype": "2.2.10",
"class-variance-authority": "0.7.1",
"clawhub-schema": "workspace:0.0.2",
"clsx": "2.1.1",
"convex": "1.49.0",
"convex-helpers": "0.1.135",
"convex": "1.51.0",
"convex-helpers": "0.1.136",
"fflate": "0.8.3",
"franc-min": "6.2.0",
"h3": "2.0.8",
"ignore": "7.0.14",
"jose": "6.2.17",
"lucide-react": "1.72.0",
"ignore": "7.0.16",
"jose": "6.2.18",
"lucide-react": "1.77.0",
"mermaid": "^11.17.2",
"mime": "4.1.2",
"monaco-editor": "0.57.0",
Expand All @@ -146,13 +147,13 @@
"rehype-raw": "7.0.0",
"rehype-sanitize": "6.0.0",
"remark-gfm": "4.0.1",
"resend": "6.38.1",
"resend": "6.39.0",
"saxes": "6.0.0",
"semver": "7.8.6",
"sharp": "0.35.5",
"shiki": "4.6.0",
"sonner": "2.0.8",
"tailwind-merge": "3.7.0",
"tailwind-merge": "3.7.1",
"tailwindcss": "4.3.5",
"tw-animate-css": "1.4.0",
"unified": "11.0.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/clawhub-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
},
"dependencies": {
"@clack/prompts": "1.9.0",
"arktype": "2.2.9",
"arktype": "2.2.10",
"commander": "15.1.0",
"fflate": "0.8.3",
"ignore": "7.0.14",
"ignore": "7.0.16",
"json5": "2.2.3",
"mime": "4.1.2",
"ora": "10.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/clawhub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
"dependencies": {
"@clack/prompts": "1.9.0",
"@openclaw/plugin-inspector": "0.4.6",
"arktype": "2.2.9",
"arktype": "2.2.10",
"commander": "15.1.0",
"croner": "11.0.0",
"croner": "11.0.1",
"fflate": "0.8.3",
"ignore": "7.0.14",
"ignore": "7.0.16",
"json5": "2.2.3",
"mime": "4.1.2",
"ora": "10.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"arktype": "2.2.9",
"croner": "11.0.0",
"arktype": "2.2.10",
"croner": "11.0.1",
"json5": "2.2.3",
"unicode-case-folding": "1.1.2",
"yaml": "2.9.1"
Expand Down
9 changes: 7 additions & 2 deletions scripts/ci-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("CI workflow", () => {
}
});

it("runs required gates in parallel on available hosted runners", async () => {
it("keeps other gates parallel while units wait for component retention", async () => {
const workflow = parseYaml(await readFile(".github/workflows/ci.yml", "utf8")) as {
jobs: Record<string, WorkflowJob>;
};
Expand All @@ -48,11 +48,16 @@ describe("CI workflow", () => {
expect(workflow.jobs["pr-gates"]).toBeUndefined();
for (const [name, command] of Object.entries(requiredGates)) {
const job = workflow.jobs[name];
expect(job.needs).toBeUndefined();
expect(job.needs).toBe(name === "unit" ? "component-upgrade" : undefined);
expect(job["timeout-minutes"]).toBe(name === "unit" ? 10 : 5);
expect(job.steps).toContainEqual(expect.objectContaining({ run: command }));
}

expect(workflow.jobs["component-upgrade"].needs).toBeUndefined();
expect(workflow.jobs["component-upgrade"].steps).toContainEqual(
expect.objectContaining({ run: "bun run test:component-upgrade" }),
);

expect(workflow.jobs.unit["runs-on"]).toBe("ubuntu-24.04");
expect(workflow.jobs.unit.steps).toContainEqual(
expect.objectContaining({
Expand Down
9 changes: 9 additions & 0 deletions scripts/playwright-local-auth-config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ describe("playwright local-auth runner config", () => {
);
});

it.each(["prod:production", "dev:shared-development", "local:fixture\nCONVEX_DEPLOY_KEY=key"])(
"rejects a non-local deployment selector: %s",
(deployment) => {
expect(() => resolveLocalAuthDeployment(deployment, null)).toThrow(
"Local-auth tests require a local or anonymous Convex deployment.",
);
},
);

it("does not inherit the generic CI Convex URL", () => {
expect(
resolveLocalAuthRunnerConfig({
Expand Down
7 changes: 6 additions & 1 deletion scripts/playwright-local-auth-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ export function resolveLocalAuthDeployment(
configuredDeployment: string | undefined,
fallbackDeployment: string | null | undefined,
) {
return configuredDeployment ?? fallbackDeployment ?? DEFAULT_LOCAL_AUTH_CONVEX_DEPLOYMENT;
const deployment =
configuredDeployment ?? fallbackDeployment ?? DEFAULT_LOCAL_AUTH_CONVEX_DEPLOYMENT;
if (!/^(anonymous|local):[^\s]+$/.test(deployment)) {
throw new Error("Local-auth tests require a local or anonymous Convex deployment.");
}
return deployment;
}

export function resolveLocalAuthRunnerConfig(
Expand Down
Loading
Loading