fix: MVR cascade exclusion crashes with AttributeError when last referenced SVC is excluded - #236
Merged
Merged
Conversation
…renced SVC is excluded __delete_mvr iterated over _mvrs_from_svc[svc_urn_id] with a nested loop, treating each UrnId element as a list and calling .remove() on it. UrnId has no .remove(), causing an AttributeError at runtime whenever SVC filtering cascade-excluded an MVR. Fix by removing the spurious inner loop and calling .remove() directly on the list. Adds tests covering: MVR cascade-excluded when its sole SVC is excluded, MVR retained when at least one referenced SVC is included, and correct cleanup of excluded SVC from surviving MVR svc_ids. Fixes #235, refs #222.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
__delete_mvrwhere a spurious nested loop iterated overList[UrnId]and called.remove()on eachUrnIdelement, which has no such methodFixes #235, refs #222.
Test plan
test_mvr_excluded_when_sole_referenced_svc_is_excluded— MVR with only one excluded SVC is cascade-excludedtest_mvr_included_when_at_least_one_referenced_svc_is_included— MVR with a mix survivestest_excluded_svc_removed_from_included_mvr_svc_ids— surviving MVR's svc_ids cleaned up correctlytest_excluded_svc_not_present_after_filtering— excluded SVC gone from svcstest_included_svc_present_after_filtering— included SVC still in svcs