fix(compliance): show ancestors whose implementation groups dont't match selected ones but whose descendants do#4001
fix(compliance): show ancestors whose implementation groups dont't match selected ones but whose descendants do#4001nas-tabchiche wants to merge 2 commits intomainfrom
Conversation
…h but whose descendants did
| if any(group in node_groups for group in implementation_groups): | ||
| return True |
There was a problem hiding this comment.
actual application diff is these 2 lines
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughfilter_graph_by_implementation_groups() was changed to treat missing implementation_groups as empty lists and to retain ancestor nodes when any descendant matches the selected implementation groups; nodes are now kept if they match or have surviving (matching) children after recursive filtering. ChangesGraph Filtering Behavior
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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. Review rate limit: 6/8 reviews remaining, refill in 11 minutes and 31 seconds.Comment |
|
isn't this the expected behaviour? during authoring, we put the IG on the assessable nodes not their parents |
There was a problem hiding this comment.
Works great! Howerver, if a parent node is assessable and you select an IG that belongs to the child only and not to the parent, CISO throws a 404 Error when clicking on the parent.
You can reproduce the issue with the following Excel file, by selecting the Group 2 IG and clicking on the A - Level 1 node (a 404 Error also occurs if the parent node doesn't have any defined IGs) :
problem.xlsx
Maybe we could fix this in another PR ?
UPDATE
Fixed in PR #4063
I think this becomes an issue if we encounter a specific framework where parents are assessable and have different IGs from their children. We do have frameworks with assessable parents, but we didn't encouter this specific issue with IGs until it was reported. EDIT : We DID encounter this issue in the past, but we were using workaround consisting of adding the children's IGs to the parents' IGs |
Summary
filter_graph_by_implementation_groupsshort-circuited on a node's own IGs: if the node had IGs of its own and none matched, the entire subtree was pruned — even when descendants did match.Reproduction (the reported case)
core,annex-a) carry pre-tagged IGs (['Clauses'],['SoA']).P1and tag someA.5.xleaves.P1.Test plan
backend/core/tests/test_helpers.pycover the regression and neighbouring edge cases (5 tests, all passing).test_helpers.pysuite still green (38/38).Summary by CodeRabbit