Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nexus: Fix link not being attached to a workflow started via a Handler function #1659

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

bergundy
Copy link
Member

@bergundy bergundy commented Oct 4, 2024

Not testing this since server 1.25.0 didn't get support for links.

@bergundy bergundy requested a review from a team as a code owner October 4, 2024 21:20
@@ -262,11 +252,14 @@ type WorkflowHandle[T any] interface {
ID() string
// ID is the workflow's run ID.
RunID() string
// Link to the WorkflowExecutionStarted event of the workflow represented by this handle.
Link() nexus.Link
Copy link
Contributor

Choose a reason for hiding this comment

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

hm why does this need to be on the interface? Are users expected to use this method?

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't but I don't think it hurts.

Another approach would be to put this on the struct implementation and have an unexported method on the interface to ensure users don't try to implement it. This is important since the handler's return value is the interface.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll change to that alternative.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@Quinn-With-Two-Ns
Copy link
Contributor

I understand if we can't write an end to end test for this, but what is stopping us from unit testing this change?

@bergundy
Copy link
Member Author

bergundy commented Oct 7, 2024

I understand if we can't write an end to end test for this, but what is stopping us from unit testing this change?

We'll add integration tests soon. server v1.25.1 already supports links so it's just a matter of upgrading the server version in the CLI.

@bergundy bergundy merged commit b300e50 into temporalio:master Oct 8, 2024
13 checks passed
@bergundy bergundy deleted the nexus-link-from-handler branch October 8, 2024 13:51
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