feat(rest-api): add campaign REST API over Flow operation runs#3718
feat(rest-api): add campaign REST API over Flow operation runs#3718kunzhao-nv wants to merge 6 commits into
Conversation
Regenerate the shared Flow proto and Go stubs from flow/proto/v1/flow.proto so the REST layer's flowv1 client exposes the OperationRun RPCs, including AdvanceOperationRunPhase. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
Wrap Flow's eight OperationRun RPCs in ManageCampaign activities and the matching workflows (create, get, list, list-targets, pause, resume, advance-phase, cancel), and register them with the site-agent Temporal worker. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
Expose Flow operation runs as campaigns: create, get, list, list targets, and the pause/resume/advance/cancel lifecycle actions. Handlers authenticate, resolve the Flow-enabled site, and drive the campaign Temporal workflows, converting OperationRun protos to API models. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
Document the campaign endpoints and schemas: create, get, list, list targets, and the pause/resume/advance/cancel lifecycle actions, including the nested create configuration tree (selector, options, phase/safety/conflict/ordering policies, and the firmware operation). Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
Covers 52aeb04. Restores the io.Reader/[]byte decode branches the generator version dropped so client.go carries only the CampaignAPI wiring. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
Cover the campaign layer end to end: model validation, the create configuration-tree ToProto, and proto-to-API conversions; the eight ManageCampaign activities and their workflows; and the eight REST handlers (auth, site/Flow gating, workflow invocation, response shape). Extends the Flow gRPC mock with the OperationRun RPCs the activity tests exercise. Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
|
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. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🌿 Preview your docs: https://nvidia-preview-pull-request-3718.docs.buildwithfern.com/infra-controller |
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-07-20 15:48:55 UTC | Commit: ddd1cbd |
Description
Add a campaign REST API over Flow's operation run — a phased, policy-gated rollout of one operation (firmware today) across many racks — so operators can drive and observe large multi-rack firmware rollouts instead of hand-scripting per-rack tasks.
/v2/org/{org}/nico/campaign: create, get, list, list per-rack targets, and the pause / resume / advance / cancel lifecycle actions. Each campaign materializes one execution target per rack; targets reference theirtaskIdso callers drill into per-rack detail via the existing Task endpoints.ManageCampaignactivities → Flow'sOperationRungRPC, mirroring the existing task / rule plumbing.flowv1exposes theOperationRunRPCs (includingAdvanceOperationRunPhase), adds the OpenAPI spec, and regenerates docs + SDK.Type of Change
Breaking Changes
Testing
Additional Notes