Skip to content

refactor(rest-api): retire bespoke Flow workflows - #5656

Merged
kunzhao-nv merged 2 commits into
NVIDIA:mainfrom
kunzhao-nv:remove-bespoke-flow-workflows
Sep 3, 2026
Merged

refactor(rest-api): retire bespoke Flow workflows#5656
kunzhao-nv merged 2 commits into
NVIDIA:mainfrom
kunzhao-nv:remove-bespoke-flow-workflows

Conversation

@kunzhao-nv

@kunzhao-nv kunzhao-nv commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

This completes the contract phase of the Flow gRPC proxy migration. #4560 registered the generic proxy alongside the per-method workers, and #4706 moved every Flow-backed API call to that proxy. The 26 rack, tray, task, task-rule, and task-run workflow/activity pairs now have no production callers, so retaining them only preserves an obsolete Temporal worker surface.

This removes those bespoke workflows, activities, registrations, and their dedicated tests. A subscriber test now pins InvokeFlowGRPC and InvokeFlowGRPCOnSite as the only Flow worker registrations. With the obsolete workflow types gone, this also removes the temporary flow-grpc- namespace and restores the original descriptive workflow IDs.

Related issues

Closes #4271.

Builds on #4560 and #4706.

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.)

Breaking Changes

  • This PR contains breaking changes

Deploy this only after every cloud API instance runs a release containing #4706 and Temporal has no open execution of a removed workflow type. Let executions submitted with the temporary flow-grpc- IDs reach their bounded completion before restoring the original IDs. During the rolling cloud API upgrade, old and new replicas can submit an identical request under both names, but both names dispatch the same generic proxy workflow. After deploying this Site Agent, rolling the cloud API back to a release before #4706 is unsupported because that API would submit workflow types the worker no longer registers.

Testing

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

Additional Notes

The removed workflows allowed up to two activity attempts, with the longest start-to-close timeout at five minutes per attempt. Query Temporal for open legacy executions rather than relying only on an elapsed drain interval.

Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
@kunzhao-nv
kunzhao-nv requested a review from a team as a code owner September 1, 2026 23:34
@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 069a7cde-ed76-4b47-b405-c20a107d6978

📥 Commits

Reviewing files that changed from the base of the PR and between f3e4bec and 42240ca.

📒 Files selected for processing (14)
  • rest-api/api/pkg/api/handler/nvlinkdomain_test.go
  • rest-api/api/pkg/api/handler/rack.go
  • rest-api/api/pkg/api/handler/task.go
  • rest-api/api/pkg/api/handler/task_test.go
  • rest-api/api/pkg/api/handler/taskrule.go
  • rest-api/api/pkg/api/handler/taskrule_test.go
  • rest-api/api/pkg/api/handler/taskrun.go
  • rest-api/api/pkg/api/handler/taskrun_test.go
  • rest-api/api/pkg/api/handler/tray.go
  • rest-api/api/pkg/api/handler/util/common/common.go
  • rest-api/api/pkg/api/handler/util/common/flowmutation_test.go
  • rest-api/api/pkg/api/handler/util/common/grpcproxy.go
  • rest-api/api/pkg/api/handler/util/common/grpcproxy_test.go
  • rest-api/skills/rest-flow-grpc-proxy/SKILL.md
💤 Files with no reviewable changes (1)
  • rest-api/api/pkg/api/handler/util/common/grpcproxy.go

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Summary by CodeRabbit

  • Changes

    • Flow gRPC integration now registers only the generic proxy workflow and activity.
    • Rack, tray, task, operation-rule, and operation-run capabilities are no longer available through the site workflow service.
    • Workflow IDs now use descriptive resource-specific namespaces without the transport prefix.
    • Rolling upgrades may temporarily support both old and new workflow IDs.
  • Documentation

    • Updated workflow ID guidance for migration and rolling upgrades.
  • Tests

    • Added coverage confirming generic Flow gRPC handlers are registered when enabled.

Walkthrough

The change moves Flow-backed endpoints to the generic proxy workflow and activity. It removes endpoint-specific workflow and activity implementations and tests. Handlers now pass descriptive workflow IDs without the flow-grpc- transport prefix.

Changes

