Repository navigation
fix(intune): narrow rotation failure detection - #509
Conversation
📝 WalkthroughWalkthroughChangesRotation detection narrowing
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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.
Inline comments:
In `@crates/cmtraceopen-parser/tests/intune_device_inventory.rs`:
- Around line 191-205: Update the fixture used by the exception-only test around
detect_dialect and parse_with_dispatcher so its ISO-header message is neutral
and contains no rotation wording such as “roll.” Preserve the .NET exception
continuation as the sole rotation signal, while keeping the existing dialect,
parser selection, specialization, and severity assertions unchanged.
In `@docs/superpowers/plans/2026-08-05-issue-506-rotation-detection-narrowing.md`:
- Line 19: Update the checklist line containing the `Failed ` and `Unhandled `
inline code spans so the trailing spaces are moved outside the backticks,
preserving the documented prefixes and meaning.
- Line 13: Update the “Task 1” and “Task 2” Markdown headings in the document
from level-three headings to level-two headings, preserving their existing
titles and content so heading levels follow the initial H1 sequentially.
- Around line 16-17: Update the plan’s references for
crates/cmtraceopen-parser/tests/intune_device_inventory.rs to list the final
ranges 125-161, 191-205, 243-262, and 500-522, replacing the outdated ranges.
Verify the documentation path and referenced test locations against the
repository before finalizing.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: dc8e6881-2fc7-4d1d-8618-c64f8aae0f12
📒 Files selected for processing (4)
crates/cmtraceopen-parser/src/intune/device/windows/inventory/mod.rscrates/cmtraceopen-parser/tests/intune_device_inventory.rsdocs/superpowers/plans/2026-08-05-issue-506-rotation-detection-narrowing.mdlibrary.md
💤 Files with no reviewable changes (1)
- crates/cmtraceopen-parser/src/intune/device/windows/inventory/mod.rs
| for path in ["unrelated.log", "IntuneDeviceInventory.log"] { | ||
| assert_eq!( | ||
| detect_dialect(path, other_wording), | ||
| Some(DeviceInventoryLogDialect::RotationFailure) | ||
| ); | ||
|
|
||
| let (result, selection) = | ||
| parse_with_dispatcher(other_wording, path, other_wording.len() as u64); | ||
| assert_eq!(selection.parser, ParserKind::IntuneDeviceInventory); | ||
| assert_eq!( | ||
| selection.specialization, | ||
| Some(ParserSpecialization::IntuneDeviceInventoryRotationFailure) | ||
| ); | ||
| assert_eq!(result.entries[0].severity, Severity::Error); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the exception-only fixture independent of rotation wording.
The header used by this test contains Could not roll the inventory log over. A broad roll matcher could satisfy the test without exercising the .NET exception continuation. Use a neutral ISO-header message. Keep the exception continuation as the only rotation signal.
🤖 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 `@crates/cmtraceopen-parser/tests/intune_device_inventory.rs` around lines 191
- 205, Update the fixture used by the exception-only test around detect_dialect
and parse_with_dispatcher so its ISO-header message is neutral and contains no
rotation wording such as “roll.” Preserve the .NET exception continuation as the
sole rotation signal, while keeping the existing dialect, parser selection,
specialization, and severity assertions unchanged.
|
|
||
| --- | ||
|
|
||
| ### Task 1: Pin the rotation-detection contract with failing tests |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use sequential Markdown heading levels.
The document starts with an H1. ### Task 1 and ### Task 2 skip the H2 level. Change both task headings to ##. This clears MD001.
Also applies to: 30-30
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 13-13: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
🤖 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 `@docs/superpowers/plans/2026-08-05-issue-506-rotation-detection-narrowing.md`
at line 13, Update the “Task 1” and “Task 2” Markdown headings in the document
from level-three headings to level-two headings, preserving their existing
titles and content so heading levels follow the initial H1 sequentially.
Source: Linters/SAST tools
| - Modify: `crates/cmtraceopen-parser/tests/intune_device_inventory.rs:118-193` | ||
| - Modify: `crates/cmtraceopen-parser/tests/intune_device_inventory.rs:409-431` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the test ranges in the plan.
The plan lists 118-193 and 409-431. The final test file places the related changes at Line 125 through Line 161, Line 191 through Line 205, Line 243 through Line 262, and Line 500 through Line 522. Update the ranges so readers can locate all covered behaviors.
As per path instructions, verify documentation paths and references against the repository.
🤖 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 `@docs/superpowers/plans/2026-08-05-issue-506-rotation-detection-narrowing.md`
around lines 16 - 17, Update the plan’s references for
crates/cmtraceopen-parser/tests/intune_device_inventory.rs to list the final
ranges 125-161, 191-205, 243-262, and 500-522, replacing the outdated ranges.
Verify the documentation path and referenced test locations against the
repository before finalizing.
Source: Path instructions
| - Modify: `crates/cmtraceopen-parser/tests/intune_device_inventory.rs:118-193` | ||
| - Modify: `crates/cmtraceopen-parser/tests/intune_device_inventory.rs:409-431` | ||
|
|
||
| - [x] Add direct-detection cases proving ISO headers beginning with `Failed ` and `Unhandled ` return no Device Inventory dialect for both `unrelated.log` and `IntuneDeviceInventory.log`. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove trailing spaces from inline code spans.
The Failed and Unhandled code spans contain trailing spaces. Move those spaces outside the backticks. This clears MD038 without changing the documented prefixes.
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 19-19: Spaces inside code span elements
(MD038, no-space-in-code)
[warning] 19-19: Spaces inside code span elements
(MD038, no-space-in-code)
🤖 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 `@docs/superpowers/plans/2026-08-05-issue-506-rotation-detection-narrowing.md`
at line 19, Update the checklist line containing the `Failed ` and `Unhandled `
inline code spans so the trailing spaces are moved outside the backticks,
preserving the documented prefixes and meaning.
Source: Linters/SAST tools
0d42386 to
6aba74b
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Closes #506
Summary
Failed …andUnhandled …ISO headers as Device Inventory rotation failuresfailed to rotate,rotation failed, andfailed to rollCritic regressions
Failed to rollback transaction.Rotation failedover to backup.Failed to rotateCredentials.All three remain generic timestamped content and informational under forced rotation parsing for both
unrelated.logandIntuneDeviceInventory.log.Validation
cargo test -p cmtraceopen-parser --test intune_device_inventory(24 passed)cargo test -p cmtraceopen-parsercargo clippy -p cmtraceopen-parser --all-targets -- -D warningsrustfmt --checknpx tsc --noEmitgit diff --checkOut of scope
Summary by CodeRabbit
Bug Fixes
Documentation
Tests