Repository navigation
fix: Group error log formatting - #4256
Conversation
📝 WalkthroughWalkthroughLogging now handles grouped-job rule names correctly, permits omitted formatter quietness settings, wires DAG debugging into test runs, and expands logging regression coverage for formatter errors, stderr output, event counts, and grouped failures. ChangesLogging validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/test_logging.py (1)
443-448: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy liftAdd grouped-job retry coverage.
This invocation leaves
retriesat its0default, so it cannot verify failed-group resubmission or retention of successful task outputs. Add a scenario withretries > 0and differing task runtimes. Based on PR objectives, grouped-job retry behavior and successful outputs must be covered.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_logging.py` around lines 443 - 448, Extend the grouped-job failure scenario around the run invocation for test_group_job_fail to set retries greater than zero and use tasks with differing runtimes. Assert that failed groups are resubmitted and successful task outputs are retained, covering grouped-job retry behavior rather than only the default no-retry path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/test_logging.py`:
- Around line 443-448: Extend the grouped-job failure scenario around the run
invocation for test_group_job_fail to set retries greater than zero and use
tasks with differing runtimes. Assert that failed groups are resubmitted and
successful task outputs are retained, covering grouped-job retry behavior rather
than only the default no-retry path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d0a14deb-fd45-49d0-b1a9-0fbcc35700c2
📒 Files selected for processing (3)
src/snakemake/logging.pytests/common.pytests/test_logging.py
🤖 I have created a release *beep* *boop* --- ## [9.24.0](v9.23.1...v9.24.0) (2026-07-30) ### Features * allow to combine cases with otherwise in branch function ([#4262](#4262)) ([000ff52](000ff52)) ### Bug Fixes * avoid config hash crash for non-serializable values ([#4241](#4241)) ([1a27746](1a27746)) * compilation error when final line contains an f-string ([#4234](#4234)) ([9c5e7fe](9c5e7fe)) * Group error log formatting ([#4256](#4256)) ([bb6dcde](bb6dcde)) * leak of benchmark monitor threads ([#4259](#4259)) ([d37852e](d37852e)) * no benchmark warning when a process exits before it can be sampled ([#4260](#4260)) ([6738359](6738359)) * persistence starttime unset/defaults ([#4251](#4251)) ([56395c0](56395c0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Partial fix for #4248. It looks like this bug was introduced in #3107. In
Job.get_log_error_info()the"name"key in the returned dict was changed to"rule_name". HoweverDefaultFormatter._format_group_error()still used the"name"key when displaying error information for the jobs in the group. I'm not entirely sure why the error has gone mostly unnoticed until now.Added a regression test which runs the existing
test_group_job_failtest workflow and checks that theGROUP_INFOandGROUP_ERRORevents were emitted and are present in formatted log output with no formatting errors.Additional changes:
quietargument toDefaultFormatter's constructor a default value ofNone.I've also made some of the logging tests more robust in general to catch these sort of things:
test_log_events,test_log_events_dryrun, andtest_rule_failureare existing tests that check that a certain set of job events are emitted:DEBUG_DAGevent is emitted and checked intest_log_events. Required adding adebug_dagargument to therun()helper command which sets the corresponding property inOutputSettings.QC
docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).AI-assistance disclosure
I used AI assistance for:
Summary by CodeRabbit