Skip to content

feat(rest-api): Enhance get-all VPC peering filtering and peer tenant visibility#2867

Open
hwadekar-nv wants to merge 8 commits into
NVIDIA:mainfrom
hwadekar-nv:feat/enhance-vpc-peering
Open

feat(rest-api): Enhance get-all VPC peering filtering and peer tenant visibility#2867
hwadekar-nv wants to merge 8 commits into
NVIDIA:mainfrom
hwadekar-nv:feat/enhance-vpc-peering

Conversation

@hwadekar-nv

@hwadekar-nv hwadekar-nv commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

#2089

The get-all VPC peering endpoint only supported filtering by siteId and isMultiTenant, so users could not narrow results by status, a specific VPC, or a linked peer tenant. For multi-tenant peerings, the response also did not show which tenant owned each VPC.

  • Added status, vpcId, and peerTenantId query parameters on GET /v2/org/{org}/nico/vpc-peering, including a new PeerTenantIDs DB filter separate from authorization-scoped tenant filtering.
  • Exposed vpc1TenantId and vpc2TenantId in the API response so clients can identify peer tenants without extra lookups.
  • Unit test
  • Updated the OpenAPI spec and regenerated the Go SDK to match the new filters and response fields.

Type of Change

  • Add - New feature or capability

Testing

  • Unit tests added/updated

@hwadekar-nv hwadekar-nv requested a review from nvlitagaki June 25, 2026 00:04
@hwadekar-nv hwadekar-nv self-assigned this Jun 25, 2026
@hwadekar-nv hwadekar-nv requested a review from a team as a code owner June 25, 2026 00:04
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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

Walkthrough

The PR adds VPC peering list filters for status, VPC ID, and peer tenant ID. It also returns tenant IDs for both peered VPCs and filters peerings by either side’s owning tenant.

Changes

VPC peering API and persistence updates

Layer / File(s) Summary
Peering contract and response model
rest-api/openapi/spec.yaml, rest-api/api/pkg/api/model/vpcpeering.go, rest-api/api/pkg/api/model/vpcpeering_test.go
status, vpcId, and peerTenantId are added to the peering query contract, and vpc1TenantId/vpc2TenantId are added to the peering response model and covered by model tests.
Handler filters and relation loading
rest-api/api/pkg/api/handler/vpcpeering.go, rest-api/api/pkg/api/handler/vpcpeering_test.go
The peering handler validates the new query parameters, resolves VPC and tenant IDs, forces Vpc1/Vpc2 relation loading, and the handler tests cover the new filters and tenant-id assertions.
DAO peer-tenant filtering
rest-api/db/pkg/db/model/vpcpeering.go, rest-api/db/pkg/db/model/vpcpeering_test.go
VpcPeeringFilterInput gains PeerTenantIDs, and the SQL builder/test coverage filters peerings by either VPC owner tenant.

Tenant listing pagination and filters

Layer / File(s) Summary
Tenant DAO contract and query behavior
rest-api/db/pkg/db/model/tenant.go
The tenant DAO adds pagination to GetAll, defines default ordering, and applies org, org display name, and tenant ID filters in the SQL implementation.
Tenant DAO GetAll tests
rest-api/db/pkg/db/model/tenant_test.go
The tenant DAO test coverage exercises paginated GetAll behavior across org, org display name, and tenant ID filter combinations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: expanded VPC peering filtering and tenant visibility.
Description check ✅ Passed The description is directly aligned with the changeset and accurately describes the new filters, response fields, and spec updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

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

@hwadekar-nv hwadekar-nv force-pushed the feat/enhance-vpc-peering branch from 4c4191a to 55e5ce7 Compare June 25, 2026 00:05
@github-actions

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

No Grype artifacts were found to aggregate.

@github-actions

Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-06-25 00:07:22 UTC | Commit: 4c4191a

@nvlitagaki

nvlitagaki commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Exposing vpc1TenantId and vpc2TenantId is helpful so users know what filterable values are for VPC peerings, but these UUIDs are not easily understood by users. We need something more user-friendly to be shown additionally, like the orgDisplayName for the tenant. We could also fall back to just the org value if the tenant's org doesn't have the orgDisplayName populated.

