Skip to content

RTECO-1986 - Create missing --path dir instead of erroring - #537

Open
udaykb2 wants to merge 2 commits into
mainfrom
RTECO-1896-improve-path-flag-in-agent-namespace
Open

RTECO-1986 - Create missing --path dir instead of erroring#537
udaykb2 wants to merge 2 commits into
mainfrom
RTECO-1896-improve-path-flag-in-agent-namespace

Conversation

@udaykb2

@udaykb2 udaykb2 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

ResolvePathInstallBase (shared by skills and plugins install/update via ValidateInstallFlags) now creates the --path target directory, including any missing parents, instead of failing when it doesn't exist yet. Uses the existing EnsureDestinationDir helper (os.MkdirAll), so this works cross-platform on Windows, Mac, and Linux with no new code.

Still rejects --path when it points at an existing file.

Removed ValidateExistingDir (agent/common/file_operations.go), which was only used at this call site and became dead code.

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • Appropriate label is added to auto generate release notes.
  • I used gofmt for formatting the code before submitting the pull request.
  • PR description is clear and concise, and it includes the proposed solution/fix.

Summary by CodeRabbit

  • New Features
    • Installation paths now create missing destination directories automatically, including nested parent directories.
  • Bug Fixes
    • Installation path validation now clearly rejects paths that point to existing files.
  • Tests
    • Added coverage for creating missing and nested directories and validating installation paths.

ResolvePathInstallBase (shared by skills and plugins install/update via
ValidateInstallFlags) now creates the --path target directory, including
any missing parents, instead of failing when it doesn't exist yet. Uses
the existing EnsureDestinationDir helper (os.MkdirAll), so this works
cross-platform on Windows, Mac, and Linux with no new code.

Still rejects --path when it points at an existing file.

Removed ValidateExistingDir (agent/common/file_operations.go), which was
only used at this call site and became dead code.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 3fc7aa38-3c8e-4e03-a4d5-a85227e7fa06

📥 Commits

Reviewing files that changed from the base of the PR and between a590327 and fe45031.

📒 Files selected for processing (4)
  • agent/common/file_operations.go
  • agent/common/file_operations_test.go
  • agent/common/install_flags.go
  • agent/common/install_flags_test.go
💤 Files with no reviewable changes (2)
  • agent/common/file_operations.go
  • agent/common/file_operations_test.go

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

--path install destinations can now be missing. Resolution creates missing parent directories, rejects existing files, and validates the created absolute install base. Related obsolete directory validation code and tests were removed.

Changes

Install path creation

Layer / File(s) Summary
Create install path destinations
agent/common/install_flags.go
ResolvePathInstallBase calls EnsureDestinationDir to create missing and nested destination directories.
Validate filesystem outcomes
agent/common/install_flags_test.go
Tests cover directory creation, existing-file rejection, and path-mode validation for missing install directories.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fe450

The change creates missing --path directories while continuing to reject file targets; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: agrasth, bhanurp

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: create the missing --path directory instead of returning an error.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch RTECO-1896-improve-path-flag-in-agent-namespace

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

@naveenku-jfrog naveenku-jfrog added the safe to test Approve running integration tests on a pull request label Aug 25, 2026
@github-actions github-actions Bot removed the safe to test Approve running integration tests on a pull request label Aug 25, 2026
@udaykb2
udaykb2 marked this pull request as ready for review August 25, 2026 09:53
@udaykb2 udaykb2 added improvement Automatically generated release notes safe to test Approve running integration tests on a pull request labels Aug 28, 2026
@github-actions github-actions Bot removed the safe to test Approve running integration tests on a pull request label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Automatically generated release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants