Skip to content

OSAC-463: Enforce VirtualNetwork child referential integrity via DB triggers#688

Open
tchughesiv wants to merge 9 commits into
osac-project:mainfrom
tchughesiv:OSAC-463-block-vn-delete-with-child-refs
Open

OSAC-463: Enforce VirtualNetwork child referential integrity via DB triggers#688
tchughesiv wants to merge 9 commits into
osac-project:mainfrom
tchughesiv:OSAC-463-block-vn-delete-with-child-refs

Conversation

@tchughesiv

@tchughesiv tchughesiv commented Jun 12, 2026

Copy link
Copy Markdown

OSAC-463: VirtualNetwork can be deleted while still referenced by Subnet

Jira: https://redhat.atlassian.net/browse/OSAC-463
Story type: Bug

Summary

Enforces VirtualNetwork ↔ Subnet/SecurityGroup referential integrity at the database layer using migration 54, following the same trigger pattern as OSAC-879 (migration 52 for Subnet ↔ ComputeInstance).

  • BEFORE UPDATE on virtual_networks: block soft-delete when active Subnets or SecurityGroups reference the VN (FailedPrecondition / Z0003)
  • BEFORE INSERT on subnets and security_groups: validate the referenced VirtualNetwork exists and is not deleted (InvalidArgument / Z0002)

Soft-deleted children no longer block VN deletion — the delete trigger counts only rows with deletion_timestamp = 'epoch'.

This PR supersedes #586. Please close #586 in favor of this PR.

Changes

  • internal/database/migrations/54_add_virtual_network_child_ref_triggers.up.sql
    • Bidirectional triggers + partial indexes on data->'spec'->>'virtual_network'
  • internal/database/migrations/54_add_virtual_network_child_ref_triggers_test.go
    • 13 migration tests covering block/allow paths, soft-delete semantics, and insert validation
  • internal/servers/private_virtual_networks_server_test.go
    • "Deletion validation" suite (server-level delete behavior via generic DAO + triggers)
  • internal/servers/compute_instances_server_test.go, private_compute_instances_server_test.go
    • Seed test-vnet before test-subnet in BeforeEach (required by insert trigger)

No app-layer checkNoChildReferences() guard — PrivateVirtualNetworksServer.Delete() delegates to generic.Delete() like other resources under OSAC-879.

Public API inherits enforcement via delegation — no changes to virtual_networks_server.go.

Testing

  • Migration tests: 13 specs in migration 54 test file
  • Server tests: "Deletion validation" suite on private VirtualNetworks server
  • Fixture fix: compute instance server BeforeEach creates parent VN before subnet

Validation run locally:

  • ginkgo run --focus="Compute instances server|Private compute instances server" internal/servers — 67/67 pass
  • ginkgo run --focus="Deletion validation" internal/servers — pass
  • ginkgo run internal/database/migrations --focus="54_add_virtual_network_child_ref_triggers" — pass

Acceptance Criteria

  • AC-1: Block delete when Subnets reference the VirtualNetwork (FailedPrecondition)
  • AC-2: Block delete when SecurityGroups reference the VirtualNetwork (FailedPrecondition)
  • AC-3: Allow delete when no active child resources exist; allow after children soft-deleted
  • AC-4: Fix at fulfillment-service API level (enforced via DB triggers on generic delete path)
  • AC-5: Prevents the reproducible failure mode from the asciinema recording
### Test with Subnet
% osac create virtualnetwork -n osac463-vn \
  --network-class 019eb21a-c335-742d-a72b-d099c76be44d \
  --ipv4-cidr 10.99.0.0/16
Created virtual network 'osac463-vn' (ID: 019ebd4e-03fd-7758-a28b-2eec472804a0).

% osac create subnet -n osac463-subnet \
  --virtual-network osac463-vn \
  --ipv4-cidr 10.99.1.0/24
Created subnet 'osac463-subnet' (ID: 019ebd4e-a52c-72ef-bc9f-3fa7543feda7).

% osac delete virtualnetwork osac463-vn
Failed to delete virtualnetwork '019ebd4e-03fd-7758-a28b-2eec472804a0': rpc error: code = FailedPrecondition desc = cannot delete VirtualNetwork '019ebd4e-03fd-7758-a28b-2eec472804a0': 1 Subnet(s) still reference it
Error: 1

### Delete works once references removed
% osac delete subnet osac463-subnet
Deleted subnet '019ebd4e-a52c-72ef-bc9f-3fa7543feda7'.

% osac delete virtualnetwork osac463-vn
Deleted virtualnetwork '019ebd4e-03fd-7758-a28b-2eec472804a0'.

Related

  • Precedent: OSAC-879 / migration 52 (Subnet ↔ ComputeInstance triggers)

Summary by CodeRabbit

  • Tests
    • Introduced validation tests for virtual network deletion when dependent resources exist
    • Tests confirm deletion fails when subnets or security groups reference the network
    • Tests validate error messages include details about dependent resource types and counts
    • Updated test infrastructure for compute instance operations

@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot

openshift-ci-robot commented Jun 12, 2026

Copy link
Copy Markdown

@tchughesiv: This pull request references OSAC-463 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.

Details

In response to this:

OSAC-463: VirtualNetwork can be deleted while still referenced by Subnet

Jira: https://redhat.atlassian.net/browse/OSAC-463
Story type: Bug

Summary

Adds a delete-time referential integrity guard to PrivateVirtualNetworksServer.Delete(). The server now queries for child Subnets and SecurityGroups before allowing deletion, returning FailedPrecondition when references exist. This prevents cascading destruction of network topology and running workloads.

This PR supersedes #586 with a focused two-file change (no unrelated console CLI work). Please close #586 in favor of this PR.

Changes

  • internal/servers/private_virtual_networks_server.go
  • Add checkNoChildReferences() — checks Subnets then SecurityGroups via DAO List with %q filter
  • Wire guard into Delete() before generic.Delete()
  • Return FailedPrecondition with descriptive message including reference count
  • internal/servers/private_virtual_networks_server_test.go
  • Add "Deletion referential integrity" test suite (6 cases)

Public API inherits the guard via delegation — no changes to virtual_networks_server.go.

Testing

  • Unit tests: 6 new specs covering allow/block paths for Subnets and SecurityGroups, cleanup-then-delete, and count in error message
  • Integration tests: N/A (deferred per plan; CI will run it/ suite)
  • Coverage: Delete() 100%; all AC behaviors exercised through private server delete

Validation run locally:

  • buf lint && buf generate — pass
  • uv run dev.py lint — pass
  • ginkgo run --focus="Deletion referential integrity" internal/servers — 6/6 pass
  • ginkgo run -r internal — pass (all suites)
  • go build ./cmd/fulfillment-service && go build ./cmd/osac — pass

Acceptance Criteria

  • AC-1: Block delete when Subnets reference the VirtualNetwork (FailedPrecondition)
  • AC-2: Block delete when SecurityGroups reference the VirtualNetwork (FailedPrecondition)
  • AC-3: Allow delete when no child resources exist; allow after children removed
  • AC-4: Fix at fulfillment-service API level (private server)
  • AC-5: Prevents the reproducible failure mode from the asciinema recording

Out of scope

ComputeInstance delete guards are tracked separately in OSAC-879.

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.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: f943f9fa-4b9b-4b6a-ae79-5fb6d5b558a1

📥 Commits

Reviewing files that changed from the base of the PR and between 9754682 and e3a9319.

📒 Files selected for processing (4)
  • internal/database/migrations/55_add_virtual_network_child_ref_triggers.up.sql
  • internal/database/migrations/55_add_virtual_network_child_ref_triggers_test.go
  • internal/servers/compute_instances_server_test.go
  • internal/servers/private_compute_instances_server_test.go
💤 Files with no reviewable changes (1)
  • internal/database/migrations/55_add_virtual_network_child_ref_triggers.up.sql

Walkthrough

Migration 55 adds two partial indexes and three PL/pgSQL trigger functions enforcing referential integrity between virtual_networks and its child tables (subnets, security_groups) under soft-delete semantics, using FOR SHARE locking. Migration and server-level test suites validate all enforcement paths. Compute instance test fixtures are updated to satisfy the new insert constraints.

Changes

VirtualNetwork Deletion Referential Integrity

Layer / File(s) Summary
SQL indexes and PL/pgSQL trigger functions
internal/database/migrations/55_add_virtual_network_child_ref_triggers.up.sql
Adds two partial lookup indexes on subnets and security_groups by virtual_network JSON path. Defines check_virtual_network_not_in_use (BEFORE UPDATE, errcode Z0003), check_subnet_virtual_network_ref (BEFORE INSERT, errcode Z0002), and check_security_group_virtual_network_ref (BEFORE INSERT, errcode Z0002), all using FOR SHARE locking to prevent TOCTOU races.
Migration-level trigger and index tests
internal/database/migrations/55_add_virtual_network_child_ref_triggers_test.go
Validates creation of all three trigger functions and triggers, correct index definitions, Z0003 soft-delete blocking (by subnet, security group, multiple subnets), allow-cases (no children, soft-deleted children), and Z0002 insert rejection for non-existent and soft-deleted VirtualNetwork references across both child tables.
Server-level deletion validation tests
internal/servers/private_virtual_networks_server_test.go
Adds Ginkgo suite with DAO setup and helper functions; asserts FailedPrecondition for active Subnet/SecurityGroup references, successful deletion after removing referencing SecurityGroup, and correct reference count in error text.
Compute instance test fixture prerequisites
internal/servers/compute_instances_server_test.go, internal/servers/private_compute_instances_server_test.go
Inserts a VirtualNetwork fixture before the Subnet fixture in BeforeEach to satisfy the new BEFORE INSERT constraint on subnets.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant PrivateVirtualNetworksServer
  participant virtual_networks DB
  participant subnets DB
  participant security_groups DB

  Client->>PrivateVirtualNetworksServer: DeleteVirtualNetwork(id)
  PrivateVirtualNetworksServer->>virtual_networks DB: UPDATE set deletion_timestamp (soft-delete)
  virtual_networks DB->>subnets DB: COUNT active WHERE spec.virtual_network = id (FOR SHARE)
  virtual_networks DB->>security_groups DB: COUNT active WHERE spec.virtual_network = id (FOR SHARE)
  alt active children exist
    virtual_networks DB-->>PrivateVirtualNetworksServer: RAISE Z0003 (count + child type)
    PrivateVirtualNetworksServer-->>Client: FailedPrecondition error
  else no active children
    virtual_networks DB-->>PrivateVirtualNetworksServer: OK
    PrivateVirtualNetworksServer-->>Client: Deleted
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Suggested labels

lgtm

Suggested reviewers

  • eranco74
  • jhernand

Poem

🛡️ No orphan subnets shall roam free,
The trigger stands guard with Z0003.
FOR SHARE locks the race condition door,
Soft-delete blocked — dangling refs, no more.
The network stays whole, integrity reigns,
Even security_groups are held by their chains. 🔗

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR title accurately and specifically describes the primary change: enforcing VirtualNetwork child referential integrity via database triggers, matching all code changes and migration work.
Linked Issues check ✅ Passed PR fully satisfies linked issue #586 (OSAC-463): blocks VirtualNetwork deletion when Subnet/SecurityGroup references exist, and allows deletion when no active children reference it—all requirements met.
Out of Scope Changes check ✅ Passed All changes are in-scope: migration 55 triggers, migration tests, server-level deletion validation tests, and fixture updates to support trigger validation—no unrelated modifications present.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets detected. Test code uses placeholder identifiers and legitimate auth package references; migration SQL uses parameterized queries without embedded credentials.
No-Weak-Crypto ✅ Passed PR contains only database migrations, triggers, and test code for referential integrity enforcement. No cryptographic algorithms, custom crypto implementations, or secret comparisons are present.
No-Injection-Vectors ✅ Passed No injection vectors found. All SQL queries use parameterized statements ($1, $2 placeholders). PostgreSQL format() calls in triggers are only used for error message strings, not SQL construction....
Container-Privileges ✅ Passed PR contains only Go test and SQL migration files with no container/K8s manifests, Dockerfiles, or privileged container configurations introduced.
No-Sensitive-Data-In-Logs ✅ Passed PR contains no logging that exposes sensitive data (passwords, tokens, API keys, PII, session IDs, hostnames, customer data). Error messages include resource IDs per established migration 52 patter...
Ai-Attribution ✅ Passed No evidence of AI tool usage mentioned in PR description or commit messages. The only commit (e3a9319) lacks any Assisted-by/Generated-by trailers and doesn't indicate AI involvement.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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 `@internal/servers/private_virtual_networks_server_test.go`:
- Around line 1443-1445: Remove the unnecessary metadata.annotations entry
"osac.io/owner-reference": vn.GetId() from the Subnet and SecurityGroup test
fixtures; locate the fixtures in private_virtual_networks_server_test.go where
Annotations: map[string]string{ "osac.io/owner-reference": vn.GetId(), } is set
and delete that Annotations map (or at least that key), leaving
Spec.VirtualNetwork populated as the sole relationship indicator (the
referential checks use spec.virtual_network). Ensure no other tests rely on that
annotation and update any fixture construction sites that contain the same
pattern at the other noted locations.

In `@internal/servers/private_virtual_networks_server.go`:
- Line 229: Validate the incoming virtualNetworkID (obtained from
request.GetId()) as a UUID before building the CEL filter: call
uuid.Parse(virtualNetworkID) (from github.com/google/uuid) and if it returns an
error, return a gRPC InvalidArgument (e.g., status.Errorf(codes.InvalidArgument,
"invalid virtual network id: %v", err)); only after successful parse construct
the filter variable (filter := fmt.Sprintf("this.spec.virtual_network == %q",
virtualNetworkID)) and proceed with the existing DAO/List logic so malformed IDs
are rejected early.
🪄 Autofix (Beta)

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: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 6c5094ef-517f-4c89-8940-9278bcb6bfd6

📥 Commits

Reviewing files that changed from the base of the PR and between c385789 and 84e2d43.

📒 Files selected for processing (2)
  • internal/servers/private_virtual_networks_server.go
  • internal/servers/private_virtual_networks_server_test.go

Comment thread internal/servers/private_virtual_networks_server_test.go Outdated
Comment thread internal/servers/private_virtual_networks_server.go Outdated
Add docstrings for Delete and checkNoChildReferences, and remove
unnecessary owner-reference annotations from deletion guard tests.
@tchughesiv tchughesiv changed the title OSAC-463: VirtualNetwork can be deleted while still referenced by Subnet OSAC-463: Add referential integrity checks to block VirtualNetwork deletion when referenced by Subnets or SecurityGroups Jun 12, 2026
@tchughesiv

Copy link
Copy Markdown
Author

Addressed CodeRabbit feedback in b100e1f:

Pre-merge checks

  • Title: Updated to describe the guard behavior (block delete when child refs exist).
  • Docstrings: Added docs on Delete() and expanded checkNoChildReferences().

Inline comments

  • Test fixtures: Removed unnecessary osac.io/owner-reference annotations — the guard only checks spec.virtual_network.
  • UUID validation: Declining for now; matches the existing catalog_item_reference_checker pattern (no format pre-check, %q-quoted CEL filter). Happy to add if we want this consistently across all reference guards.

Focused tests still pass: ginkgo run --focus="Deletion referential integrity" internal/servers (6/6).

@tchughesiv

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tchughesiv

tchughesiv commented Jun 12, 2026

Copy link
Copy Markdown
Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@eranco74

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@openshift-ci openshift-ci Bot removed the lgtm label Jun 15, 2026

subnetResponse, err := s.subnetDao.List().
SetFilter(filter).
SetLimit(1).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you aren't interested in the items but only on the count you can put 0 here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks... we only need GetTotal(), not the returned items. I kept SetLimit(1) because in our DAO SetLimit(0) maps to defaultLimit (100), not “return zero rows” — see also the test “Interprets zero limit as requesting the default number of items”.

SetLimit(1) is the minimal row fetch today (the count(*) query always runs regardless). Same pattern as daoReferenceChecker.hasReference().

If we want count-only behavior repo-wide, I can follow up with a small DAO change (skip the SELECT when only the count is needed) — happy to do that in a separate commit on this branch or a follow-up PR, whichever the team prefers.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer relevant if we keep DB trigger approach

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct; it is a negative value that means "count only":

It("Interprets negative limit as requesting zero items", func() {
response, err := generic.List().
SetLimit(-123).
Do(ctx)
Expect(err).ToNot(HaveOccurred())
Expect(response.GetSize()).To(BeZero())
Expect(response.GetItems()).To(BeEmpty())
})
. So use -1, for example.

I opened https://redhat.atlassian.net/browse/OSAC-1541 to improve that.

return grpcstatus.Errorf(grpccodes.FailedPrecondition,
"cannot delete VirtualNetwork '%s': %d Subnet(s) still reference it",
virtualNetworkID, subnetResponse.GetTotal())
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if a new subnet referencing the virtual network is created after this check but before the delete is sent to the database?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same pattern as PrivateClusterCatalogItemsServer.Delete + daoReferenceChecker.hasReference(): check then delete inside one RPC handler, both DAO calls using the transaction from TxInterceptor.UnaryServer (List reads tx from context).

Under PostgreSQL READ COMMITTED, a concurrent create that commits between the List count and generic.Delete could theoretically slip through... same tradeoff we already accept for catalog-item delete.

OSAC-463 is the application-layer guard for the common case (delete VN while children still exist). Hard guarantees would need DB triggers like migration 52 (subnet ↔ compute instance). We should probably treat that as a separate design decision, not part of this PR unless you want it scoped in.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking closer at #646 ... it used DB triggers. i'll add a new commit to this PR implementing similar approach and we can decide if we want to keep it or not.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adopted the OSAC-879 / migration 52 pattern in migration 54: bidirectional triggers with FOR SHARE on child insert. removed the app-layer checkNoChildReferences... enforcement is DB-only, same as subnet ↔ compute instance.

return grpcstatus.Errorf(grpccodes.FailedPrecondition,
"cannot delete VirtualNetwork '%s': %d SecurityGroup(s) still reference it",
virtualNetworkID, sgResponse.GetTotal())
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, what happens if a security group referencing this virtual network is created after this check but before the delete?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Replace the application-layer delete guard with bidirectional PostgreSQL
triggers (migration 54): block virtual network soft-delete when active
subnets or security groups reference it, and validate child inserts with
FOR SHARE locking to close TOCTOU races.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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
`@internal/database/migrations/54_add_virtual_network_child_ref_triggers_test.go`:
- Around line 292-314: Add a new test case in the same test block to validate
that creating a security group referencing a non-existent virtual network (not
just soft-deleted) is prevented. Create a test similar to the existing "Prevents
creating a security group referencing a soft-deleted virtual network" test but
without inserting the virtual network at all, and directly attempt to insert a
security group referencing a non-existent virtual network ID. Verify the
operation fails with the expected error code Z0002 and that the error message
contains the referenced virtual network ID. This covers the non-existent
VirtualNetwork path that is currently untested, complementing the existing
soft-deleted scenario validation.
- Around line 73-89: The test loop checking for the indexes
"subnets_by_virtual_network" and "security_groups_by_virtual_network" only
validates that indexes with these names exist, but does not verify their actual
definition or predicate. Strengthen each iteration by querying the indexdef
column from pg_indexes (or an equivalent approach) to also assert that the index
definition is correct and matches what the migration is supposed to create, not
just that an index with the right name exists.
🪄 Autofix (Beta)

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: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 80859a88-4f17-4a82-89d5-ea38820833e6

📥 Commits

Reviewing files that changed from the base of the PR and between 209638b and 9754682.

📒 Files selected for processing (3)
  • internal/database/migrations/54_add_virtual_network_child_ref_triggers.up.sql
  • internal/database/migrations/54_add_virtual_network_child_ref_triggers_test.go
  • internal/servers/private_virtual_networks_server_test.go

Migration 54's subnet insert trigger requires the referenced VirtualNetwork
to exist. Seed test-vnet in BeforeEach before creating test-subnet.
@tchughesiv tchughesiv changed the title OSAC-463: Add referential integrity checks to block VirtualNetwork deletion when referenced by Subnets or SecurityGroups OSAC-463: Enforce VirtualNetwork child referential integrity via DB triggers Jun 15, 2026
Assert index expression/predicate via pg_indexes.indexdef and add
SecurityGroup non-existent VirtualNetwork insert test.
@openshift-ci

openshift-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eranco74, jhernand, tchughesiv

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tchughesiv

Copy link
Copy Markdown
Author

/test e2e-vmaas

@openshift-ci

openshift-ci Bot commented Jun 16, 2026

Copy link
Copy Markdown

@tchughesiv: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-vmaas c5a48e0 link true /test e2e-vmaas

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci openshift-ci Bot removed the lgtm label Jun 16, 2026
@openshift-ci

openshift-ci Bot commented Jun 16, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

main added 54_create_baremetal_tables; duplicate migration 54 broke CI
BeforeSuite. Renumber OSAC-463 triggers to migration 55.
@openshift-ci openshift-ci Bot removed the lgtm label Jun 16, 2026
@openshift-ci

openshift-ci Bot commented Jun 16, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants