Skip to content

refactor run logger#89

Merged
dhth merged 2 commits intomainfrom
refactor-run-logger
Apr 3, 2026
Merged

refactor run logger#89
dhth merged 2 commits intomainfrom
refactor-run-logger

Conversation

@dhth
Copy link
Copy Markdown
Owner

@dhth dhth commented Apr 3, 2026

Encapsulate printing logic into RunLogger, making merge_prs a bit cleaner.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

📝 Walkthrough

Walkthrough

The pull request contains infrastructure and logging refactoring changes. The GitHub Actions workflows in main.yml and pr.yml have their dedicated test jobs removed, keeping only build and lint stages. The justfile removes utility recipes for system information and architecture-specific commands. The logging system in src/merge/log.rs is restructured: the RunLog type is renamed to RunLogger, the banner() method is renamed to print_banner(), and two new public methods are added—print_startup_info() and print_conclusion()—to consolidate logging responsibilities. The empty_line() method visibility is reduced to private. References throughout src/merge/mod.rs and tests are updated accordingly.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 68.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'refactor run logger' directly and clearly summarizes the main change: renaming RunLog to RunLogger and encapsulating printing logic into the logger component.
Description check ✅ Passed The description 'Encapsulate printing logic into RunLogger, making merge_prs a bit cleaner' is directly related to the changeset, describing the core refactoring objective.

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


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.

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
src/merge/tests/log.rs (1)

21-21: Optional: extract a tiny test helper for logger setup.

RunLogger::new(&mut buffer, &behaviours) repeats across most test cases; a helper would reduce duplication and make future API renames cheaper.

♻️ Suggested refactor
+fn new_logger<'a>(
+    buffer: &'a mut Vec<u8>,
+    behaviours: &RunBehaviours,
+) -> RunLogger<&'a mut Vec<u8>> {
+    RunLogger::new(buffer, behaviours)
+}
-    let mut l = RunLogger::new(&mut buffer, &RunBehaviours::default());
+    let mut l = new_logger(&mut buffer, &RunBehaviours::default());
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/merge/tests/log.rs` at line 21, Create a small test helper that
centralizes the repeated logger setup to reduce duplication: add a function
(e.g., make_test_logger or setup_run_logger) that accepts a mutable buffer (or
constructs one) and optional behaviours, and returns the instantiated RunLogger
created via RunLogger::new(&mut buffer, &behaviours) using
RunBehaviours::default when behaviours are not provided; then replace direct
calls to RunLogger::new(&mut buffer, &RunBehaviours::default()) in tests with
the new helper to simplify future API renames and keep tests DRY.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/merge/tests/log.rs`:
- Line 21: Create a small test helper that centralizes the repeated logger setup
to reduce duplication: add a function (e.g., make_test_logger or
setup_run_logger) that accepts a mutable buffer (or constructs one) and optional
behaviours, and returns the instantiated RunLogger created via
RunLogger::new(&mut buffer, &behaviours) using RunBehaviours::default when
behaviours are not provided; then replace direct calls to RunLogger::new(&mut
buffer, &RunBehaviours::default()) in tests with the new helper to simplify
future API renames and keep tests DRY.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f1e3be31-9b27-48be-8874-9014991107ff

📥 Commits

Reviewing files that changed from the base of the PR and between 2c358c2 and b2fc9a6.

📒 Files selected for processing (6)
  • .github/workflows/main.yml
  • .github/workflows/pr.yml
  • justfile
  • src/merge/log.rs
  • src/merge/mod.rs
  • src/merge/tests/log.rs
💤 Files with no reviewable changes (3)
  • .github/workflows/pr.yml
  • justfile
  • .github/workflows/main.yml

@dhth dhth merged commit d41185f into main Apr 3, 2026
17 checks passed
@dhth dhth deleted the refactor-run-logger branch April 3, 2026 04:38
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.

1 participant