Skip to content

feat: switch to esbuild-based build pipeline for faster builds - #762

Merged
RomanNikitenko merged 1 commit into
che-incubator:mainfrom
RomanNikitenko:reduce-build-time
Aug 4, 2026
Merged

RomanNikitenko merged 1 commit into
che-incubator:mainfrom
RomanNikitenko:reduce-build-time

Conversation

@RomanNikitenko

@RomanNikitenko RomanNikitenko commented Jul 17, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Switches the build pipeline from the gulp + custom TypeScript mangler to the esbuild-based pipeline.
  • Removes custom TS mangler and its fragile workarounds
  • Build time: 53-62 min → ~16-21 min

Build steps (per Dockerfile):

  • gulp — compile extensions (codicons, non-native, copilot, media)
  • tsgo — type-check (no emit)
  • esbuild — bundle + minify + mangle-privates (server-web target)
  • gulp *-min-ci — package only

Before:
Screenshot 2026-07-22 at 11 55 10

After:
Screenshot 2026-07-22 at 11 57 01

What issues does this PR fix?

How to test this PR?

Testing any functionality is useful
I've tested basic functionality:

  • open a file
  • create a terminal
  • install an extension
  • change a theme
  • restart workspace
  • search
  • run a devfile command

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

Summary by CodeRabbit

  • Improvements
    • Improved Linux build validation to catch TypeScript issues earlier.
    • Enhanced web application bundling and packaging for more consistent release builds.
    • Added broader compilation coverage for extensions, icons, media, and Copilot features.
    • Optimized eligible web assets through pre-compression, helping reduce download sizes and improve loading performance.
    • Updated build workflows across supported Linux environments for more reliable CI output.

@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@tolusha

tolusha commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm che-ai-assistant — I help with your pull requests.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant check-pr-test-failures — Analyze failing CI checks, identify root causes, and suggest fixes
  • /che-ai-assistant update-che-e2e-tests — Update Eclipse Che e2e tests
  • /che-ai-assistant help — Show this help message

@github-actions

Copy link
Copy Markdown
Contributor

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings July 21, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .gz static assets when the client supports gzip.
  • 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.

Comment thread build/dockerfiles/linux-musl.Dockerfile Resolved
@github-actions

Copy link
Copy Markdown
Contributor

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

@RomanNikitenko
RomanNikitenko marked this pull request as ready for review July 22, 2026 10:58
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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: vitaliy-guliy, azatsarynnyy

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is under 72 characters, uses imperative mood, and clearly describes the switch to an esbuild-based build pipeline.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Rebase Rules For Upstream Changes ✅ Passed The commit changes only three build/dockerfiles files; no files under code/ are changed, so rebase rules and CHANGELOG updates are not required.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4eadc7e and bf2c8b1.

📒 Files selected for processing (5)
  • build/dockerfiles/linux-libc-ubi8.Dockerfile
  • build/dockerfiles/linux-libc-ubi9.Dockerfile
  • build/dockerfiles/linux-musl.Dockerfile
  • code/src/vs/server/node/che/webClientServer.ts
  • code/src/vs/server/node/webClientServer.ts

@github-actions

Copy link
Copy Markdown
Contributor

@RomanNikitenko RomanNikitenko mentioned this pull request Jul 24, 2026
15 of 22 tasks

@rgrunber rgrunber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3832429 and 5d6e317.

📒 Files selected for processing (3)
  • build/dockerfiles/linux-libc-ubi8.Dockerfile
  • build/dockerfiles/linux-libc-ubi9.Dockerfile
  • build/dockerfiles/linux-musl.Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • build/dockerfiles/linux-libc-ubi8.Dockerfile

Comment on lines +96 to +97
&& 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 \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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 200

Repository: 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
done

Repository: 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.ts

Repository: 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
fi

Repository: 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.ts

Repository: 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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@RomanNikitenko
RomanNikitenko merged commit 746c115 into che-incubator:main Aug 4, 2026
14 checks passed
@RomanNikitenko
RomanNikitenko deleted the reduce-build-time branch August 4, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants