Skip to content

Conversation

@petercrocker
Copy link
Contributor

@petercrocker petercrocker commented Nov 9, 2025

Configure RichHandler to only show file paths (e.g., object.py:568)
when the --debug flag is used. This provides cleaner output for
normal usage while preserving detailed logging for troubleshooting.

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced debug logging to display file paths when debug mode is enabled, providing better diagnostics for troubleshooting.

Configure RichHandler to only show file paths (e.g., object.py:568)
when the --debug flag is used. This provides cleaner output for
normal usage while preserving detailed logging for troubleshooting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

Walkthrough

The change modifies the RichHandler initialization in the init_logging function within the utils module. The RichHandler now receives a show_path parameter set to the value of the debug flag. This allows the log output to display the file path when debug mode is enabled. The modification is limited to this handler configuration with no other functional changes to the logging system or public API surface.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 'fix(cli): hide file paths in log output unless debug mode enabled' directly aligns with the PR objective to configure RichHandler to show file paths only in debug mode.
✨ 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 pmc-20251109-logging

📜 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 89426c6 and d0dce64.

📒 Files selected for processing (1)
  • infrahub_sdk/ctl/utils.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

When implementing Infrahub checks, subclass InfrahubCheck and override validate(data); do not implement or rely on a check() method

Files:

  • infrahub_sdk/ctl/utils.py
infrahub_sdk/ctl/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

infrahub_sdk/ctl/**/*.py: Build CLI commands with Typer
Organize and keep all CLI commands within infrahub_sdk/ctl/

Files:

  • infrahub_sdk/ctl/utils.py
⏰ 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). (7)
  • GitHub Check: unit-tests (3.13)
  • GitHub Check: integration-tests-latest-infrahub
  • GitHub Check: unit-tests (3.11)
  • GitHub Check: unit-tests (3.12)
  • GitHub Check: unit-tests (3.9)
  • GitHub Check: unit-tests (3.10)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
infrahub_sdk/ctl/utils.py (1)

49-49: LGTM! Clean implementation of conditional path display.

The addition of show_path=debug to RichHandler correctly implements the PR objective. When debug mode is disabled, log output will be cleaner by hiding file paths, while preserving detailed location information when debugging.


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.

@petercrocker petercrocker requested review from a team November 9, 2025 08:47
@codecov
Copy link

codecov bot commented Nov 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@             Coverage Diff             @@
##           develop     #608      +/-   ##
===========================================
+ Coverage    75.13%   75.42%   +0.28%     
===========================================
  Files          112      108       -4     
  Lines        10972     9323    -1649     
  Branches      2368     1855     -513     
===========================================
- Hits          8244     7032    -1212     
+ Misses        2138     1802     -336     
+ Partials       590      489     -101     
Flag Coverage Δ
integration-tests 34.81% <100.00%> (ø)
python-3.10 48.51% <100.00%> (-1.93%) ⬇️
python-3.11 48.51% <100.00%> (-1.95%) ⬇️
python-3.12 48.49% <100.00%> (-1.95%) ⬇️
python-3.13 48.47% <100.00%> (-1.97%) ⬇️
python-3.9 47.17% <100.00%> (-1.82%) ⬇️
python-filler-3.12 24.44% <0.00%> (+0.63%) ⬆️

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

Files with missing lines Coverage Δ
infrahub_sdk/ctl/utils.py 68.53% <100.00%> (ø)

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercrocker petercrocker merged commit 5e90f25 into develop Nov 10, 2025
20 checks passed
@petercrocker petercrocker deleted the pmc-20251109-logging branch November 10, 2025 22:02
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