Repository navigation
feat: switch to esbuild-based build pipeline for faster builds - #762
Conversation
|
Hi! I'm che-ai-assistant — I help with your pull requests. Available commands:
|
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-762-amd64 |
1 similar comment
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-762-amd64 |
4202161 to
6e2b121
Compare
There was a problem hiding this comment.
Pull request overview
Updates Che-Code’s build and static-asset delivery pipeline by integrating the new esbuild-based bundling flow into container builds and adding Che-specific support for serving pre-compressed static assets.
Changes:
- Adds Che-specific support to serve pre-compressed
.gzstatic assets when the client supportsgzip. - Updates container build Dockerfiles to run the new esbuild-based bundling pipeline and pre-compress static assets during image build.
- Refreshes Che server helper code/header to support the new static serving behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
code/src/vs/server/node/webClientServer.ts |
Attempts to serve pre-compressed assets before falling back to the regular static file path. |
code/src/vs/server/node/che/webClientServer.ts |
Introduces tryServeCompressedFile helper and updates Che copyright header. |
build/dockerfiles/linux-musl.Dockerfile |
Switches Alpine build to the new esbuild-based bundling steps and adds gzip pre-compression of assets. |
build/dockerfiles/linux-libc-ubi9.Dockerfile |
Switches UBI9 build to the new esbuild-based bundling steps and adds gzip pre-compression of assets. |
build/dockerfiles/linux-libc-ubi8.Dockerfile |
Switches UBI8 build to the new esbuild-based bundling steps and adds gzip pre-compression of assets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-762-amd64 |
1 similar comment
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-762-amd64 |
📝 WalkthroughWalkthroughThe Linux UBI8, UBI9, and musl Docker builds now run additional Gulp compilation tasks and no-emit TypeScript validation. They create minified Next.js server-web bundles and use CI-specific web packaging tasks. The UBI8 build also pre-compresses eligible output assets and applies server-bundle flags. Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@code/src/vs/server/node/che/webClientServer.ts`:
- Around line 48-50: Update the gzip negotiation logic around acceptEncoding so
it parses Accept-Encoding coding parameters and reads gzip’s effective quality
value. Return false when gzip is absent or explicitly assigned q=0, and only
enable gzip when its effective quality is greater than zero.
In `@code/src/vs/server/node/webClientServer.ts`:
- Around line 77-80: Update the response-header setup in the web client request
handler to add or append Vary: Accept-Encoding before the ETag/304 conditional,
ensuring both compressed and uncompressed responses advertise the encoding
variance. Pass responseHeaders when constructing the 304 response, while
preserving the existing conditional and file-serving behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b2049961-22e6-47d9-b360-bb7cedb11db7
📒 Files selected for processing (5)
build/dockerfiles/linux-libc-ubi8.Dockerfilebuild/dockerfiles/linux-libc-ubi9.Dockerfilebuild/dockerfiles/linux-musl.Dockerfilecode/src/vs/server/node/che/webClientServer.tscode/src/vs/server/node/webClientServer.ts
3832429 to
3bd8bde
Compare
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-762-amd64 |
rgrunber
left a comment
There was a problem hiding this comment.
Build went from taking about ~20min locally (with balanced performance) to ~5min using the compile instructions.
Comparing the contents of code/.build/extensions shows no major differences.
Signed-off-by: Roman Nikitenko <[email protected]> Assisted-by: Cursor AI
3bd8bde to
5d6e317
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@build/dockerfiles/linux-libc-ubi9.Dockerfile`:
- Around line 96-97: The server-web bundle commands need the CI source-map base
URL before the corresponding -min-ci packaging tasks. Update the bundle
invocations in build/dockerfiles/linux-libc-ubi9.Dockerfile (lines 96-97),
build/dockerfiles/linux-libc-ubi8.Dockerfile, and
build/dockerfiles/linux-musl.Dockerfile (lines 65-66) to pass the matching CDN
base URL while preserving the existing minify, nls, mangle-privates, and target
server-web options.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d82b205f-2636-48bc-97e9-da4c220fec30
📒 Files selected for processing (3)
build/dockerfiles/linux-libc-ubi8.Dockerfilebuild/dockerfiles/linux-libc-ubi9.Dockerfilebuild/dockerfiles/linux-musl.Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
- build/dockerfiles/linux-libc-ubi8.Dockerfile
| && NODE_OPTIONS="--max-old-space-size=8192" node build/next/index.ts bundle --minify --nls --mangle-privates --target server-web --out out-vscode-reh-web-min \ | ||
| && NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min-ci \ |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
rg -n -C 8 \
-- '--source-map-base-url|sourceMapBaseUrl|sourceMappingURLBase|sourceMappingURL|stripSourceMapsInPackagingTasks|vscode-reh-web-linux.*min-ci' \
.Repository: che-incubator/che-code
Length of output: 50378
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf 'Files:\n'
git ls-files 'build/dockerfiles/*Dockerfile' 'build/next/index.ts' 'code/build/gulpfile.vscode.reh.web.ts' 'code/build/gulpfile.vscode.web.ts' 'code/build/gulpfile.vscode.ts' | sed -n '1,120p'
printf '\nDocker snippets:\n'
for f in build/dockerfiles/linux-libc-ubi8.Dockerfile build/dockerfiles/linux-libc-ubi9.Dockerfile build/dockerfiles/linux-musl.Dockerfile; do
[ -f "$f" ] || continue
printf '\n--- %s ---\n' "$f"
nl -ba "$f" | sed -n '90,110p;63,68p'
done
printf '\nRelevant gulp/next references:\n'
rg -n -C 5 'function runEsbuildBundle|--target server-web|--source-map-base-url|sourceMapBaseUrl|sourceMappingURLBase|sourceMappingURL|stripSourceMaps|vscode-reh-web-linux-.*min-ci|vscode-reh-web-alpine-min-ci' \
build/next/index.ts \
code/build/gulpfile.vscode.reh.web.ts \
code/build/gulpfile.vscode.web.ts \
code/build/gulpfile.vscode.ts \
--max-count 200Repository: che-incubator/che-code
Length of output: 588
🏁 Script executed:
#!/bin/sh
set -euo pipefail
printf 'Docker snippets:\n'
for f in build/dockerfiles/linux-libc-ubi8.Dockerfile build/dockerfiles/linux-libc-ubi9.Dockerfile build/dockerfiles/linux-musl.Dockerfile; do
[ -f "$f" ] || continue
printf '\n--- %s ---\n' "$f"
awk 'NR>=60 && NR<=110 {printf "%d\t%s\n", NR, $0}' "$f"
done
printf '\nbuild/next/index.ts bundle command line handling:\n'
if [ -f build/next/index.ts ]; then
awk 'NR>=1 && NR<=260 {printf "%d\t%s\n", NR, $0}' build/next/index.ts
fi
printf '\nRelevant gulp references:\n'
for f in code/build/gulpfile.vscode.reh.web.ts code/build/gulpfile.vscode.web.ts code/build/gulpfile.vscode.ts; do
if [ -f "$f" ]; then
printf '\n--- %s references ---\n' "$f"
rg -n -C 4 'runEsbuildBundle|sourceMapBaseUrl|sourceMappingURLBase|vscode-reh-web-linux-.*min-ci|server-web' "$f" || true
fi
doneRepository: che-incubator/che-code
Length of output: 14434
🏁 Script executed:
#!/bin/sh
set -euo pipefail
printf 'Find REH web gulpfile:\n'
git ls-files | grep -E 'gulpfile\.(vscode|.*reh.*web).*\.ts$|Dockerfile$' | grep -E 'gulpfile|Dockerfile'
printf '\nSearch for vscode-reh-web package tasks:\n'
rg -n -C 6 'vscode-reh-web-linux|vscode-reh-web-alpine|reactor-web|REH|reh-web|server-web|min-ci' code/build --glob '*.ts' | sed -n '1,240p'
printf '\nCheck for build/next/index.ts content length:\n'
wc -l build/next/index.tsRepository: che-incubator/che-code
Length of output: 15792
🏁 Script executed:
#!/bin/sh
set -euo pipefail
printf 'Code build gulpfiles:\n'
git ls-files 'code/build/*.ts' | grep -E 'gulpfile'
printf '\nRelevant VSCode REH web min tasks:\n'
rg -n -C 8 'minify-vscode-reh-web|vscode-reh-web-linux-alpine-min-ci|vscode-reh-web-linux-.*-min-ci|min-min|rewriteSourceMappingURL|stripSourceMappings|sourceMappingURLBase|useCdnSourceMapsForPackagingTasks|stripSourceMapsInPackagingTasks|runEsbuildBundle' code/build/gulpfile.reh.ts code/build/gulpfile.vscode.ts code/build/gulpfile.vscode.web.ts code/build/gulpfile.vscode.linux.ts --max-count 200
printf '\nNext bundle CLI usage (from code/build/next):\n'
git ls-files code/build/next | sed -n '1,120p'
if [ -f code/build/next/index.ts ]; then
awk 'NR>=1 && NR<=140 {printf "%d\t%s\n", NR, $0}' code/build/next/index.ts
awk 'NR>=1160 && NR<=1220 {printf "%d\t%s\n", NR, $0}' code/build/next/index.ts
fiRepository: che-incubator/che-code
Length of output: 22977
🏁 Script executed:
#!/bin/sh
set -euo pipefail
printf 'Relevant buildConfig and gulpfile.vscode min-ci lines:\n'
awk 'NR>=1 && NR<=80 {printf "%d\t%s\n", NR, $0}' code/build/buildConfig.ts
awk 'NR>=720 && NR<=810 {printf "%d\t%s\n", NR, $0}' code/build/gulpfile.vscode.ts
printf '\nRelevant vscode.reh lines:\n'
awk 'NR>=680 && NR<=765 {printf "%d\t%s\n", NR, $0}' code/build/gulpfile.reh.ts
rg -n -C 3 'minified|packageTasks|jsMapReplacer|sourceMaps|sourcemap|sourceMappingURL/|\.map' code/build/gulpfile.reh.ts code/build/gulpfile.vscode.tsRepository: che-incubator/che-code
Length of output: 18800
Preserve the CI source-map base URL in the server-web bundle commands.
Both docker files run the server-web bundle directly before the -min-ci package tasks. CI packages strips .map files, so without rewriting the sources first the packaged JS sourceMappingURLs can become unreachable. Add the matching CDN base URL to these build/next/index.ts bundle --minify --nls --mangle-privates --target server-web commands in build/dockerfiles/linux-libc-ubi9.Dockerfile, build/dockerfiles/linux-libc-ubi8.Dockerfile, and build/dockerfiles/linux-musl.Dockerfile.
📍 Affects 2 files
build/dockerfiles/linux-libc-ubi9.Dockerfile#L96-L97(this comment)build/dockerfiles/linux-musl.Dockerfile#L65-L66
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@build/dockerfiles/linux-libc-ubi9.Dockerfile` around lines 96 - 97, The
server-web bundle commands need the CI source-map base URL before the
corresponding -min-ci packaging tasks. Update the bundle invocations in
build/dockerfiles/linux-libc-ubi9.Dockerfile (lines 96-97),
build/dockerfiles/linux-libc-ubi8.Dockerfile, and
build/dockerfiles/linux-musl.Dockerfile (lines 65-66) to pass the matching CDN
base URL while preserving the existing minify, nls, mangle-privates, and target
server-web options.
Source: MCP tools
|
Pull Request images published ✨ Editor amd64: quay.io/che-incubator-pull-requests/che-code:pr-762-amd64 |
What does this PR do?
gulp + custom TypeScript manglerto theesbuild-based pipeline.Build steps (per Dockerfile):
Before:

After:

What issues does this PR fix?
How to test this PR?
Testing any functionality is useful
I've tested basic functionality:
Does this PR contain changes that override default upstream Code-OSS behavior?
git rebasewere added to the .rebase folderSummary by CodeRabbit