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

Add CLI call for UpdateActivityOptions API #727

Closed
wants to merge 5 commits into from
Closed

Conversation

ychebotarev
Copy link

What was changed

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@CLAassistant
Copy link

CLAassistant commented Dec 9, 2024

CLA assistant check
All committers have signed the CLA.

google.golang.org/protobuf v1.34.2
go.temporal.io/api v1.43.0
go.temporal.io/sdk v1.30.1
go.temporal.io/server v1.26.2-125.1
Copy link
Member

Choose a reason for hiding this comment

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

We cannot update main to a non-stable tag. But there is the next-server branch you can change this PR to target

temporalcli/commandsgen/commands.yml Outdated Show resolved Hide resolved
@@ -106,6 +106,32 @@ func (s *SharedServerSuite) TestActivity_Fail_InvalidDetail() {
s.Nil(failed)
}

func (s *SharedServerSuite) TestActivityOptionsUpdate_Accept() {
Copy link
Member

Choose a reason for hiding this comment

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

Can we add one more test confirming a partial update doesn't mutate the existing value?

Copy link
Author

Choose a reason for hiding this comment

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

what are we testing with that? If server implementation - it is already tested.

Copy link
Member

@cretz cretz Dec 11, 2024

Choose a reason for hiding this comment

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

Just an extra confirmation. Many (most?) of our CLI tests are end to end tests with the server implementation. We don't have to test everything, but I would like to confirm that only setting some CLI flags leaves unset values intact. Often we find we think we are building the proto message correctly but we don't test the behavior of it so we aren't sure.

Copy link
Author

@ychebotarev ychebotarev Dec 13, 2024

Choose a reason for hiding this comment

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

ok. I add TestActivityOptionsUpdate_Partial

"--retry-backoff-coefficient", "2",
"--retry-maximum-attempts", "5",
)
// atm, the command is not enabled
Copy link
Member

Choose a reason for hiding this comment

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

Should have PR wait to be merged until test can confirm behavior

Copy link
Author

Choose a reason for hiding this comment

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

ok looks like we can change dynamic config values, so the output can be tested

Copy link
Collaborator

@josh-berry josh-berry left a comment

Choose a reason for hiding this comment

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

I just did a quick pass right before the end of my workday; other SDK folks may have additional comments.

google.golang.org/protobuf v1.34.2
go.temporal.io/api v1.43.0
go.temporal.io/sdk v1.30.1
go.temporal.io/server v1.26.2-125.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can't merge this in main without a released open-source server version. Please target your PR to next-server instead.

Comment on lines 131 to 132
// atm, the command is not enabled
s.Error(res.Err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We'll need to be able to actually verify the behavior here before merge.

Comment on lines 209 to 210
Update an Activity's options or update an Activity's state to completed or failed.
Updating activity state marks an Activity as successfully finished or as having encountered an error.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please wrap to 80 columns per the "Wrapping" section of the style guide at the top of this file. Same goes for the options and command descriptions.

Comment on lines 299 to 310
temporal activity update \
--activity-id YourActivityId \
--workflow-id YourWorkflowId \
--task-queue NewTaskQueueName \
--schedule-to-close-timeout DURATION\
--schedule-to-start-timeout DURATION\
--start-to-close-timeout DURATION\
--heartbeat-timeout DURATION\
--retry-initial-interval DURATION\
--retry-maximum-interval DURATION\
--retry-backoff-coefficient NewBackoffCoefficient\
--retry-maximum-attempts NewMaximumAttempts"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Inconsistent use of whitespace in your \s, and you have a stray "

Comment on lines 324 to 325
Indicates how long the caller is willing to wait for an activity completion.
Limits how long retries will be attempted.
Copy link
Collaborator

Choose a reason for hiding this comment

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

For your option descriptions, please follow the grammar recommendations in the style guide at the top of the file. You can look at other options (e.g. the workflow-start timeout options) if you need examples.

temporalcli/commandsgen/commands.yml Outdated Show resolved Hide resolved
@ychebotarev
Copy link
Author

create new PR for next-server

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.

4 participants