Repository navigation
perf(ci): skip global declaration emission in the CI artifacts build - #108949
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7142a72e4a
ℹ️ 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".
| // CI's dist consumers are runtime JS only; the plugin-sdk gate below | ||
| // self-builds its scoped declarations instead. Release/package builds | ||
| // (full profile, docker packaging) keep canonical dts. | ||
| OPENCLAW_RUN_NODE_SKIP_DTS_BUILD: "1", |
There was a problem hiding this comment.
Don't clobber the package build's DTS override
When scripts/package-openclaw-for-docker.mjs builds self-contained package artifacts it invokes node scripts/build-all.mjs ciArtifacts with OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=0 because that path is supposed to keep declaration generation. resolveBuildAllStep merges the step env after the caller env, so this new ciArtifacts default wins and the nested tsdown still sees 1; Docker/package artifact builds therefore skip the canonical declarations they explicitly requested. Please make the PR-CI fast path conditional or let the packaging override pass through before forcing the skip.
Useful? React with 👍 / 👎.
7142a72 to
be8f36d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be8f36d098
ℹ️ 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".
| OPENCLAW_PRESERVE_CLI_STARTUP_METADATA: "1", | ||
| }, | ||
| "write-plugin-sdk-entry-dts": { | ||
| OPENCLAW_PLUGIN_SDK_CANONICAL_DTS: "0", |
There was a problem hiding this comment.
Preserve canonical SDK DTS for package builds
When the Docker/package artifact path calls scripts/build-all.mjs ciArtifacts from scripts/package-openclaw-for-docker.mjs:370 with declaration generation explicitly enabled at scripts/package-openclaw-for-docker.mjs:379, this override still forces write-plugin-sdk-entry-dts into self-build mode and replaces the canonical plugin SDK declarations that package artifacts are supposed to ship. Fresh evidence beyond the prior tsdown override: even if the package helper's DTS override is allowed through, this separate step override prevents canonical-mode gate verification for package builds that reuse ciArtifacts.
Useful? React with 👍 / 👎.
Declaration emission is ~95% of the tsdown wall clock (measured 132.5s with dts vs 6.0s without on the main graph; 224.7s in CI). PR CI's dist consumers only execute runtime JS, so the ciArtifacts profile now skips global dts and the plugin-sdk export gate validates self-built scoped declarations (write-plugin-sdk-entry-dts non-canonical mode, 45s local). The step cache is dropped in self-build mode because its outputs depend on the SDK source graph the canonical cache inputs do not cover. Release and docker packaging builds keep canonical declarations. Local end-to-end: build:ci-artifacts 92s with all gates green.
gateway-core and gateway-methods flaked at 6 workers (hook timeouts, mock-state res.setHeader TypeError, waitForAssertion misses) on the first run after the worker-budget raise while passing on two prior validation runs — the same intermittent contention class media-ui showed. Pin both like the other timing-sensitive groups.
be8f36d to
d4b1924
Compare
|
Merged via squash.
|
…penclaw#108949) * perf(ci): skip global declaration emission in the CI artifacts build Declaration emission is ~95% of the tsdown wall clock (measured 132.5s with dts vs 6.0s without on the main graph; 224.7s in CI). PR CI's dist consumers only execute runtime JS, so the ciArtifacts profile now skips global dts and the plugin-sdk export gate validates self-built scoped declarations (write-plugin-sdk-entry-dts non-canonical mode, 45s local). The step cache is dropped in self-build mode because its outputs depend on the SDK source graph the canonical cache inputs do not cover. Release and docker packaging builds keep canonical declarations. Local end-to-end: build:ci-artifacts 92s with all gates green. * fix(ci): pin gateway suites to the proven 2-worker Vitest budget gateway-core and gateway-methods flaked at 6 workers (hook timeouts, mock-state res.setHeader TypeError, waitForAssertion misses) on the first run after the worker-budget raise while passing on two prior validation runs — the same intermittent contention class media-ui showed. Pin both like the other timing-sensitive groups.
…penclaw#108949) * perf(ci): skip global declaration emission in the CI artifacts build Declaration emission is ~95% of the tsdown wall clock (measured 132.5s with dts vs 6.0s without on the main graph; 224.7s in CI). PR CI's dist consumers only execute runtime JS, so the ciArtifacts profile now skips global dts and the plugin-sdk export gate validates self-built scoped declarations (write-plugin-sdk-entry-dts non-canonical mode, 45s local). The step cache is dropped in self-build mode because its outputs depend on the SDK source graph the canonical cache inputs do not cover. Release and docker packaging builds keep canonical declarations. Local end-to-end: build:ci-artifacts 92s with all gates green. * fix(ci): pin gateway suites to the proven 2-worker Vitest budget gateway-core and gateway-methods flaked at 6 workers (hook timeouts, mock-state res.setHeader TypeError, waitForAssertion misses) on the first run after the worker-budget raise while passing on two prior validation runs — the same intermittent contention class media-ui showed. Pin both like the other timing-sensitive groups.
What Problem This Solves
build-artifactsis now the PR CI wall-clock pole (376s in run 29492619358). Its cost is one tsdown invocation at 224.7s — and measurement shows declaration emission is ~95% of that: the same main-graph invocation takes 132.5s with dts and 6.0s without (local, M-series; CI instrumentation via[tsdown-build] invocation Ntimings).Why This Change Was Made
PR CI's dist consumers (dist-requiring node test bins, QA packaging, boundary checks) execute runtime JS only. The single declaration consumer on the PR path is
check-plugin-sdk-exports, andwrite-plugin-sdk-entry-dtsalready has a self-build mode that produces the scoped plugin-sdk declarations with its own bounded tsdown pass (45s local). So theciArtifactsprofile now:OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1(precedent:qaRuntime,gatewayWatch,cliStartup,sourcePerformancealready skip dts),write-plugin-sdk-entry-dtsin non-canonical (self-build) mode,Release and package builds (
fullprofile, docker packaging withOPENCLAW_RUN_NODE_SKIP_DTS_BUILD=0) keep canonical declaration emission and canonical-mode gate verification. Trade-off note: PR CI validates the SDK surface against self-built scoped declarations rather than the full-graph canonical chunks; full-graph dts breakage would surface at release-build validation rather than PR CI. tsgo prod/test typechecks still run on every PR.User Impact
None at runtime — CI-only. PR feedback gets faster: local end-to-end
pnpm build:ci-artifactsdrops to 92s (was ~4min equivalent); the CI job should drop from ~376s toward ~200s, removing the current PR wall-clock pole.Evidence
node scripts/tsdown-build.mjs147s total with dts, 14.9s without (same tree, back-to-back).node --import tsx scripts/write-plugin-sdk-entry-dts.ts(non-canonical) 49s, thennode scripts/check-plugin-sdk-exports.mjs→ "OK: All 4 required plugin-sdk exports verified" (declaration graph 3.83MB within budget).pnpm build:ci-artifacts92s, all steps green, phase timings in the build log.node scripts/run-vitest.mjs test/scripts/build-all.test.tsgreen (profile expectations updated with the contract note).scripts/build-all.mjs, so its own CI run exercises the changed build lane end-to-end — comparebuild-artifactsduration against 376s baseline before merge.