Skip to content

Add resource id annotation for standalone Nexus operations - #877

Merged
jiechenz merged 1 commit into
mainfrom
jiechenz/standalone-resource-id
Oct 27, 2026
Merged

jiechenz merged 1 commit into
mainfrom
jiechenz/standalone-resource-id

Conversation

@jiechenz

@jiechenz jiechenz commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

What changed?

Annotate the standalone Nexus operation RPCs (Start, Describe, Poll, RequestCancel, Terminate, Delete) with a temporal-resource-id request header of "nexus-operation:{operation_id}", and add the missing "activity:{activity_id}" annotation to DeleteActivityExecution so it matches the rest of the standalone activity RPCs.

Why?

Breaking changes

Server PR

Annotate the standalone Nexus operation RPCs (Start, Describe, Poll,
RequestCancel, Terminate, Delete) with a temporal-resource-id request
header of "nexus-operation:{operation_id}", and add the missing
"activity:{activity_id}" annotation to DeleteActivityExecution so it
matches the rest of the standalone activity RPCs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jiechenz
jiechenz force-pushed the jiechenz/standalone-resource-id branch from 64818c9 to 61cfccd Compare October 27, 2026 01:08
@jiechenz
jiechenz requested a review from yycptt October 27, 2026 01:17
@jiechenz
jiechenz merged commit 0e6a27d into main Oct 27, 2026
4 checks passed
@jiechenz
jiechenz deleted the jiechenz/standalone-resource-id branch October 27, 2026 23:53
jiechenz added a commit that referenced this pull request Oct 27, 2026
…897)

Stacked on #877. 

<!-- Describe what has changed in this PR -->
**What changed?**

- Add `protoc-gen-resource-id-lint`, a protoc plugin that `make` runs in
the `grpc` lint step (so CI runs it too). It checks every RPC in every
service and fails when:
- the RPC has neither a `temporal-resource-id` `request_header`
annotation nor an entry in
`cmd/protoc-gen-resource-id-lint/exemptions.go`;
  - an exempted RPC has the annotation;
  - an exemption names an RPC that does not exist.
- Exempt the RPCs that have no single resource to route by: namespace
and cluster management, list/count queries, workflow rules,
`ShutdownWorker`, deprecated deployment APIs, and all `OperatorService`
RPCs.
- Add `temporal-resource-id` annotations to RPCs that were missing them,
using the same values as their sibling RPCs:
  - `CreateWorkerDeployment`: `deployment:{deployment_name}`
- `CreateWorkerDeploymentVersion`,
`UpdateWorkerDeploymentVersionComputeConfig`,
`ValidateWorkerDeploymentVersionComputeConfig`:
`deployment:{deployment_version.deployment_name}`
- `UpdateWorkerVersioningRules`, `GetWorkerVersioningRules`,
`UpdateWorkerBuildIdCompatibility`, `GetWorkerBuildIdCompatibility`:
`taskqueue:{task_queue}`

The check only requires that the annotation is present. It does not
validate the annotation value.

To exempt a new RPC, add `"<Service>.<Method>": {}` to `exemptions.go`.

<!-- Tell your future self why have you made these changes -->
**Why?**

New RPCs have shipped without a `temporal-resource-id` annotation, for
example the standalone Nexus operation RPCs fixed in #877. Requiring the
annotation, or an explicit exemption, makes that decision part of every
API review.

<!-- Are there any breaking changes on binary or code level? -->
**Breaking changes**

None at the wire or code level. The eight new annotations change the
request headers SDKs send for those RPCs once they pick up the new
protos.

<!-- If this breaks the Server, please provide the Server PR to merge
right after this PR was merged. -->
**Server PR**

None required. After the api-go bump, regenerate
`common/rpc/interceptor/routing_key_extractor_gen.go` (`make
proto-codegen`) to pick up the eight new annotations.
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