Skip to content

refactor: Support of referencing legacy middlewares in UI5 CLI middleware configuration#1367

Open
d3xter666 wants to merge 243 commits into
feat/incremental-build-4from
remove-legacy-middlewares
Open

refactor: Support of referencing legacy middlewares in UI5 CLI middleware configuration#1367
d3xter666 wants to merge 243 commits into
feat/incremental-build-4from
remove-legacy-middlewares

Conversation

@d3xter666
Copy link
Copy Markdown
Member

JIRA: CPOUI5FOUNDATION-1206

@d3xter666 d3xter666 requested a review from a team April 28, 2026 10:35
RandomByte and others added 29 commits April 30, 2026 14:19
Cherry-picked from: SAP/ui5-fs@5651627
JIRA: CPOUI5FOUNDATION-1174
Cherry-picked from: SAP/ui5-builder@ef5a3b2
JIRA: CPOUI5FOUNDATION-1174
Prerequisite for versioning support

Cherry-picked from: SAP/ui5-project@83b5c4f
JIRA: CPOUI5FOUNDATION-1174
Cherry-picked from: SAP/ui5-cli@d29ead8
JIRA: CPOUI5FOUNDATION-1174
* Improve handling for concurrent resource access and modifications,
  especially when buffering streams.
* Deprecate getStatInfo in favor of dedicated getSize, isDirectory,
getLastModified methods.
* Deprecate synchronous getStream in favor of getStreamAsync and
  modifyStream, allowing for atomic modification of resource content
* Generate Resource hash using ssri
getIntegrity tests still need to be updated
- page_size=32768: Reduces overflow page chains for compressed blobs
  (120 KB source index: 15 pages → 4 pages)
- mmap_size=256MB: Eliminates pread() syscalls via memory-mapped I/O
- cache_size=64MB: Keeps more pages cached for sequential access
- Bumps cache version to v0_7 (page_size requires fresh database)
…rehashing

Replace recursive _computeHash with non-recursive _recomputeDirectoryHashShallow
in ancestor rehash loops. The recursive method recomputed all descendants
(~16,000 SHA-256 ops for root in sap.m), while the shallow method only combines
existing child hashes (4 ops for a single resource change).

Measured improvement: 28ms → 0.36ms (79x) for single-resource delta in sap.m
(12,677 resources).
… code

Remove unused _recomputeAncestorHashes method (zero callers). Add tests
verifying that _recomputeDirectoryHashShallow produces correct hashes at
every directory level for multi-depth upserts, sibling modifications,
batch removals, and deep leaf changes.
… existence check

Reduce gzip compression level from 6 to 1 in BuildCacheStorage.putContent(),
yielding ~3-4x faster compression at the cost of ~15-25% larger cache.db.

Add findExistingContentIntegrities() batch check to skip compression and
INSERT for content already present in the database. This benefits
multi-project builds where shared resources may already be stored.
…ia async gzip

Replace synchronous gzipSync inside the SQLite transaction with async
parallel compression using the libuv thread pool. The writeStageResources
method now:
1. Gathers integrity + buffer (existing Phase 1)
2. Batch-checks existing content (existing Phase 1.5)
3. Compresses all buffers in parallel via async gzip with bounded
   concurrency (new Phase 2)
4. Batch-inserts pre-compressed data in a short transaction (new Phase 3)

This separates CPU-bound compression from I/O, letting multiple cores
contribute to compression simultaneously while keeping the SQLite
transaction window minimal (only fast synchronous INSERTs).
…e I/O

When getIntegrity() is called on a FACTORY resource that has a
createBufferFactory, materialize the buffer and compute integrity from
it. Subsequent getBuffer() calls return the cached buffer with zero
additional file I/O, eliminating redundant readFile calls in the
build cache writeStageResources flow.
Resources <= 128 bytes are stored uncompressed in the CAS, avoiding
gzip overhead that exceeds the compression benefit for tiny inputs.
The read path uses gzip magic byte detection for backward compatibility.
@RandomByte RandomByte force-pushed the feat/incremental-build-4 branch from e1d781f to ab65f27 Compare April 30, 2026 12:19
RandomByte and others added 16 commits April 30, 2026 15:51
Build tests: add getRootPath stub and cacheDir to expected args to
match the new cache directory parameter in graph.build().

Serve tests: adapt to the non-returning handler pattern (pOnError)
by using fire-and-settle instead of awaiting handler completion,
and account for the new error callback passed to serverServe.
* Add test for "ui5 --version"
* Add test for "ui5 build" (currently testing a TS application)

Currently, those tests are not included in any CI pipeline and also need a manual "npm install" (no node_modules included yet).
+ Include "npm install" in test runtime
+ Refactor test environment for better reuse
+ Extend typescript test to cover Incremental Build
+ Add "application.a" (Javascript project fixture)
Co-authored-by: Copilot <copilot@github.com>
Break long test names to multiple lines to meet max-len 120 limit
@d3xter666 d3xter666 force-pushed the remove-legacy-middlewares branch from 0bfc922 to 09a4670 Compare April 30, 2026 14:51
- Remove cacache dependency from packages/project/package.json
- Restore internal/e2e-tests/ files that were incorrectly deleted
- Update package-lock.json to match base branch
@maxreichmann maxreichmann force-pushed the feat/incremental-build-4 branch from 7aa4cd3 to 95fd5de Compare May 5, 2026 13:14
@RandomByte RandomByte force-pushed the feat/incremental-build-4 branch from 0670d94 to d029efb Compare May 11, 2026 08:45
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