@hwadekar-nv hwadekar-nv force-pushed the feat/enhance-vpc-peering branch from bfa3732 to d9962df Compare June 25, 2026 17:31

@coderabbitai coderabbitai Bot left a comment

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.

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 `@rest-api/api/pkg/api/handler/vpcpeering.go`:
- Around line 614-621: The relation preload logic in the VPC peering handler is
too narrowly gated by filterInput.VpcIDs and filterInput.PeerTenantIDs, which
can leave vpc1TenantId and vpc2TenantId unset in normal list responses. Update
the includeRelations handling in the vpc peering list path so Vpc1RelationName
and Vpc2RelationName are always loaded whenever the response includes tenant ID
fields, keeping the response consistent with the OpenAPI contract and preserving
compatibility.
- Around line 563-578: The peer tenant query handling in the VPC peering handler
only reads a single `peerTenantId`, so repeated query values are dropped and the
`PeerTenantIDs` filter is not populated consistently. Update the `Get`/query
parsing logic in `vpcpeering.go` to read all `peerTenantId` values from the
request, resolve each one through `common.GetTenantFromIDString`, and append
valid tenant IDs into `filterInput.PeerTenantIDs` while preserving the existing
invalid/not-found/error responses and `logger.Error` behavior.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 882a2acf-2c0d-4f35-a284-ff78d73528ab

📥 Commits

Reviewing files that changed from the base of the PR and between 55e5ce7 and d9962df.

⛔ Files ignored due to path filters (33)
  • rest-api/sdk/standard/api_vpc_peering.go is excluded by !rest-api/sdk/standard/api_*.go
  • rest-api/sdk/standard/client.go is excluded by !rest-api/sdk/standard/client.go
  • rest-api/sdk/standard/model_batch_instance_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_machine.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_machine_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_machine_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_power_shelf.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_power_shelf_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_power_shelf_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_rack.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_rack_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_rack_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_switch.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_switch_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_switch_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_infini_band_partition.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_infini_band_partition_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_infini_band_partition_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_type.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_type_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_type_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_machine.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_machine_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_network_security_group.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_network_security_group_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_network_security_group_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_vpc.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_vpc_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_vpc_peering.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_vpc_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
📒 Files selected for processing (7)
  • rest-api/api/pkg/api/handler/vpcpeering.go
  • rest-api/api/pkg/api/handler/vpcpeering_test.go
  • rest-api/api/pkg/api/model/vpcpeering.go
  • rest-api/api/pkg/api/model/vpcpeering_test.go
  • rest-api/db/pkg/db/model/vpcpeering.go
  • rest-api/db/pkg/db/model/vpcpeering_test.go
  • rest-api/openapi/spec.yaml
🚧 Files skipped from review as they are similar to previous changes (6)
  • rest-api/db/pkg/db/model/vpcpeering_test.go
  • rest-api/openapi/spec.yaml
  • rest-api/api/pkg/api/handler/vpcpeering_test.go
  • rest-api/api/pkg/api/model/vpcpeering.go
  • rest-api/db/pkg/db/model/vpcpeering.go
  • rest-api/api/pkg/api/model/vpcpeering_test.go

Comment thread rest-api/api/pkg/api/handler/vpcpeering.go
Comment thread rest-api/api/pkg/api/handler/vpcpeering.go

@nvlitagaki nvlitagaki left a comment

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.

Generally asking for small changes, but adding a more user-legible way of identifying the tenant is a must.

Comment thread rest-api/api/pkg/api/handler/vpcpeering.go Outdated
in: query
name: vpcId
required: false
description: Optional filter by VPC ID involved in the peering as either vpc1 or vpc2.

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.

For consistency, we should state that this can be repeated multiple times.

Comment thread rest-api/api/pkg/api/handler/vpcpeering.go Outdated
OrderBy: pageRequest.OrderBy,
}
vpcPeerings, total, err := vpcPeeringDAO.GetAll(ctx, nil, filterInput, vpcPeeringPageInput, qIncludeRelations)
includeRelations := vpcPeeringIncludeRelationsForTenantIDs(qIncludeRelations)

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.

Why are we sending the whole of vpc1 and vpc2 back in the response even when the client didn't ask for them? Agreed that we need to look at the VPCs to get the tenant values, but that doesn't mean we need to send all that extra information back unexpectedly.

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.

The implementation has been changed and now lives on lines 655-660, but the question still stands

expectedCount: 1,
},
{
name: "tenant admin 1 filters by pending status",

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.

It might be more useful to validate that filtering by multiple statuses works

Comment on lines +651 to +657
name: "tenant admin 1 filters by vpcId",
reqOrgName: tnOrg1,
queryParams: map[string]string{"vpcId": vpc1.ID.String()},
user: tnu1,
expectedStatus: http.StatusOK,
expectedCount: 3,
},

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.

Since all the created peerings have vpc1 as the first vpc, this doesn't really help test that the filter works regardless of whether the vpc specified in the filter is the first vpc or the second. It would be good to have a test case that covers that.

Comment thread rest-api/api/pkg/api/handler/vpcpeering.go Outdated
@hwadekar-nv

Copy link
Copy Markdown
Contributor Author

@nvlitagaki Thanks for reviewing it, for adding more readable filter by Tenant such as either org or orgDisplayName would required Tenant table join, but for security how concern this would be? cc @hanyux-nv @thossain-nv

Comment thread rest-api/api/pkg/api/handler/vpcpeering.go Outdated
Comment thread rest-api/api/pkg/api/handler/vpcpeering.go Outdated
@nvlitagaki

Copy link
Copy Markdown
Contributor

@nvlitagaki Thanks for reviewing it, for adding more readable filter by Tenant such as either org or orgDisplayName would required Tenant table join, but for security how concern this would be? cc @hanyux-nv @thossain-nv

My thought is that if they already have a close enough relationship with the other tenant that they are giving them access to at least one of their VPCs, then it's OK for them to know how that tenant is listed as an org. I also don't know how else they can realistically keep track of which tenant is which if they have peering relationships with multiple other tenants.

