fix(oscal): use the correct sectionID in list export - #1092
Devansh-567 wants to merge 1 commit into
Conversation
Signed-off-by: Devansh-567 <devansh.jay.singh@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Summary by CodeRabbit
WalkthroughChangesOSCAL section mapping
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The OSCAL export now preserves the intended section identifier mapping with direct regression coverage; no unresolved merge risk remains. 🚥 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 |
|
Hi @northdpole, are there any active reviewers? |
PR fix
While looking through the OSCAL export code, I noticed that list_to_oscal() was using doc.section when creating the sectionID property.
This meant that the exported OSCAL data could contain the section text as both section and sectionID, while the actual sectionID value was never exported.
The issue is a small field mix-up here:
name="sectionID",
value="".join(doc.section.splitlines()).strip(),
This should use doc.sectionID instead.
What changed
Testing
I verified that the new test fails with the old implementation and passes with the fix.
The full test suite passes with: