-
Notifications
You must be signed in to change notification settings - Fork 69
fix: activity pause,unpause,reset accept activity type OR activity id #824
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
Conversation
|
|
temporalcli/commands.gen.go
Outdated
| } | ||
| } | ||
|
|
||
| func (v *ActivityReferenceOptions) validateFlags() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't add code to this code-generated file, it'd get removed on regen. Rather, add in another file (or maybe better, do not add methods to generated structures beyond the run method needed on command, but make simple utility functions that accept them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the ActivityReferenceOptions struct entirely, opting for the repetitive checking. The flags for this activity-id and activity-type are already set with other option-sets which causes a panic and unraveling that doesn't seem like the correct solution here.
cc @ychebotarev
| Identity: c.Identity, | ||
| } | ||
|
|
||
| if c.ActivityId != "" && c.ActivityType != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
back to square 1 :) ?
somewhere
func ValidateActivityReference(activityId, activityType) error {
...
}
and then here and below
if err = ValidateActivityReference(c.ActivityId, c.ActivityType); err != nil {
return err
}
up to you
…#824) <!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please **make sure there is an open issue** for this. We work best with you when we have accepted the idea first before you code. --> <!--- For ALL Contributors 👇 --> `temporal activity {pause,unpause,reset}` commands take either an `--activity-id` or `activity-type` argument but not both. If both are provided the command will fail We want to fail when both are provided, the user doesn't need to provide activity type and id as type can be inferred from type. <!--- add/delete as needed ---> 1. Closes no issue 2. How was this tested: * new unit test showing failure 3. Any docs updates needed? documentation updates will be needed, @drewhoskins-temporal or @ychebotarev can share where and I will update
What was changed
temporal activity {pause,unpause,reset}commands take either an--activity-idoractivity-typeargument but not both. If both are provided the command will failWhy?
We want to fail when both are provided, the user doesn't need to provide activity type and id as type can be inferred from type.
Checklist
Closes no issue
How was this tested:
documentation updates will be needed, @drewhoskins-temporal or @ychebotarev can share where and I will update