Skip to content

ridesx: fix cleanup of decompressed files#248

Merged
mangelajo merged 1 commit into
jumpstarter-dev:mainfrom
bennyz:ridesx-clean-decompressed
Feb 19, 2026
Merged

ridesx: fix cleanup of decompressed files#248
mangelajo merged 1 commit into
jumpstarter-dev:mainfrom
bennyz:ridesx-clean-decompressed

Conversation

@bennyz

@bennyz bennyz commented Feb 19, 2026

Copy link
Copy Markdown
Member

currently decompressed files were not tracked for cleanup by opendal, and thus are left on the storage consuming space

Summary by CodeRabbit

  • New Features
    • Added a public API to register additional storage paths for automatic cleanup.
  • Bug Fixes
    • Ensures decompressed files are now registered with storage for proper cleanup on close.

@coderabbitai

coderabbitai Bot commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@bennyz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

After decompression, the RideSX driver computes the decompressed file’s path relative to the storage root and registers that path with the Opendal storage backend. Opendal gains a new public register_path(path: str) method that records paths for later cleanup.

Changes

Cohort / File(s) Summary
RideSX driver change
python/packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py
After successful decompression, compute the decompressed file path relative to storage and call storage.register_path(...) to register it for automatic cleanup.
Opendal storage API addition
python/packages/jumpstarter-driver-opendal/jumpstarter_driver_opendal/driver.py
Add public method register_path(self, path: str) which normalizes and stores the path in _created_paths for later cleanup. Exposed via @export.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #597: Modifies decompression flow in the RideSX driver; touches related extraction/decompression logic.

Suggested reviewers

  • mangelajo

Poem

🐰 A ribboned file, unzipped and bright,
I hop and mark it, tucked out of sight.
When work is done and evening falls,
I'll tidy paths and close the stalls.
Happy storage, soft moonlight. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: fixing cleanup of decompressed files, which directly addresses the PR objective of ensuring decompressed files are properly tracked and cleaned up.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@python/packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py`:
- Around line 115-117: The code directly mutates Opendal's private attributes
(_created_paths and _normalize_path) from RideSX driver; add a public method on
Opendal, e.g. register_path(self, path: str), that performs normalization and
insertion into the internal created paths set, then replace the direct access in
jumpstarter_driver_ridesx.driver (the lines using
storage._created_paths.add(storage._normalize_path(...))) with a call to
storage.register_path(str(relative_path)); ensure register_path encapsulates any
locking/normalization logic so external callers never touch private members.

Comment thread python/packages/jumpstarter-driver-ridesx/jumpstarter_driver_ridesx/driver.py Outdated
@bennyz bennyz force-pushed the ridesx-clean-decompressed branch from 57f9280 to 18588de Compare February 19, 2026 13:53

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
python/packages/jumpstarter-driver-opendal/jumpstarter_driver_opendal/driver.py (1)

242-242: @validate_call(validate_return=True) missing — inconsistent with all other exported path-taking methods

Every @export method that accepts a path: str parameter (e.g. open, stat, copy, rename, remove_all, create_dir, delete, exists, presign_stat, etc.) is guarded by @validate_call(validate_return=True). Omitting it here means an invalid path value arriving over RPC won't be caught at the boundary.

♻️ Proposed fix
     `@export`
+    `@validate_call`(validate_return=True)
     async def register_path(self, path: str) -> None:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@python/packages/jumpstarter-driver-opendal/jumpstarter_driver_opendal/driver.py`
at line 242, Add the missing RPC input/output validation to the register_path
method by decorating register_path with `@validate_call`(validate_return=True)
(the same pattern used on other exported path-taking methods like open, stat,
copy, etc.); ensure the validate_call symbol is imported where other methods use
it so the decorator is available and applied to the register_path function to
validate the incoming path and returned value at the RPC boundary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@python/packages/jumpstarter-driver-opendal/jumpstarter_driver_opendal/driver.py`:
- Around line 241-252: Add the missing RPC argument/return validation to
register_path by decorating the method with `@validate_call`(validate_return=True)
so its path parameter is validated consistently with other exported methods
(open, stat, copy, rename, delete); update the register_path definition (which
calls self._normalize_path and adds to self._created_paths) to include the
`@validate_call`(validate_return=True) decorator above it.

---

Nitpick comments:
In
`@python/packages/jumpstarter-driver-opendal/jumpstarter_driver_opendal/driver.py`:
- Line 242: Add the missing RPC input/output validation to the register_path
method by decorating register_path with `@validate_call`(validate_return=True)
(the same pattern used on other exported path-taking methods like open, stat,
copy, etc.); ensure the validate_call symbol is imported where other methods use
it so the decorator is available and applied to the register_path function to
validate the incoming path and returned value at the RPC boundary.

currently decompressed files were not tracked for cleanup by opendal,
and thus are left on the storage consuming space

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
@bennyz bennyz force-pushed the ridesx-clean-decompressed branch from 18588de to a0eb230 Compare February 19, 2026 14:07
@bennyz bennyz requested a review from mangelajo February 19, 2026 15:54
@mangelajo mangelajo merged commit a5572a8 into jumpstarter-dev:main Feb 19, 2026
30 checks passed
@bennyz bennyz deleted the ridesx-clean-decompressed branch February 19, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants