Skip to content

feat: Offer --cache option to control cache mode (Incremental Build)#1368

Open
maxreichmann wants to merge 7 commits into
feat/incremental-build-4from
feat/incremental-build-cache-mode
Open

feat: Offer --cache option to control cache mode (Incremental Build)#1368
maxreichmann wants to merge 7 commits into
feat/incremental-build-4from
feat/incremental-build-cache-mode

Conversation

@maxreichmann
Copy link
Copy Markdown
Member

@maxreichmann maxreichmann commented Apr 28, 2026

Part of Incremental Build: #1267

JIRA: CPOUI5FOUNDATION-1208

  • Introduce --cache with values "Default", "ReadOnly", "Force" and "Off" for commands "ui5 build" and "ui5 serve"
    • Add yargs help description (also appears in CLI docs)
  • Add JSDoc annotations
  • Rename --cache-mode to --snapshot-cache
    • Hide deprecated option in yargs help (if still used -> logs warning)
    • Legacy logic now usable via new name
    • Add hint under "Migrate to v5" in docs explaining this

@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch from 13173d5 to 68a130f Compare April 29, 2026 07:39
@maxreichmann maxreichmann marked this pull request as draft April 29, 2026 07:42
@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch from 68a130f to 0c087f8 Compare April 29, 2026 08:23
@RandomByte RandomByte force-pushed the feat/incremental-build-4 branch from e1d781f to ab65f27 Compare April 30, 2026 12:19
Comment thread packages/cli/lib/cli/commands/build.js Outdated
Comment thread packages/cli/lib/cli/commands/build.js Outdated
@maxreichmann maxreichmann force-pushed the feat/incremental-build-4 branch from 7aa4cd3 to 95fd5de Compare May 5, 2026 13:14
@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch from e451d07 to 07a5941 Compare May 7, 2026 15:25
@maxreichmann maxreichmann marked this pull request as ready for review May 7, 2026 15:31
@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch from bbf7099 to 39431de Compare May 7, 2026 15:32
@maxreichmann maxreichmann requested review from a team and RandomByte May 7, 2026 15:32
@RandomByte RandomByte force-pushed the feat/incremental-build-4 branch from 0670d94 to d029efb Compare May 11, 2026 08:45
@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch 2 times, most recently from 7994eae to 2546932 Compare May 11, 2026 10:25
@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch from 2546932 to 4db0fca Compare May 11, 2026 10:32
@maxreichmann
Copy link
Copy Markdown
Member Author

maxreichmann commented May 11, 2026

Rebased onto base branch feat/incremental-build-4 and fixed all unit tests which are not failing in base branch.

@maxreichmann maxreichmann requested review from RandomByte and removed request for RandomByte May 11, 2026 12:43
Fix all unit tests which are NOT failing in base branch ("feat-incremental-build-4")
@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch from cafca18 to f2ff30d Compare May 12, 2026 09:24
@maxreichmann maxreichmann force-pushed the feat/incremental-build-4 branch from 4be8ab8 to 7164b79 Compare May 13, 2026 12:35
Comment thread internal/documentation/docs/updates/migrate-v5.md Outdated
@RandomByte RandomByte requested a review from KlattG May 13, 2026 15:16
@RandomByte
Copy link
Copy Markdown
Member

Adding @KlattG since this PR changes a lot of user-facing texts

@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch from 6e065f0 to db051ab Compare May 19, 2026 11:43
Comment thread internal/documentation/docs/updates/migrate-v5.md Outdated
Co-authored-by: Florian Vogt <florian.vogt@sap.com>
@maxreichmann maxreichmann force-pushed the feat/incremental-build-cache-mode branch from 7dec71b to 876b2f3 Compare May 19, 2026 14:56
@RandomByte RandomByte force-pushed the feat/incremental-build-4 branch from c9c4972 to 2862e0f Compare May 20, 2026 14:31
Copy link
Copy Markdown
Contributor

@KlattG KlattG left a comment

Choose a reason for hiding this comment

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

Nothing major, just a few things I noticed


With UI5 CLI v5, the option `--cache-mode` (for commands `ui5 build` and `ui5 serve`) has been renamed to `--snapshot-cache`.

When legacy `--cache-mode` is used, the behavior remains the same but a deprecation warning is logged. When both `--snapshot-cache` and `--cache-mode` are used, successor `--snapshot-cache` always gets priority.
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.

Suggested change
When legacy `--cache-mode` is used, the behavior remains the same but a deprecation warning is logged. When both `--snapshot-cache` and `--cache-mode` are used, successor `--snapshot-cache` always gets priority.
When legacy `--cache-mode` is used, the behavior remains the same but a deprecation warning is logged. When both `--snapshot-cache` and `--cache-mode` are used, the `--snapshot-cache` flag always gets priority.

Comment on lines +92 to +93
"The 'Default' behavior is to always use the cache if available. 'Force' uses the cache only " +
"(if it's unavailable or invalid, the build fails). 'ReadOnly' does not create or update any " +
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.

Suggested change
"The 'Default' behavior is to always use the cache if available. 'Force' uses the cache only " +
"(if it's unavailable or invalid, the build fails). 'ReadOnly' does not create or update any " +
"The 'Default' behavior is to always use the cache if available. 'Force' uses the cache only. " +
"If the cache is unavailable or invalid, the build fails. 'ReadOnly' does not create or update any " +

.coerce("cache-mode", (opt) => {
// Log a warning if this option is used
if (opt !== undefined) {
log.warn("As of UI5 CLI version 5, '--cache-mode' was renamed to '--snapshot-cache'. " +
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.

Suggested change
log.warn("As of UI5 CLI version 5, '--cache-mode' was renamed to '--snapshot-cache'. " +
log.warn("As of UI5 CLI version 5, '--cache-mode' is renamed to '--snapshot-cache'. " +

Comment on lines +69 to +70
"The 'Default' behavior is to always use the cache if available. 'Force' uses the cache only " +
"(if it's unavailable or invalid, the build fails). 'Read-only' does not create or update any " +
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.

see above

Suggested change
"The 'Default' behavior is to always use the cache if available. 'Force' uses the cache only " +
"(if it's unavailable or invalid, the build fails). 'Read-only' does not create or update any " +
"The 'Default' behavior is to always use the cache if available. 'Force' uses the cache only. " +
"If the cache is unavailable or invalid, the build fails. 'Read-only' does not create or update any " +

.coerce("cache-mode", (opt) => {
// Log a warning if this option is used
if (opt !== undefined) {
log.warn("As of UI5 CLI version 5, '--cache-mode' was renamed to '--snapshot-cache'. " +
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.

Suggested change
log.warn("As of UI5 CLI version 5, '--cache-mode' was renamed to '--snapshot-cache'. " +
log.warn("As of UI5 CLI version 5, '--cache-mode' is renamed to '--snapshot-cache'. " +

* @readonly
* @enum {string}
* @property {string} Default Use cache if available
* @property {string} Force Use cache only (if it's unavailable or invalid, the build fails)
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.

Suggested change
* @property {string} Force Use cache only (if it's unavailable or invalid, the build fails)
* @property {string} Force Use cache only. If the cache is unavailable or invalid, the build fails

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