Skip to content

feat(project): Offer configPath property to workspace configs (workspace/1.1) - #1643

Merged
maxreichmann merged 39 commits into
mainfrom
offer-configPath-to-workspace-yaml
Nov 16, 2026
Merged

maxreichmann merged 39 commits into
mainfrom
offer-configPath-to-workspace-yaml

Conversation

@maxreichmann

@maxreichmann maxreichmann commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Cherry pick of v4 feature: ui5-project#902


This offers a configPath property to workspace dependency resolution entries as follows:

specVersion: workspace/1.1                      # new specVersion
metadata:
    name: default
dependencyManagement:
    resolutions:
        - path: ../test.library
          configPath: custom-config.yaml        # new customizable paths

(Introducing new specVersion workspace/1.1)


Other sub features:

  • Improve error handling when path is absolute
  • Improve error handling when multiple resolutions for the same dependency exist (by path property)
  • Forbid absolute paths for configPath
  • Allow relative paths for configPath (for path it's already allowed)
  • Fix pre-existing trailing-slash bug

The workspace resolution logic is now explicitly implemented as "Most specific wins" (the resolution entry with the deepest path gets precedence). Entries are sequentially processed while keeping file reads, glob expansion, and traversal within each entry async.

Closes: #1369
JIRA: CPOUI5FOUNDATION-1233

@maxreichmann maxreichmann changed the title Offer configPath property to workspace yamls (workspace/1.1) feat(project): Offer configPath property to workspace yamls (workspace/1.1) Oct 8, 2026
@maxreichmann maxreichmann changed the title feat(project): Offer configPath property to workspace yamls (workspace/1.1) feat(project): Offer configPath property to workspace configs (workspace/1.1) Oct 8, 2026
@maxreichmann
maxreichmann marked this pull request as draft October 8, 2026 14:21
@maxreichmann

Copy link
Copy Markdown
Member Author

Kindly asking @KlattG to review the documentation part of this PR already (Workspace.md).

(I didn't add this feature to the usual migrate-v5.md because we planned to downport to v4 too)

Comment thread packages/project/lib/graph/Workspace.js Resolved
KlattG
KlattG previously approved these changes Oct 12, 2026

@KlattG KlattG 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.

LGTM

@maxreichmann
maxreichmann force-pushed the offer-configPath-to-workspace-yaml branch 8 times, most recently from 398ace8 to 5c857ed Compare October 12, 2026 15:42
@maxreichmann
maxreichmann marked this pull request as ready for review October 12, 2026 16:07
@maxreichmann
maxreichmann requested a review from a team October 12, 2026 16:07

@d3xter666 d3xter666 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please, check the log when you try to build with this new validation/schema:

strict mode: missing type "object" for keyword "properties" at "ui5-workspace.json#/then/properties/dependencyManagement" (strictTypes)
strict mode: missing type "array" for keyword "items" at "ui5-workspace.json#/then/properties/dependencyManagement/properties/resolutions" (strictTypes)
strict mode: missing type "object" for keyword "required" at "ui5-workspace.json#/then/properties/dependencyManagement/properties/resolutions/items/then/not" (strictTypes)

This is from AJV's strict mode

@maxreichmann

Copy link
Copy Markdown
Member Author

Please, check the log when you try to build with this new validation/schema:

strict mode: missing type "object" for keyword "properties" at "ui5-workspace.json#/then/properties/dependencyManagement" (strictTypes)
strict mode: missing type "array" for keyword "items" at "ui5-workspace.json#/then/properties/dependencyManagement/properties/resolutions" (strictTypes)
strict mode: missing type "object" for keyword "required" at "ui5-workspace.json#/then/properties/dependencyManagement/properties/resolutions/items/then/not" (strictTypes)

This is from AJV's strict mode

Resolved with 4ebdb73

Comment thread packages/project/lib/graph/Workspace.js Resolved
@maxreichmann
maxreichmann marked this pull request as draft October 15, 2026 14:42
@maxreichmann
maxreichmann force-pushed the offer-configPath-to-workspace-yaml branch 6 times, most recently from b5f28b4 to 2a27fc6 Compare October 20, 2026 14:32
@maxreichmann
maxreichmann force-pushed the offer-configPath-to-workspace-yaml branch from adf732b to 6e7dcd2 Compare October 27, 2026 17:29
devtomtom and others added 4 commits November 10, 2026 17:02
Resolve workspace entries one at a time and track visited paths per
resolution to prevent cycles. Preserve the most specific configuration
when workspace globs overlap.
Treat paths with and without trailing slashes as the same directory,
so overlapping resolutions load only the most specific config.

+ Add tests
@maxreichmann
maxreichmann force-pushed the offer-configPath-to-workspace-yaml branch from 51acda3 to d3b7fb4 Compare November 10, 2026 16:02
@maxreichmann
maxreichmann force-pushed the offer-configPath-to-workspace-yaml branch from b4ee83b to 75f8e5e Compare November 10, 2026 16:08
@maxreichmann

Copy link
Copy Markdown
Member Author

Kindly asking @KlattG to review the newest added docu part (d80a8ab)

KlattG
KlattG previously approved these changes Nov 11, 2026
@maxreichmann

maxreichmann commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

Review Help

As this PR is quite huge, this review order might ease the start:

  1. ui5-workspace.json: new specVersion and the actual configPath parameter (which only works for this new specVersion)
  2. Workspace.js: Most of the logic: using configPath in the module collection; (also new: explicit "most specific wins" logic)
  3. Module.js: exposing configPath by a getter
  4. NodePackageDependencies.js: forwarding this exposed configPath to the creation of the ProjectGraph
  5. Tests

The many new files under ./package/project/test are mostly just fixtures necessary for the new tests which represent file structures (nested workspaces with custom configs).
Here's the structure in case you'll need it:

Fixture: collection.c

Located under packages/project/test/fixtures/.
Every library also contains package.json, ui5.yaml, ui5-another-custom.yaml and it's source.

collection.c/
├── package.json
├── library.a/
│   └── ui5-custom.yaml
├── library.b/
│   └── ui5-custom.yaml
└── collection.a/
    ├── package.json
    ├── library.c/
    │   └── ui5-custom.yaml
    └── library.d/
        └── ui5-custom.yaml
Fixture: collection.c.noCustomConfigForLibA

Located under packages/project/test/fixtures/.
Every library also contains package.json, ui5.yaml, ui5-another-custom.yaml and it's source.

collection.c.noCustomConfigForLibA/
├── package.json
├── library.a/                 (ui5-custom.yaml intentionally absent)
├── library.b/
│   └── ui5-custom.yaml
└── collection.a/
    ├── package.json
    ├── library.c/
    │   └── ui5-custom.yaml
    └── library.d/
        └── ui5-custom.yaml

The added tests mostly test if the correct config was loaded in various scenarios.

@maxreichmann
maxreichmann marked this pull request as ready for review November 11, 2026 13:44
@maxreichmann
maxreichmann requested a review from a team November 11, 2026 13:44
Comment thread packages/project/lib/graph/Workspace.js Resolved
Comment thread packages/project/lib/graph/Workspace.js Resolved
devtomtom
devtomtom previously approved these changes Nov 11, 2026

@devtomtom devtomtom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall it looks good to me.

@maxreichmann
maxreichmann force-pushed the offer-configPath-to-workspace-yaml branch from a38bcec to bd77759 Compare November 12, 2026 11:07
- Make the yaml example at the top expanded by default (not collapsed)
- same for the other example below
- add [...] at some fitting code snippets

@d3xter666 d3xter666 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@maxreichmann
maxreichmann merged commit 9fcaac3 into main Nov 16, 2026
77 checks passed
@maxreichmann
maxreichmann deleted the offer-configPath-to-workspace-yaml branch November 16, 2026 11:53
d3xter666 pushed a commit that referenced this pull request Nov 16, 2026
🚜 New release prepared
---


<details><summary>builder: 5.0.0-alpha.16</summary>

##
[5.0.0-alpha.16](builder-v5.0.0-alpha.15...builder-v5.0.0-alpha.16)
(2026-11-16)


### chore

* **builder:** Synchronize ui5-cli-packages versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @ui5/fs bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
    * @ui5/logger bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
  * devDependencies
    * @ui5/project bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
</details>

<details><summary>cli: 5.0.0-alpha.16</summary>

##
[5.0.0-alpha.16](cli-v5.0.0-alpha.15...cli-v5.0.0-alpha.16)
(2026-11-16)


### chore

* **cli:** Synchronize ui5-cli-packages versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @ui5/builder bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
    * @ui5/fs bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
    * @ui5/logger bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
    * @ui5/project bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
    * @ui5/server bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
</details>

<details><summary>fs: 5.0.0-alpha.16</summary>

##
[5.0.0-alpha.16](fs-v5.0.0-alpha.15...fs-v5.0.0-alpha.16)
(2026-11-16)


### chore

* **fs:** Synchronize ui5-cli-packages versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @ui5/logger bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
</details>

<details><summary>logger: 5.0.0-alpha.16</summary>

##
[5.0.0-alpha.16](logger-v5.0.0-alpha.15...logger-v5.0.0-alpha.16)
(2026-11-16)


### Dependencies

* Bump slice-ansi from 9.0.1 to 10.0.0
([#1698](#1698))
([8e87959](8e87959))
</details>

<details><summary>project: 5.0.0-alpha.16</summary>

##
[5.0.0-alpha.16](project-v5.0.0-alpha.15...project-v5.0.0-alpha.16)
(2026-11-16)


### Features

* **project:** Offer `configPath` property to workspace configs
(`workspace/1.1`) ([#1643](#1643))
([9fcaac3](9fcaac3))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @ui5/fs bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
    * @ui5/logger bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
  * peerDependencies
    * @ui5/builder bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
</details>

<details><summary>server: 5.0.0-alpha.16</summary>

##
[5.0.0-alpha.16](server-v5.0.0-alpha.15...server-v5.0.0-alpha.16)
(2026-11-16)


### chore

* **server:** Synchronize ui5-cli-packages versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @ui5/builder bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
    * @ui5/fs bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
    * @ui5/logger bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
  * devDependencies
    * @ui5/project bumped from ^5.0.0-alpha.15 to ^5.0.0-alpha.16
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Option to specify custom UI5 config for workspace dependency resolution

5 participants