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 DescribeActivityById definition #462

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add DescribeActivityById definition #462

wants to merge 6 commits into from

Conversation

ychebotarev
Copy link
Contributor

@ychebotarev ychebotarev commented Oct 10, 2024

Add definition for DescribeActivityById APi.

Why?
Part of Activity API work.

Breaking changes

Server PR

@ychebotarev ychebotarev requested review from a team as code owners October 10, 2024 00:39
temporal/api/enums/v1/activity_state.proto Outdated Show resolved Hide resolved
// Activity was requested to be canceled.
ACTIVITY_STATE_CANCEL_REQUESTED = 3;
// Activity failed and is backing off before retrying.
ACTIVITY_STATE_CANCEL_BACKING_OFF = 4;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ACTIVITY_STATE_CANCEL_BACKING_OFF = 4;
ACTIVITY_STATE_BACKING_OFF = 4;

Copy link
Member

Choose a reason for hiding this comment

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

Please don't resolve comments. I keep seeing my suggestions disappear on PRs and not always being addressed or commented on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tolked offline. I'l be resolving only after I push new version

temporal/api/enums/v1/activity_state.proto Outdated Show resolved Hide resolved
temporal/api/activity/v1/message.proto Outdated Show resolved Hide resolved
temporal/api/activity/v1/message.proto Outdated Show resolved Hide resolved
temporal/api/activity/v1/message.proto Outdated Show resolved Hide resolved
temporal/api/enums/v1/activity_state.proto Outdated Show resolved Hide resolved
@@ -871,5 +871,15 @@ service WorkflowService {
};
}

// DescribeActivityById is called by the client to get activity and for pending and completed activities.
Copy link
Member

Choose a reason for hiding this comment

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

Docstring can be improved here.

Please also mention that an activity ID isn’t unique for an entire workflow run only for pending activities and that the API will return the latest matching activity for the given ID. May also want to consider letting a user use the scheduled event ID in some cases because that is unique for the entire run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add more info. I will not add 'event id' as a routing parameter. It if comes to that users can as well read the history.

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 modify the docstring. At this point I don't want to use scheduled event ID as a routing parameter. For this they can get history

Copy link
Member

Choose a reason for hiding this comment

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

Works for me, just call out the behavior in the docstring please and make sure you test it when you get to the implementation.

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM overall, just a bit of concern on the new activity state enum

temporal/api/enums/v1/activity_state.proto Outdated Show resolved Hide resolved
// More detailed state of an activity.
enum ActivityState {
ACTIVITY_STATE_UNSPECIFIED = 0;
// Activity was scheduled but not yet started.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Activity was scheduled but not yet started.
// Activity was scheduled but the first attempt has not started.

The only reason I clarify here is because it could be a bit confusing that pre-first-attempt is scheduled but pre-second-attempt is backing off

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have a separate flag for "backing off". state transition is "backing off"=>"scheduled"-"started"->"completed" or "backing off"

Copy link
Member

Choose a reason for hiding this comment

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

I am surprised it starts as backing off, but otherwise makes sense.

temporal/api/enums/v1/activity_state.proto Outdated Show resolved Hide resolved
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

Only a single-character change suggested, otherwise LGTM. I do think we will want to do most of the implementation before merging.

// Activity has timed out.
ACTIVITY_STATE_TIMED_OUT = 7;
// Activity has been cancelled.
ACTIVITY_STATE_CANCELLED = 8;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ACTIVITY_STATE_CANCELLED = 8;
ACTIVITY_STATE_CANCELED = 8;

We use the one-L form in the history message name.

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.

3 participants