fix: activity pause,unpause,reset accept activity type OR activity id#824
fix: activity pause,unpause,reset accept activity type OR activity id#824
Conversation
|
|
temporalcli/commands.gen.go
Outdated
| } | ||
| } | ||
|
|
||
| func (v *ActivityReferenceOptions) validateFlags() error { |
There was a problem hiding this comment.
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.
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.
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