OSAC-3704: Add regression tests for VirtualNetwork delete protection with typed references - #331
OSAC-3704: Add regression tests for VirtualNetwork delete protection with typed references#331clobrano wants to merge 1 commit into
Conversation
…with typed references Migration 90 fixed the trigger to use typed reference paths, but lacked tests verifying the fix works. Added three tests confirming check_virtual_network_not_in_use() correctly blocks deletion when Subnets, SecurityGroups, or NATGateways reference the VirtualNetwork using typed reference format. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Your Name <you@example.com>
|
@clobrano: This pull request references OSAC-3704 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: clobrano The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughMigration 90 gains integration tests for typed subnet, security group, and NAT gateway references. Each test verifies that soft-deleting the referenced virtual network fails with PostgreSQL error ChangesTyped reference trigger tests
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change adds localized regression coverage for typed VirtualNetwork references; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
|
🤖 Finished Review · ✅ Success · Started 7:13 AM UTC · Completed 7:23 AM UTC Commit: |
|
Looks good to me |
Summary
Adds regression test coverage to migration 90's test suite for the VirtualNetwork delete-protection trigger fix.
check_virtual_network_not_in_use()correctly blocks VirtualNetwork deletion when Subnets reference it using typed reference formatContext
Migration 90 fixed a JSON path mismatch in the
check_virtual_network_not_in_use()trigger that allowed VirtualNetworks to be deleted while children still referenced them (OSAC-3704). The fix updated the path fromdata->'spec'->>'virtual_network'todata->'spec'->'virtual_network'->>'id'to handle typed reference objects. The migration's test suite verified backfill behavior but lacked tests for the trigger protection itself.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit