Skip to content

feat(workspace): add flexible mount configuration (#18)#21

Open
feloy wants to merge 2 commits intokortex-hub:mainfrom
feloy:config-mounts
Open

feat(workspace): add flexible mount configuration (#18)#21
feloy wants to merge 2 commits intokortex-hub:mainfrom
feloy:config-mounts

Conversation

@feloy
Copy link
Copy Markdown
Contributor

@feloy feloy commented Mar 27, 2026

Replace the separate dependencies and configs arrays with a unified mounts array that supports absolute paths, variable substitution ($SOURCES, $HOME), custom mount targets, and read-only mounts.

Fixes #18

Replace the separate dependencies and configs arrays with a unified mounts array that supports absolute paths, variable substitution ($SOURCES, $HOME), custom mount targets, and read-only mounts.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

Replaced the previous Mounts object with an array of Mount objects in the workspace configuration OpenAPI. Mount now requires host and target, adds optional ro (default false), removes dependencies/configs, and an example response demonstrating mounts and environment (including $SOURCES/$HOME usage) was added.

Changes

Cohort / File(s) Summary
OpenAPI: workspace configuration
workspace-configuration/openapi.yaml
Replaced Mounts schema with Mount schema (host: string, target: string required; ro: boolean optional, default false). Updated WorkspaceConfiguration.mounts to type: array of Mount. Removed dependencies and configs. Added GET / response example showing mounts entries and environment with value/secret and $SOURCES/$HOME usage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding flexible mount configuration to the workspace by replacing the previous dependencies/configs structure with a unified mounts array.
Description check ✅ Passed The description is related to the changeset and explains the key transformation from separate dependencies/configs arrays to a unified mounts array with variable substitution and read-only support.
Linked Issues check ✅ Passed The PR successfully implements all requirements from issue #18: unified mounts array with host/target objects, absolute path support, variable substitution ($SOURCES/$HOME), custom mount targets, and read-only flag support.
Out of Scope Changes check ✅ Passed All changes are focused on the workspace configuration schema and OpenAPI documentation to implement the flexible mount configuration feature, with no unrelated or out-of-scope modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
workspace-configuration/openapi.yaml (2)

62-64: Add explicit default for the ro property.

The description states "Defaults to false" but the schema doesn't codify this. Adding an explicit default: false improves generated code (some generators will use it) and ensures the schema is self-documenting.

♻️ Proposed fix
         ro:
           type: boolean
+          default: false
           description: Mount as read-only. Defaults to false (read-write).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@workspace-configuration/openapi.yaml` around lines 62 - 64, The schema
documents that the boolean property "ro" defaults to false but doesn't declare
it; update the OpenAPI schema for the "ro" property in
workspace-configuration/openapi.yaml to include an explicit "default: false"
under the "ro" property so the spec and generators will treat it as false when
unset; locate the "ro" property (type: boolean, description: Mount as read-only)
and add the default there.

39-43: Consider adding maxItems constraint for defensive schema design.

The static analysis tool flags the unbounded array. While likely not critical for this CLI configuration use case, adding a reasonable maxItems limit can prevent potential resource issues from malformed configurations.

♻️ Optional: Add maxItems constraint
         mounts:
           type: array
+          maxItems: 100
           items:
             $ref: '#/components/schemas/Mount'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@workspace-configuration/openapi.yaml` around lines 39 - 43, The mounts array
schema is unbounded which static analysis flags; add a defensive maxItems
constraint to the mounts definition to limit the number of Mount entries (e.g.,
a reasonable upper bound like 50) so malformed configs can't create resource
issues—update the "mounts" schema (the array referencing
"#/components/schemas/Mount") to include a maxItems value and, optionally, a
minItems if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@workspace-configuration/openapi.yaml`:
- Around line 62-64: The schema documents that the boolean property "ro"
defaults to false but doesn't declare it; update the OpenAPI schema for the "ro"
property in workspace-configuration/openapi.yaml to include an explicit
"default: false" under the "ro" property so the spec and generators will treat
it as false when unset; locate the "ro" property (type: boolean, description:
Mount as read-only) and add the default there.
- Around line 39-43: The mounts array schema is unbounded which static analysis
flags; add a defensive maxItems constraint to the mounts definition to limit the
number of Mount entries (e.g., a reasonable upper bound like 50) so malformed
configs can't create resource issues—update the "mounts" schema (the array
referencing "#/components/schemas/Mount") to include a maxItems value and,
optionally, a minItems if needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8cd76f91-7350-45a8-9ab9-5470a8cde976

📥 Commits

Reviewing files that changed from the base of the PR and between 6222a0f and 65ed93b.

📒 Files selected for processing (1)
  • workspace-configuration/openapi.yaml

Signed-off-by: Philippe Martin <phmartin@redhat.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
workspace-configuration/openapi.yaml (1)

39-43: Consider adding maxItems constraint for defense-in-depth.

The static analysis tool flags the unbounded array. While this may be acceptable for a workspace configuration, adding a reasonable upper bound prevents potential resource exhaustion from malformed configurations.

🛡️ Optional: Add maxItems constraint
         mounts:
           type: array
+          maxItems: 100
           items:
             $ref: '#/components/schemas/Mount'
           description: List of directories to mount in the workspace. Supports $SOURCES (workspace sources directory) and $HOME (user home directory) variables.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@workspace-configuration/openapi.yaml` around lines 39 - 43, The mounts array
schema currently lacks an upper bound; add a maxItems constraint to the mounts
array definition (the property named "mounts" that references
"#/components/schemas/Mount") to limit the number of mounts and prevent
resource-exhaustion attacks—pick a reasonable limit (e.g., 20–100) and add
maxItems: <number> alongside type: array and items: $ref to enforce the bound.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@workspace-configuration/openapi.yaml`:
- Around line 39-43: The mounts array schema currently lacks an upper bound; add
a maxItems constraint to the mounts array definition (the property named
"mounts" that references "#/components/schemas/Mount") to limit the number of
mounts and prevent resource-exhaustion attacks—pick a reasonable limit (e.g.,
20–100) and add maxItems: <number> alongside type: array and items: $ref to
enforce the bound.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cb782a87-7d68-4bd6-aab9-df79446dfab0

📥 Commits

Reviewing files that changed from the base of the PR and between 65ed93b and bba4d0f.

📒 Files selected for processing (1)
  • workspace-configuration/openapi.yaml

Copy link
Copy Markdown

@MarsKubeX MarsKubeX left a comment

Choose a reason for hiding this comment

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

LGTM

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.

workspace configuration mounts

2 participants