Skip to content

Conversation

@ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Nov 19, 2025

Summary by CodeRabbit

  • Refactor
    • Updated directory path resolution for imports and file loading operations to align with current code standards.

@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Walkthrough

This pull request makes two coordinated changes: it updates the local_directory() function in infrahub_sdk/ctl/importer.py to return Path.cwd() instead of Path().resolve(), and it removes the FURB177 linting rule from the ignore list in pyproject.toml. The changes align the codebase with the FURB linting standard that prefers Path.cwd() for obtaining the current working directory. No public API signatures are altered by these modifications.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing Path().resolve() with Path.cwd() in infrahub_sdk/ctl/importer.py and re-enabling FURB177 linting rule in pyproject.toml.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pog-FURB177

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd9e82b and 24395a4.

📒 Files selected for processing (2)
  • infrahub_sdk/ctl/importer.py (1 hunks)
  • pyproject.toml (0 hunks)
💤 Files with no reviewable changes (1)
  • pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
infrahub_sdk/ctl/importer.py (1)

17-19: No other instances of the Path().resolve() anti-pattern found — change is isolated and complete.

The comprehensive search confirms that Path().resolve() (creating an empty Path and resolving it) only appeared in the location that was fixed. The other .resolve() calls in the codebase are legitimate uses on actual Path objects (e.g., Path(__file__).resolve(), Path(template).resolve()) and serve different purposes (resolving symlinks and file references), so they are not subject to the FURB177 linting rule.

The change from Path().resolve() to Path.cwd() is correct, idiomatic, and complete.


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.

@cloudflare-workers-and-pages
Copy link

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 24395a4
Status: ✅  Deploy successful!
Preview URL: https://7385c961.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-furb177.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/ctl/importer.py 0.00% 1 Missing ⚠️
@@                Coverage Diff                @@
##           infrahub-develop     #653   +/-   ##
=================================================
  Coverage             75.60%   75.60%           
=================================================
  Files                   113      113           
  Lines                  9522     9522           
  Branches               1452     1452           
=================================================
  Hits                   7199     7199           
  Misses                 1832     1832           
  Partials                491      491           
Flag Coverage Δ
integration-tests 34.95% <0.00%> (-0.02%) ⬇️
python-3.10 48.99% <0.00%> (ø)
python-3.11 48.99% <0.00%> (-0.03%) ⬇️
python-3.12 48.99% <0.00%> (ø)
python-3.13 48.97% <0.00%> (-0.03%) ⬇️
python-filler-3.12 24.27% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/ctl/importer.py 59.09% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ogenstad ogenstad marked this pull request as ready for review November 19, 2025 15:55
@ogenstad ogenstad requested a review from a team November 19, 2025 15:55
@ogenstad ogenstad merged commit a7f3e6a into infrahub-develop Nov 20, 2025
19 checks passed
@ogenstad ogenstad deleted the pog-FURB177 branch November 20, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants