Skip to content

change(rest-api): Align REST API with new VpcPrefix lifecycle#2272

Open
bcavnvidia wants to merge 1 commit into
NVIDIA:mainfrom
bcavnvidia:rest-vpc-prefix
Open

change(rest-api): Align REST API with new VpcPrefix lifecycle#2272
bcavnvidia wants to merge 1 commit into
NVIDIA:mainfrom
bcavnvidia:rest-vpc-prefix

Conversation

@bcavnvidia

Copy link
Copy Markdown
Contributor

Description

VpcPrefix in the Rust back-end now has a full lifecycle. The REST API still only expects Ready/Deleting. This PR aligns the two, which mostly means a Provisioning state.

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Related Issues (Optional)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

@copy-pr-bot

copy-pr-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 541a242f-741b-4983-937e-2383a34182b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

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

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

@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

🧹 Nitpick comments (1)
rest-api/openapi/spec.yaml (1)

14351-14358: ⚡ Quick win

Consider enhancing state documentation for API consumers.

The enum values are correct, but the generic description "Status values for VPC Prefix objects" could be more informative. Production APIs benefit from explicit state semantics to reduce integration friction.

Consider documenting:

  • What each state represents (e.g., "Provisioning: Initial state during prefix allocation")
  • Valid state transitions (e.g., "Provisioning → Ready → Deleting → Deleted")
  • Any terminal states (Error, Deleted)

This helps API consumers understand the lifecycle without consulting additional documentation.

📝 Enhanced documentation example
     VpcPrefixStatus:
       title: VpcPrefixStatus
       type: string
-      description: Status values for VPC Prefix objects
+      description: |
+        Status of VPC Prefix lifecycle:
+        - Provisioning: Prefix is being allocated
+        - Ready: Prefix is active and available
+        - Deleting: Prefix deletion in progress
+        - Deleted: Prefix has been removed
+        - Error: Prefix encountered an error during lifecycle operation
       enum:
         - Provisioning
         - Ready
         - Deleting
         - Deleted
         - Error
🤖 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/workflow/pkg/activity/vpcprefix/vpcprefix.go`:
- Around line 121-123: The current guard in vpcprefix.go that checks "if
vpcPrefix.Status == cdbm.VpcPrefixStatusDeleting && status !=
cdbm.VpcPrefixStatusDeleting { continue }" prevents persisting a transition from
Deleting to Deleted; change the condition to allow the terminal transition by
only skipping updates when the existing status is Deleting and the new status is
neither Deleting nor Deleted (i.e., also check cdbm.VpcPrefixStatusDeleted), so
the Deleting->Deleted transition is permitted; update the condition that
references vpcPrefix.Status and the local variable status accordingly.
🪄 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: 74b06d0f-f73a-449a-beb7-b7e8b1b37102

📥 Commits

Reviewing files that changed from the base of the PR and between 4488ebc and 45e0630.

⛔ Files ignored due to path filters (3)
  • 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/workflow-schema/site-agent/workflows/v1/nico_nico.proto is excluded by !rest-api/workflow-schema/site-agent/workflows/v1/*_nico.proto
📒 Files selected for processing (14)
  • rest-api/api/pkg/api/handler/vpcprefix.go
  • rest-api/api/pkg/api/handler/vpcprefix_test.go
  • rest-api/db/pkg/db/model/vpcprefix.go
  • rest-api/docs/index.html
  • rest-api/openapi/spec.yaml
  • rest-api/sdk/standard/model_interface.go
  • rest-api/sdk/standard/model_interface_create_request.go
  • rest-api/sdk/standard/model_tenant_identity_config_create_or_update_request.go
  • rest-api/sdk/standard/model_vpc_prefix_status.go
  • rest-api/site-workflow/pkg/activity/vpcprefix.go
  • rest-api/site-workflow/pkg/activity/vpcprefix_test.go
  • rest-api/site-workflow/pkg/grpc/client/testing.go
  • rest-api/workflow/pkg/activity/vpcprefix/vpcprefix.go
  • rest-api/workflow/pkg/activity/vpcprefix/vpcprefix_test.go
💤 Files with no reviewable changes (1)
  • rest-api/sdk/standard/model_tenant_identity_config_create_or_update_request.go

Comment thread rest-api/workflow/pkg/activity/vpcprefix/vpcprefix.go Outdated
@bcavnvidia bcavnvidia marked this pull request as ready for review June 8, 2026 19:38
@bcavnvidia bcavnvidia requested a review from a team as a code owner June 8, 2026 19:38
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 8, 2026

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-08 19:40:58 UTC | Commit: 2846231

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🔍 Container Scan Summary

Service Total Critical High Medium Low Other
nico-flow 116 13 50 41 4 8
nico-nsm 133 11 45 66 11 0
nico-psm 118 13 52 41 4 8
nico-rest-api 182 16 84 67 7 8
nico-rest-cert-manager 95 5 47 32 3 8
nico-rest-db 116 13 50 41 4 8
nico-rest-site-agent 115 13 50 41 3 8
nico-rest-site-manager 102 6 48 37 3 8
nico-rest-workflow 118 13 52 41 4 8
TOTAL 1095 103 478 407 43 64

Per-CVE detail lives in the per-service grype-* artifacts (JSON + SARIF). Severity counts only — no CVE IDs published here.

@bcavnvidia bcavnvidia requested a review from thossain-nv June 9, 2026 14:55
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.

1 participant