Flow proxy migration

Layer / File(s) Summary
Workflow ID contract
rest-api/api/pkg/api/handler/*.go, rest-api/api/pkg/api/handler/util/common/*, rest-api/skills/rest-flow-grpc-proxy/SKILL.md
Handlers and tests use descriptive workflow IDs directly. Migration guidance documents temporary namespaces only during workflow coexistence.
Generic proxy registration
rest-api/site-agent/pkg/components/managers/flowgrpc/subscriber.go, rest-api/site-agent/pkg/components/managers/flowgrpc/subscriber_test.go
RegisterSubscriber registers only InvokeFlowGRPC and InvokeFlowGRPCOnSite when Flow gRPC is enabled. Tests verify the registrations.
Endpoint-specific workflow removal
rest-api/site-workflow/pkg/activity/*, rest-api/site-workflow/pkg/workflow/*
Rack, tray, task, task-rule, and task-run workflow and activity implementations and their tests are deleted.
Helper removal
rest-api/api/pkg/api/handler/util/common/grpcproxy.go
The exported FlowWorkflowID helper is deleted.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Merge Risk: ⚪ Minimal · up to 42240

Flow-backed handlers now use descriptive workflow IDs directly while retaining endpoint-specific ID derivation and request behavior. No concrete merge-blocking risk is established.

Sequence Diagram(s)

sequenceDiagram
  participant APIHandler
  participant InvokeFlowGRPC
  participant InvokeFlowGRPCOnSite
  APIHandler->>InvokeFlowGRPC: Start descriptive workflow ID
  InvokeFlowGRPC->>InvokeFlowGRPCOnSite: Dispatch Flow gRPC request
  InvokeFlowGRPCOnSite-->>InvokeFlowGRPC: Return Flow response
  InvokeFlowGRPC-->>APIHandler: Return proxy result
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 15 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes complete the generic FlowProxy migration described in [#4271] by removing obsolete workflow and activity pairs while preserving endpoint-specific workflow ID and conflict-policy behavior i…
Out of Scope Changes check ✅ Passed The removed implementations, registrations, dedicated tests, workflow ID cleanup, and documentation updates are all related to retiring the bespoke Flow workflow surface after proxy adoption. No unrel…
Title check ✅ Passed The title clearly and concisely identifies the main change: retiring bespoke Flow workflows in the REST API.
Description check ✅ Passed The description directly explains the removal of bespoke Flow workflows, activities, registrations, tests, migration context, breaking changes, deployment requirements, and testing.
Full details: Linked Issues check

Explanation

The changes complete the generic FlowProxy migration described in [#4271] by removing obsolete workflow and activity pairs while preserving endpoint-specific workflow ID and conflict-policy behavior in the handlers and tests.

Full details: Out of Scope Changes check

Explanation

The removed implementations, registrations, dedicated tests, workflow ID cleanup, and documentation updates are all related to retiring the bespoke Flow workflow surface after proxy adoption. No unrelated code changes are identified.

Full details: Docstring Coverage

Explanation

Docstring coverage is 52.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 25 functions across 15 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3e4bec59e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@kunzhao-nv
kunzhao-nv requested a review from jw-nvidia September 1, 2026 23:39
@github-actions

github-actions Bot commented Sep 1, 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-09-01 23:39:14 UTC | Commit: f3e4bec

@thossain-nv thossain-nv added the rest-api Add this label when an issue or PR concerns NICo REST API label Sep 1, 2026 — with ChatGPT Codex Connector
Comment thread rest-api/api/pkg/api/handler/util/common/grpcproxy.go Outdated

@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.

Looks good @kunzhao-nv BUt let's consider going back to original workflow IDs.

Signed-off-by: Kun Zhao <kunzhao@nvidia.com>
@kunzhao-nv
kunzhao-nv enabled auto-merge (squash) September 3, 2026 23:29
@kunzhao-nv
kunzhao-nv disabled auto-merge September 3, 2026 23:30
@kunzhao-nv
kunzhao-nv merged commit abf3375 into NVIDIA:main Sep 3, 2026
124 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rest-api Add this label when an issue or PR concerns NICo REST API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: create a generic FlowProxy for Flow-backed endpoints

3 participants