fix(cli): implement --mount flag on resource add container-instance #1134
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!1134
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/m8-container-mount-flag"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements
--mountflag onresource add container-instanceper spec WF17.Mount Formats
--mount local/api-repo:/workspace(type=resource, mode=rw)--mount /var/config:/config:ro(type=bind, mode=rw|ro)--mountflags supported on a single commandChanges
_parse_mount_spec()parses both formats with validationproperties["mounts"]_format_properties()renders mounts in human-readable format forresource showmountto container-instancecli_argsmetadataExample
ISSUES CLOSED: #1078
Review: APPROVED with Comments
Well-structured PR with clean implementation of mount parsing, good error handling via
typer.BadParameter, and 6 BDD scenarios. The code follows existing project patterns. Approving, but please address the following items (some are important).Issues to Address
Logic bug in
_parse_mount_spec()—/heuristic for type inference. At the 2-part parsing branch, the code uses"/" in parts[0]to determinetype: "resource"vstype: "bind". This means--mount /data:/app(a valid 2-part absolute host-path) will be misclassified astype: "resource"because/datacontains/. A resource name likelocal/api-repoalso contains/, so the heuristic is ambiguous. Consider:parts[0].startswith("/")→ bind; else → resource. Or require 3-part format for host paths.No milestone assigned. The branch is prefixed
bugfix/m8-*, strongly suggesting it belongs to Milestone 8. Per CONTRIBUTING.md requirement #11, a milestone is mandatory. Please assign before merge.Merge conflicts.
mergeable: false— needs a rebase against master.Metadata mismatch.
_resource_registry_data.pyadds a singlemountfield (singular, typestring) incli_args, but the CLI storesmounts(plural) as a JSON array in properties. The metadata key and the actual property key are inconsistent.Minor Notes
No test for the
/heuristic ambiguity — e.g.,--mount /data:/app(2-part host path) is never tested, so the misclassification goes undetected. Adding this test case would catch the bug in item #1._NoClosewrapper in test steps is clever but opaque. A docstring comment explaining whysession.close()is suppressed (to keep in-memory SQLite alive) would help future readers.Mounts stored as a JSON string inside a dict value is a serialization-within-serialization pattern. If
propertiesis itself JSON-serialized to the DB, this results in double-encoded JSON. Worth considering a cleaner schema in a future iteration.1afb374e763a58763750New commits pushed, approval review dismissed automatically according to repository settings
3a58763750f5b4032854Response to @freemo Review
All 7 findings addressed in
f5b40328. 8 scenarios passing (was 6)./heuristic misclassifies/data:/appas resource typeparts[0].startswith("/")— absolute paths are bind mounts, everything else is resource-reference--mountaccepted on all typestype_name != "container-instance"guard withtyper.Abort()mountvsmounts)mounttomountswith description explaining JSON array format/data:/apptype: bind,mode: rw_NoCloselacks docstringpropertiesserialization pattern. Cleaner schema tracked for future iteration.Process: Milestone v3.5.0 assigned. Rebased onto master (
Mergeable: true).f5b4032854ebafe8cddd