Skip to content

[Nexus] Migrate registry and event definitions#9491

Open
gow wants to merge 6 commits intocg/nexus/history_events_registry_1from
cg/nexus/history_events_registry_2
Open

[Nexus] Migrate registry and event definitions#9491
gow wants to merge 6 commits intocg/nexus/history_events_registry_1from
cg/nexus/history_events_registry_2

Conversation

@gow
Copy link
Contributor

@gow gow commented Mar 12, 2026

What changed?

Migrating Nexus history event Registry and Definition. I've also moved all the event implementations as well with commented out bodies. I will replace the implementations of Apply() and CherryPick() in follow PRs.
Depends on #9474

Why?

Migrating Nexus from HSM to CHASM.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Note

Medium Risk
Introduces a new event-definition registry path that will be used during replication/reset/cherry-pick flows; current Nexus event handlers are registered but Apply logic is stubbed to no-op, which could change behavior once these events are processed.

Overview
Adds first-class history event support to the CHASM workflow Registry by introducing EventDefinition, RegisterEventDefinition, and lookup/storage for EventType handlers alongside existing command handlers.

Wires Nexus operations into this new mechanism by registering definitions for all Nexus operation history events (scheduled/cancel/start/complete/fail/cancel/timeout) via Fx, with placeholder Apply implementations and basic cherry-pick gating (skip command-like events and respect RESET_REAPPLY_EXCLUDE_TYPE_NEXUS).

Written by Cursor Bugbot for commit f56cfa0. This will update automatically on new commits. Configure here.

@gow gow requested review from a team as code owners March 12, 2026 04:27
@gow gow requested review from bergundy and stephanos March 12, 2026 04:28
@gow gow changed the title Migrate registry and event definitions [Nexus] Migrate registry and event definitions Mar 12, 2026
@gow gow force-pushed the cg/nexus/history_events_registry_2 branch from 434044c to 5e9b49e Compare March 12, 2026 04:43
Comment on lines +165 to +166
// We never cherry pick command events, and instead allow user logic to reschedule those commands.
return workflowregistry.ErrNotCherryPickable
Copy link
Member

Choose a reason for hiding this comment

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

This is not a command.

Copy link
Member

Choose a reason for hiding this comment

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

Let's see in the original HSM PR if this was considered not cherry pickable for a reason. I think it can be just as started and completed are.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is the original PR - https://github.com/temporalio/temporal/pull/7564/changes#diff-ff80ea8912f318338bb15fcea05d631581cf7a1d1778b61333d3acfa0a7e4da0

Looks like it was a mistake. I have fixed the CherryPick() methods of all the events. Only ScheduledEventDefinition & CancelRequestedEventDefinition are not cherrypickable now.

Could you please check if the signature of Apply & CherryPick look ok?

Comment on lines +212 to +213
// We never cherry pick command events, and instead allow user logic to reschedule those commands.
return workflowregistry.ErrNotCherryPickable
Copy link
Member

Choose a reason for hiding this comment

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

Same here, it's not a command.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 3 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

@gow gow force-pushed the cg/nexus/history_events_registry_1 branch 2 times, most recently from 6509cde to 9c5b648 Compare March 17, 2026 00:39
@gow gow force-pushed the cg/nexus/history_events_registry_2 branch from 8744e61 to f56cfa0 Compare March 17, 2026 05:00
@gow gow requested a review from bergundy March 17, 2026 06:04
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