Skip to content

snapm: fix swapped _log_info() args in 'snapm snapset prune' output#447

Merged
bmr-cymru merged 1 commit intomainfrom
bmr-fix-swapped-log-message
Aug 28, 2025
Merged

snapm: fix swapped _log_info() args in 'snapm snapset prune' output#447
bmr-cymru merged 1 commit intomainfrom
bmr-fix-swapped-log-message

Conversation

@bmr-cymru
Copy link
Copy Markdown
Contributor

@bmr-cymru bmr-cymru commented Aug 28, 2025

Resolves: #432

Summary by CodeRabbit

  • Bug Fixes
    • Corrected log formatting in the prune operation: messages now list the pruned sources followed by the snapset name for accurate, readable logs.
    • Improves clarity for troubleshooting and audit trails; no changes to behavior, results, or subsequent printed output.
    • No modifications to public interfaces or command usage; only log text ordering is affected.

Resolves: #432
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
@bmr-cymru bmr-cymru self-assigned this Aug 28, 2025
@bmr-cymru bmr-cymru added Bug Something isn't working UI/UX User interface and experience labels Aug 28, 2025
@bmr-cymru bmr-cymru added the Debugging Issues affecting debugging label Aug 28, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 28, 2025

Walkthrough

Reordered arguments in a logging call within snapm/command.py’s _prune_cmd so the formatted message matches the intended parameter order. No control flow or API changes.

Changes

Cohort / File(s) Change Summary
Prune logging fix
snapm/command.py
Reordered logging args in _prune_cmd to align with format string ("Pruned sources (%s) from snapset '%s'").

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
Correct parameter order in prune log output (#432)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
None

Poem

I nibbled the logs, a carrot of code,
Flipped two args on the pruning road.
Now messages bloom, neat rows in the sun,
Snapsets and sources finally as one.
Thump-thump! says QA—my work here is done. 🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 92428f6 and c41db27.

📒 Files selected for processing (1)
  • snapm/command.py (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: bmr-cymru
PR: snapshotmanager/snapm#0
File: :0-0
Timestamp: 2025-08-25T00:18:37.114Z
Learning: In snapm/command.py, the use of print() vs _*_log() functions is intentional design. print() is used specifically for user output and structured reports (JSON, tabular) that are not suitable to pass through the log facility, while _*_log() functions are used for actual logging purposes.
Learnt from: bmr-cymru
PR: snapshotmanager/snapm#0
File: :0-0
Timestamp: 2025-08-25T00:18:37.114Z
Learning: In snapm/command.py, the use of print() vs _*_log() functions is intentional design. print() is used specifically for user output and structured reports (JSON, tabular) that are not suitable to pass through the log facility, while _*_log() functions are used for actual logging purposes.
📚 Learning: 2025-08-25T00:18:37.114Z
Learnt from: bmr-cymru
PR: snapshotmanager/snapm#0
File: :0-0
Timestamp: 2025-08-25T00:18:37.114Z
Learning: In snapm/command.py, the use of print() vs _*_log() functions is intentional design. print() is used specifically for user output and structured reports (JSON, tabular) that are not suitable to pass through the log facility, while _*_log() functions are used for actual logging purposes.

Applied to files:

  • snapm/command.py
🧬 Code graph analysis (1)
snapm/command.py (1)
snapm/_snapm.py (2)
  • name (894-898)
  • name (1386-1390)
⏰ 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). (38)
  • GitHub Check: rpm-build:fedora-41-x86_64
  • GitHub Check: rpm-build:centos-stream-10-x86_64
  • GitHub Check: rpm-build:fedora-43-x86_64
  • GitHub Check: rpm-build:epel-9-x86_64
  • GitHub Check: rpm-build:centos-stream-9-x86_64
  • GitHub Check: rpm-build:fedora-rawhide-x86_64
  • GitHub Check: rpm-build:fedora-42-x86_64
  • GitHub Check: rpm-build:epel-9-x86_64
  • GitHub Check: rpm-build:fedora-41-x86_64
  • GitHub Check: rpm-build:centos-stream-9-x86_64
  • GitHub Check: rpm-build:centos-stream-10-x86_64
  • GitHub Check: rpm-build:fedora-43-x86_64
  • GitHub Check: rpm-build:fedora-42-x86_64
  • GitHub Check: rpm-build:fedora-rawhide-x86_64
  • GitHub Check: rpm-build:fedora-42-x86_64
  • GitHub Check: rpm-build:fedora-rawhide-x86_64
  • GitHub Check: rpm-build:fedora-41-x86_64
  • GitHub Check: rpm-build:centos-stream-10-x86_64
  • GitHub Check: rpm-build:epel-9-x86_64
  • GitHub Check: rpm-build:centos-stream-9-x86_64
  • GitHub Check: rpm-build:fedora-43-x86_64
  • GitHub Check: virt_tests (uefi, lvm, centos-stream10)
  • GitHub Check: virt_tests (bios, lvm, centos-stream10)
  • GitHub Check: virt_tests (uefi, lvm-thin, centos-stream10)
  • GitHub Check: virt_tests (uefi, lvm-thin, fedora42)
  • GitHub Check: virt_tests (uefi, lvm, fedora41)
  • GitHub Check: virt_tests (bios, lvm-thin, centos-stream9)
  • GitHub Check: virt_tests (bios, lvm, fedora41)
  • GitHub Check: virt_tests (bios, lvm, centos-stream9)
  • GitHub Check: virt_tests (uefi, lvm-thin, fedora41)
  • GitHub Check: virt_tests (bios, lvm-thin, centos-stream10)
  • GitHub Check: virt_tests (uefi, lvm, fedora42)
  • GitHub Check: virt_tests (uefi, lvm, centos-stream9)
  • GitHub Check: virt_tests (uefi, lvm-thin, centos-stream9)
  • GitHub Check: virt_tests (bios, lvm-thin, fedora42)
  • GitHub Check: virt_tests (bios, lvm, fedora42)
  • GitHub Check: virt_tests (bios, lvm-thin, fedora41)
  • GitHub Check: python-basic-tests
🔇 Additional comments (2)
snapm/command.py (2)

1222-1226: LGTM: logging arguments now match format order.

The sources string is first, snapset name second, aligning with "Pruned sources (%s) from snapset '%s'".


660-673: prune_snapset correctly delegates in-place pruning via split_snapshot_set(name, None, sources); no changes needed.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bmr-fix-swapped-log-message

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/snapshotmanager-snapm-447
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@bmr-cymru bmr-cymru merged commit c41db27 into main Aug 28, 2025
29 of 33 checks passed
@bmr-cymru bmr-cymru deleted the bmr-fix-swapped-log-message branch November 10, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Debugging Issues affecting debugging UI/UX User interface and experience

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Log message parameters reversed in prune output

1 participant