Skip to content

Fix path expansion/storage#864

Merged
amaslenn merged 2 commits intomainfrom
am/rm-4931725
Apr 8, 2026
Merged

Fix path expansion/storage#864
amaslenn merged 2 commits intomainfrom
am/rm-4931725

Conversation

@amaslenn
Copy link
Copy Markdown
Contributor

@amaslenn amaslenn commented Apr 8, 2026

Summary

Fix path expansion/storage for local containers. Fixes internal bug.

Test Plan

  1. CI (extended)

Additional Notes

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

The DockerImage.installed_path property now resolves local file URLs (absolute paths or those starting with ".") into absolute filesystem paths, while preserving the original URL for remote sources. A new test validates that duplicate local containers maintain their original local paths when marked as installed.

Changes

Cohort / File(s) Summary
Core Property Logic
src/cloudai/_core/installables.py
Modified installed_path property to resolve local filesystem URLs into absolute paths when url is absolute or relative (starting with "."), otherwise preserving original behavior.
Installation Test Coverage
tests/systems/slurm/test_installer.py
Added test test_mark_as_installed_duplicate_local_containers_preserve_local_path to verify that duplicate local containers preserve their original local paths after installation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A path, once local, now resolved,
Through rabbit burrows absolute and clear,
When duplicates hop in, their home is solved—
The same .sqsh file, year after year! 🥕✨

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix path expansion/storage' directly relates to the main change: DockerImage.installed_path now properly handles path expansion for local containers by resolving absolute paths and relative paths correctly.
Description check ✅ Passed The description 'Fix path expansion/storage for local containers' is directly related to the changeset, which fixes path handling for local containers in DockerImage.installed_path.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch am/rm-4931725

Comment @coderabbitai help to get the list of available commands and usage tips.

@amaslenn amaslenn added the bug Something isn't working label Apr 8, 2026
Copy link
Copy Markdown
Contributor

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

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 `@tests/systems/slurm/test_installer.py`:
- Around line 373-384: Replace the hardcoded Path("/tmp/local_image.sqsh") with
a pytest-provided temporary path: accept the tmp_path fixture in the test
function signature
(test_mark_as_installed_duplicate_local_containers_preserve_local_path), create
local_image = tmp_path / "local_image.sqsh", and pass
DockerImage(url=str(local_image)) as before so the test remains portable and
avoids the Ruff S108 warning while keeping the assertions and use of
SlurmInstaller.mark_as_installed unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 637572f3-7b8b-46bd-86cd-8f19a1efda38

📥 Commits

Reviewing files that changed from the base of the PR and between efb1234 and 8e7b895.

📒 Files selected for processing (2)
  • src/cloudai/_core/installables.py
  • tests/systems/slurm/test_installer.py

@amaslenn amaslenn merged commit 57f4a4f into main Apr 8, 2026
5 checks passed
@amaslenn amaslenn deleted the am/rm-4931725 branch April 8, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants