feat(workspace): add flexible mount configuration (#18)#21
feat(workspace): add flexible mount configuration (#18)#21feloy wants to merge 2 commits intokortex-hub:mainfrom
Conversation
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>
📝 WalkthroughWalkthroughReplaced the previous Mounts object with an array of Mount objects in the workspace configuration OpenAPI. Mount now requires Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
workspace-configuration/openapi.yaml (2)
62-64: Add explicitdefaultfor theroproperty.The description states "Defaults to false" but the schema doesn't codify this. Adding an explicit
default: falseimproves 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 addingmaxItemsconstraint 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
maxItemslimit 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
📒 Files selected for processing (1)
workspace-configuration/openapi.yaml
Signed-off-by: Philippe Martin <phmartin@redhat.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
workspace-configuration/openapi.yaml (1)
39-43: Consider addingmaxItemsconstraint 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
📒 Files selected for processing (1)
workspace-configuration/openapi.yaml
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