Docker: include A2UI sources for bundle#13114
Conversation
| COPY . . | ||
| RUN OPENCLAW_A2UI_SKIP_MISSING=1 pnpm build | ||
| RUN pnpm build | ||
| # Force pnpm for UI build (Bun may fail on ARM/Synology architectures) | ||
| ENV OPENCLAW_PREFER_PNPM=1 | ||
| RUN pnpm ui:build |
There was a problem hiding this comment.
Docker build still won’t fail
Removing OPENCLAW_A2UI_SKIP_MISSING=1 here doesn’t actually make Docker builds fail fast if the A2UI sources are missing: pnpm build runs scripts/bundle-a2ui.sh, and that script currently exits 0 when vendor/a2ui/renderers/lit or apps/shared/OpenClawKit/Tools/CanvasA2UI are absent (scripts/bundle-a2ui.sh:18-21). So with the current script behavior, the Docker image can still silently ship the prebuilt src/canvas-host/a2ui/a2ui.bundle.js even if bundling was skipped.
If the intent is to fail when sources are unexpectedly missing in Docker, the bundling script (or the build step) needs a way to enforce that.
Prompt To Fix With AI
This is a comment left during a code review.
Path: Dockerfile
Line: 26:30
Comment:
**Docker build still won’t fail**
Removing `OPENCLAW_A2UI_SKIP_MISSING=1` here doesn’t actually make Docker builds fail fast if the A2UI sources are missing: `pnpm build` runs `scripts/bundle-a2ui.sh`, and that script currently exits 0 when `vendor/a2ui/renderers/lit` or `apps/shared/OpenClawKit/Tools/CanvasA2UI` are absent (`scripts/bundle-a2ui.sh:18-21`). So with the current script behavior, the Docker image can still silently ship the prebuilt `src/canvas-host/a2ui/a2ui.bundle.js` even if bundling was skipped.
If the intent is to fail when sources are unexpectedly missing in Docker, the bundling script (or the build step) needs a way to enforce that.
How can I resolve this? If you propose a fix, please make it concise.
Additional Comments (1)
Consider adding Prompt To Fix With AIThis is a comment left during a code review.
Path: .dockerignore
Line: 42:48
Comment:
**Re-includes won’t apply**
`.dockerignore` starts ignoring `apps/` and `vendor/` at lines 42 and 48, but the later `!apps/shared/...` and `!vendor/a2ui/...` negations won’t re-include those paths unless you also un-ignore the parent directories (`!apps/` and `!vendor/`). In Docker ignore semantics, a negated pattern can’t bring back files from a directory that’s still excluded by an earlier pattern, so the A2UI sources may still be missing from the build context and `scripts/bundle-a2ui.sh` will keep skipping.
Consider adding `!apps/` and `!vendor/` (and any needed intermediate dirs) before the more specific negations.
How can I resolve this? If you propose a fix, please make it concise. |
|
Good catch. You're right that removing I pushed a follow-up commit that makes the bundling step fail if the sources are missing and there is no prebuilt Commit: 4426382 |
4426382 to
b5df929
Compare
* Docker: include A2UI sources for bundle * Build: fail bundling when sources missing and no prebuilt A2UI bundle
* 'main' of github.com:YanHaidao/clawdbot: (94 commits) fix(auto-reply): prevent sender spoofing in group prompts Discord: add exec approval cleanup option (openclaw#13205) CI: extend stale timelines to be contributor-friendly (openclaw#13209) fix: enforce Discord agent component DM auth (openclaw#11254) (thanks @thedudeabidesai) refactor(security,config): split oversized files (openclaw#13182) Commands: add commands.allowFrom config CI: configure stale automation fix(signal): enforce mention gating for group messages (openclaw#13124) fix(ui): prioritize displayName over label in webchat session picker (openclaw#13108) Chore: add testflight auto-response Docker: include A2UI sources for bundle (openclaw#13114) fix: unify session maintenance and cron run pruning (openclaw#13083) docs: expand vulnerability reporting guidelines in SECURITY.md docs: add vulnerability reporting guidelines to CONTRIBUTING.md refactor: consolidate fetchWithTimeout into shared utility fix(memory): default batch embeddings to off Improve code analyzer for independent packages, CI: only run release-check on push to main fix(tools): correct Grok response parsing for xAI Responses API (openclaw#13049) chore(deps): update dependencies, remove hono pinning Update contributing, deduplicate more functions ...
* Docker: include A2UI sources for bundle * Build: fail bundling when sources missing and no prebuilt A2UI bundle
* Docker: include A2UI sources for bundle * Build: fail bundling when sources missing and no prebuilt A2UI bundle
* Docker: include A2UI sources for bundle * Build: fail bundling when sources missing and no prebuilt A2UI bundle
* Docker: include A2UI sources for bundle * Build: fail bundling when sources missing and no prebuilt A2UI bundle
Fixes #12878.
Problem:
apps/andvendor/, soscripts/bundle-a2ui.shskipped bundling.DockerfilesetOPENCLAW_A2UI_SKIP_MISSING=1, so the build succeeded while silently shipping withouta2ui.bundle.js.Changes:
.dockerignoreto re-include only the A2UI bundle inputs:apps/shared/OpenClawKit/Tools/CanvasA2UI/**vendor/a2ui/renderers/lit/**OPENCLAW_A2UI_SKIP_MISSING=1from the Docker build step so regressions fail fast.Testing:
pnpm buildpnpm checkpnpm test src/canvas-host/server.test.tsGreptile Overview
Greptile Summary
This PR updates the Docker build context to include the Canvas A2UI bundle inputs (specific
apps/shared/OpenClawKit/Tools/CanvasA2UI/**andvendor/a2ui/renderers/lit/**paths) and removesOPENCLAW_A2UI_SKIP_MISSING=1from thepnpm buildstep to avoid silently shipping without the A2UI bundle.However, as written, the
.dockerignorenegations likely don’t take effect becauseapps/andvendor/remain ignored, and the bundling script itself exits successfully when those sources are missing. As a result, Docker builds can still proceed without actually bundling A2UI, undermining the “fail fast” goal.Confidence Score: 2/5
.dockerignorechanges appear to still exclude the required A2UI source directories due to parent directory ignores, andscripts/bundle-a2ui.shexits 0 when sources are missing, so removingOPENCLAW_A2UI_SKIP_MISSING=1doesn’t enforce a fail-fast build.scripts/bundle-a2ui.shbehavior as it affects Docker builds)