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

EDU-3794: add information on how to use the TemporalChangeVersion SA #3285

Open
antmendoza opened this issue Jan 10, 2025 · 3 comments
Open
Labels
cross-team This issue or PR was submitted from within Temporal tracking-internally A JIRA ticket has been generated and the EDU number is attached to the title of this issue or PR

Comments

@antmendoza
Copy link
Member

antmendoza commented Jan 10, 2025

Issue link: https://github.com/temporalio/documentation/issues/3285

Brief description

https://docs.temporal.io/visibility#default-search-attributes mentions that there is an SA called TemporalChangeVersion, but it does not mention how to use it.

Your recommended content

I would like to see a short description of how to use it, like we have with BuildIds

width=200,height=183

The SA value is stored with the following format: changeID + "-" + version

given this code

v := workflow.GetVersion(ctx, "addActivity", workflow.DefaultVersion, 1)

if v == 1 {

    var result string
    err := workflow.ExecuteActivity(ctx, Activity, name).Get(ctx, &result)
    if err != nil {
       logger.Error("Activity failed.", "Error", err)
       return "", err
    }

}

The query that returns the workflow execution with this version will be

TemporalChangeVersion="addActivity-1"

Thank you

@antmendoza
Copy link
Member Author

Regarding " .. if the GetVersion API is enabled". I believe it is enabled by default and can be used (except for Java https://docs.temporal.io/develop/java/versioning#adding-support-for-versioned-workflow-visibility-in-the-event-history). I could be wrong

@fairlydurable
Copy link
Contributor

Thanks for submitting this and providing the sample code. Can you recommend a subject matter expert about the GetVersion API?

I will note as well that we have a ton of tickets and work to revamp visibility coverage. This is a great addition, and I'll add it to the epic.

@fairlydurable fairlydurable changed the title [ Documentation request ] add information on how to use the TemporalChangeVersion SA EDU-3794: add information on how to use the TemporalChangeVersion SA Jan 10, 2025
@fairlydurable fairlydurable added cross-team This issue or PR was submitted from within Temporal tracking-internally A JIRA ticket has been generated and the EDU number is attached to the title of this issue or PR labels Jan 10, 2025
@axfelix
Copy link
Contributor

axfelix commented Jan 10, 2025

To the absolute best of my knowledge, all of our patching APIs (including GetVersion in Go and Java) have been enabled out of the box for some time -- I did a bunch of work on Versioning documentation for the course a year ago and there is no need to enable anything here. But it is true that you need to manually upsert a search attribute in Java to be able to query versions, since the Java SDK doesn't do that for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-team This issue or PR was submitted from within Temporal tracking-internally A JIRA ticket has been generated and the EDU number is attached to the title of this issue or PR
Projects
None yet
Development

No branches or pull requests

3 participants