Skip to content

Refactor nexus completion handler#9958

Closed
stephanos wants to merge 1 commit intomainfrom
stephanos/nexus-completion-refactor
Closed

Refactor nexus completion handler#9958
stephanos wants to merge 1 commit intomainfrom
stephanos/nexus-completion-refactor

Conversation

@stephanos
Copy link
Copy Markdown
Contributor

What changed?

Describe what has changed in this PR.

Why?

Tell your future self why have you made these changes.

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)

Potential risks

Any change is risky. Identify all risks you are aware of. If none, remove this section.

@stephanos stephanos force-pushed the stephanos/nexus-completion-refactor branch 3 times, most recently from 655de14 to bde2779 Compare April 15, 2026 04:43
}
}

func RegisterHTTPHandler(options HandlerOptions, logger log.Logger, router *mux.Router) {
Copy link
Copy Markdown
Contributor Author

@stephanos stephanos Apr 15, 2026

Choose a reason for hiding this comment

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

Moved to service/frontend

@stephanos stephanos force-pushed the stephanos/nexus-completion-refactor branch 5 times, most recently from 0bd7e80 to 8f2e203 Compare April 15, 2026 05:04

// Small wrapper that does some pre-processing before handing requests over to the Nexus SDK's HTTP handler.
type NexusHTTPHandler struct {
type NexusOperationHTTPHandler struct {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed this to distinguish from completion handler.

@stephanos stephanos force-pushed the stephanos/nexus-completion-refactor branch 7 times, most recently from da54b6d to f5d3879 Compare April 15, 2026 05:49
}

type completionHandler struct {
type CompletionHandler struct {
Copy link
Copy Markdown
Contributor Author

@stephanos stephanos Apr 15, 2026

Choose a reason for hiding this comment

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

Needs to be exported for fx injection; there are alternatives but this is the most direct option.

@stephanos stephanos force-pushed the stephanos/nexus-completion-refactor branch from f5d3879 to 5daa78d Compare April 15, 2026 05:53
clientVersionChecker: headers.NewDefaultVersionChecker(),
preProcessErrorsCounter: options.MetricsHandler.Counter(metrics.NexusCompletionRequestPreProcessErrors.Name()),
}
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

^ this was in RegisterHTTPHandler before

@stephanos stephanos force-pushed the stephanos/nexus-completion-refactor branch from 5daa78d to 381218c Compare April 15, 2026 06:09
// The original HTTP request.
HTTPRequest *http.Request
// Decoded Temporal callback token, if present and valid.
CompletionToken *tokenspb.NexusOperationCompletion
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved this up the chain to not have to decode it twice.

@stephanos stephanos force-pushed the stephanos/nexus-completion-refactor branch from 381218c to ca4c950 Compare April 15, 2026 15:32
@@ -0,0 +1,21 @@
package nexusoperation
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note sure about the file name; on the SANO feature branch there is frontend.go. But that's for client-facing APIs.

@stephanos stephanos force-pushed the stephanos/nexus-completion-refactor branch 4 times, most recently from 4863bd2 to 1fea9eb Compare April 15, 2026 16:40
@stephanos stephanos force-pushed the stephanos/nexus-completion-refactor branch from 1fea9eb to 0021298 Compare April 15, 2026 16:56
@stephanos stephanos closed this Apr 15, 2026
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