Skip to content

Add deployment version features #611

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

Merged

Conversation

antlai-temporal
Copy link
Contributor

What was changed

Adding Go features for the new versioning API based on Deployments.

  1. Closes
    [Feature Request] Add samples using our versioning API #227

Copy link
Member

Choose a reason for hiding this comment

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

IMO the generic helpers here should be in the harness and the workflows should be in the feature files themselves (yes even if it means the few lines are copied across them). For the most part we've tried to keep features self contained.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following build_id_versioning/common.go. Coping the workflows everywhere is not an issue (just a few lines), but I wonder if functions like setCurrent that are very deployment specific belong to the harness...

Copy link
Member

Choose a reason for hiding this comment

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

Coping the workflows everywhere is not an issue (just a few lines)

👍

I wonder if functions like setCurrent that are very deployment specific belong to the harness...

It seems like normal client use just like our users are expected to use. Is this how we expect our users to use the deployment client (i.e. wait until the server reports it at a certain value before making the next call)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, the server API is eventually consistent because we discover worker properties, as opposed to using a declarative approach... This is something I deeply dislike, but after many team discussions It eventually went that way..

In non-test scenarios it may not be that bad, you may only need to check for deployments/versions existence once, since deployments are explicitly deleted and versions are GC slowly. Or use an infinite loop (k8) to change desired state, ignoring early failures.

Back to the issue, is it ok to pollute handler code with all this stuff only applicable to deployment features?

Copy link
Member

@cretz cretz Mar 18, 2025

Choose a reason for hiding this comment

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

Back to the issue, is it ok to pollute handler code with all this stuff only applicable to deployment features?

I think it's probably ok (so long as well qualified), but if you want to leave here in common that's fine. But I do think the workflows should be in their feature files (and I'll mark approved after that).

I do think that you as the first client user of versioning are already seeing difficult user experience for programmatically using versioning APIs. I think that may need to be brought up in a devexp context.

Comment on lines 64 to 71
func SignalAll(r *harness.Runner, ctx context.Context, handles []client.WorkflowRun) error {
for _, handle := range handles {
if err := r.Client.SignalWorkflow(ctx, handle.GetID(), handle.GetRunID(), "start-signal", "prefix"); err != nil {
return err
}
}
return nil
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be inlined where used since it relies on certain expectations of the workflow shape. It's only used for a single handle anywhere anyways and signalling is not so much of a burden it needs a helper

@antlai-temporal antlai-temporal merged commit 8e3cf67 into temporalio:main Mar 19, 2025
20 checks passed
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.

2 participants