Comment thread rest-api/api/pkg/api/handler/vpcpeering_test.go Outdated
if vpcIDStrs := qParams["vpcId"]; len(vpcIDStrs) != 0 {
gavph.tracerSpan.SetAttribute(handlerSpan, attribute.StringSlice("vpcId", vpcIDStrs), logger)
for _, vpcIDStr := range vpcIDStrs {
vpc, verr := common.GetVpcFromIDString(ctx, nil, vpcIDStr, nil, gavph.dbSession)

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.

We should use a single query to fetch all VPCs and load in map to validate. Other endpoints have established patterns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

if peerTenantIDStrs := qParams["peerTenantId"]; len(peerTenantIDStrs) != 0 {
gavph.tracerSpan.SetAttribute(handlerSpan, attribute.StringSlice("peerTenantId", peerTenantIDStrs), logger)
for _, peerTenantIDStr := range peerTenantIDStrs {
peerTenant, verr := common.GetTenantFromIDString(ctx, nil, peerTenantIDStr, gavph.dbSession)

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.

We should use a single query to fetch all Tenants and load in map to validate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@hwadekar-nv hwadekar-nv force-pushed the feat/enhance-vpc-peering branch 2 times, most recently from e58f637 to 8e91569 Compare June 25, 2026 21:22

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

♻️ Duplicate comments (1)
rest-api/api/pkg/api/handler/vpcpeering.go (1)

532-542: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Echo the offending status value in the error response.

The vpcId and peerTenantId paths surface the invalid value (Invalid VPC ID %v in query), but the status path returns the generic "Invalid Status value in query". For both diagnosability and consistency across the three new filters, include the rejected value as is already logged on line 537.

📝 Proposed fix
 			if !cdbm.VpcPeeringStatusMap[status] {
 				logger.Warn().Msg(fmt.Sprintf("invalid value in status query: %v", status))
-				return cutil.NewAPIErrorResponse(c, http.StatusBadRequest, "Invalid Status value in query", nil)
+				return cutil.NewAPIErrorResponse(c, http.StatusBadRequest, fmt.Sprintf("Invalid status value %v in query", status), nil)
 			}

Note: this mirrors nvlitagaki's earlier request on line 538.

🤖 Prompt for 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.

In `@rest-api/api/pkg/api/handler/vpcpeering.go` around lines 532 - 542, The
status query validation in vpcpeering handler returns a generic bad-request
message instead of echoing the rejected value like the vpcId and peerTenantId
checks. Update the invalid-status branch in the status filter logic to include
the offending status string in the API error response, matching the existing
logger.Warn output and the pattern used by the other filter validations.
🧹 Nitpick comments (2)
rest-api/db/pkg/db/model/tenant.go (1)

202-205: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Apply the explicit empty-filter contract to every filter slice.

TenantIDs: []uuid.UUID{} returns zero rows, but Orgs: []string{} and OrgDisplayNames: []string{} still continue into query construction. Please short-circuit all non-nil empty filters consistently.

Proposed fix
-	if filter.TenantIDs != nil && len(filter.TenantIDs) == 0 {
+	if (filter.TenantIDs != nil && len(filter.TenantIDs) == 0) ||
+		(filter.Orgs != nil && len(filter.Orgs) == 0) ||
+		(filter.OrgDisplayNames != nil && len(filter.OrgDisplayNames) == 0) {
 		return tns, 0, nil
 	}

As per path instructions, “Review database changes for Bun/pgx query correctness, transaction boundaries, migration ordering, data-model compatibility.”

🤖 Prompt for 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.

In `@rest-api/db/pkg/db/model/tenant.go` around lines 202 - 205, The empty-filter
shortcut in the tenant query logic only handles TenantIDs, so empty Orgs and
OrgDisplayNames still flow into query construction. Update the filter handling
in Tenant model query code to short-circuit any non-nil empty slice consistently
across TenantIDs, Orgs, and OrgDisplayNames before building the Bun query,
returning an empty result and zero count from the same method.

Source: Path instructions

rest-api/db/pkg/db/model/tenant_test.go (1)

503-585: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add at least one real pagination case.

The new DAO contract includes pagination, but every case uses TotalLimit, so regressions in Limit, Offset, or explicit OrderBy handling would not be caught. Add a small-page case that asserts total stays at the full match count while len(got) reflects the page size.

As per coding guidelines, “Verification should exercise the behavior that changed.”

Source: Coding guidelines

🤖 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 `@rest-api/api/pkg/api/handler/vpcpeering.go`:
- Around line 437-439: The Swagger annotation for vpcId in the VPC peering
handler is inconsistent with the query parsing behavior in the same handler,
since qParams["vpcId"] accepts multiple values like status and peerTenantId.
Update the comment near the VPC peering query parameters so vpcId also նշotes
that it is repeatable for multiple values, keeping the annotation aligned with
the handler contract and generated OpenAPI spec.

---

Duplicate comments:
In `@rest-api/api/pkg/api/handler/vpcpeering.go`:
- Around line 532-542: The status query validation in vpcpeering handler returns
a generic bad-request message instead of echoing the rejected value like the
vpcId and peerTenantId checks. Update the invalid-status branch in the status
filter logic to include the offending status string in the API error response,
matching the existing logger.Warn output and the pattern used by the other
filter validations.

---

Nitpick comments:
In `@rest-api/db/pkg/db/model/tenant.go`:
- Around line 202-205: The empty-filter shortcut in the tenant query logic only
handles TenantIDs, so empty Orgs and OrgDisplayNames still flow into query
construction. Update the filter handling in Tenant model query code to
short-circuit any non-nil empty slice consistently across TenantIDs, Orgs, and
OrgDisplayNames before building the Bun query, returning an empty result and
zero count from the same method.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: efaf8af1-567e-42b2-8602-4e4cca156329

📥 Commits

Reviewing files that changed from the base of the PR and between a20ffe3 and 3acacca.

⛔ Files ignored due to path filters (40)
  • rest-api/sdk/standard/api_vpc_peering.go is excluded by !rest-api/sdk/standard/api_*.go
  • rest-api/sdk/standard/client.go is excluded by !rest-api/sdk/standard/client.go
  • rest-api/sdk/standard/model_batch_instance_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_machine.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_machine_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_machine_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_power_shelf.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_power_shelf_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_power_shelf_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_rack.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_rack_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_rack_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_switch.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_switch_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_expected_switch_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_infini_band_partition.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_infini_band_partition_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_infini_band_partition_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_type.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_type_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_type_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_instance_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_interface.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_interface_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_machine.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_machine_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_network_security_group.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_network_security_group_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_network_security_group_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_vpc.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_vpc_create_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_vpc_peering.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/sdk/standard/model_vpc_update_request.go is excluded by !rest-api/sdk/standard/model_*.go
  • rest-api/workflow-schema/flow/protobuf/v1/flow_grpc.pb.go is excluded by !**/*.pb.go, !rest-api/**/*.pb.go, !rest-api/**/*_grpc.pb.go
  • rest-api/workflow-schema/schema/site-agent/workflows/v1/fmds_nico_grpc.pb.go is excluded by !**/*.pb.go, !rest-api/**/*.pb.go, !rest-api/**/*_grpc.pb.go
  • rest-api/workflow-schema/schema/site-agent/workflows/v1/nico_nico.pb.go is excluded by !**/*.pb.go, !rest-api/**/*.pb.go
  • rest-api/workflow-schema/schema/site-agent/workflows/v1/nico_nico_grpc.pb.go is excluded by !**/*.pb.go, !rest-api/**/*.pb.go, !rest-api/**/*_grpc.pb.go
  • rest-api/workflow-schema/schema/site-agent/workflows/v1/nmx_c_nico_grpc.pb.go is excluded by !**/*.pb.go, !rest-api/**/*.pb.go, !rest-api/**/*_grpc.pb.go
📒 Files selected for processing (10)
  • rest-api/api/pkg/api/handler/vpcpeering.go
  • rest-api/api/pkg/api/handler/vpcpeering_test.go
  • rest-api/api/pkg/api/model/vpcpeering.go
  • rest-api/api/pkg/api/model/vpcpeering_test.go
  • rest-api/db/pkg/db/model/tenant.go
  • rest-api/db/pkg/db/model/tenant_test.go
  • rest-api/db/pkg/db/model/vpcpeering.go
  • rest-api/db/pkg/db/model/vpcpeering_test.go
  • rest-api/docs/index.html
  • rest-api/openapi/spec.yaml
🚧 Files skipped from review as they are similar to previous changes (6)
  • rest-api/openapi/spec.yaml
  • rest-api/db/pkg/db/model/vpcpeering_test.go
  • rest-api/api/pkg/api/model/vpcpeering.go
  • rest-api/api/pkg/api/model/vpcpeering_test.go
  • rest-api/db/pkg/db/model/vpcpeering.go
  • rest-api/api/pkg/api/handler/vpcpeering_test.go

Comment thread rest-api/api/pkg/api/handler/vpcpeering.go
@hwadekar-nv hwadekar-nv force-pushed the feat/enhance-vpc-peering branch from effc2d7 to 6c887bf Compare June 25, 2026 21:34

@thossain-nv thossain-nv left a comment

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.

Looking good @hwadekar-nv Let's merge after making a few other changes suggested.

Comment thread rest-api/api/pkg/api/handler/vpcpeering.go Outdated
}

// Get status from query param
if statusStrings := qParams["status"]; len(statusStrings) != 0 {

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.

Let's use this pattern:

qStatuses := qParams["status"]
if len(qStatuses) {
    ....
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

// Get vpcId from query param
if vpcIDStrs := qParams["vpcId"]; len(vpcIDStrs) != 0 {

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 as above, split the conditional:

qVpcIds := qParams["vpcId"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment thread rest-api/db/pkg/db/model/tenant.go Outdated
//
GetAll(ctx context.Context, tx *db.Tx, filter TenantFilterInput, page paginator.PageInput, includeRelations []string) ([]Tenant, int, error)
//
GetAllByOrg(ctx context.Context, tx *db.Tx, org string, includeRelations []string) ([]Tenant, error)

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.

Let's converge GetAllByOrg into GetAll

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@hwadekar-nv hwadekar-nv force-pushed the feat/enhance-vpc-peering branch 2 times, most recently from 08bff14 to 17ca321 Compare June 26, 2026 01:13
@hwadekar-nv hwadekar-nv requested a review from nvlitagaki June 26, 2026 01:13
@hwadekar-nv hwadekar-nv force-pushed the feat/enhance-vpc-peering branch from 17ca321 to b91d692 Compare June 26, 2026 02:25
@hwadekar-nv hwadekar-nv force-pushed the feat/enhance-vpc-peering branch from b91d692 to f1269e5 Compare June 26, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants