-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: add optimus replay list #25
Changes from 3 commits
55b0dc6
5e972d9
2948d74
728e88f
5723ffe
dbb519a
f5401d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,19 +179,24 @@ service RuntimeService { | |
} | ||
rpc ReplayDryRun(ReplayRequest) returns (ReplayDryRunResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/project/{project_name}/job/{job_name}/replay-dry-run" | ||
post: "/v1/project/{project_name}/replay/{job_name}/dryrun" | ||
body: "*" | ||
}; | ||
} | ||
rpc Replay(ReplayRequest) returns (ReplayResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/project/{project_name}/job/{job_name}/replay" | ||
post: "/v1/project/{project_name}/replay/{job_name}" | ||
body: "*" | ||
}; | ||
} | ||
rpc GetReplayStatus(GetReplayStatusRequest) returns (GetReplayStatusResponse) { | ||
option (google.api.http) = { | ||
get: "/v1/project/{project_name}/job/{job_name}/replay/{id}" | ||
get: "/v1/project/{project_name}/replay/{job_name}/{id}" | ||
}; | ||
} | ||
rpc GetReplayList(GetReplayListRequest) returns (GetReplayListResponse) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if we call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are we considering replay as a resource? In that case, I guess it should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. replays seems more descriptive. but i'm seeing other endpoints are not in a plural word, for example when getting projects or resource specs. thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. understood why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems Optimus is using singular in all the endpoint, do you think it is acceptable to keep as it is @ravisuhag ? if not, we need to apply the changes to the others as well to keep it in uniform. cc @kushsharma There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Planning to resolve this and thinking to just follow the current Optimus convention to use singular, and if a change in convention is needed, will handle it in a different issue. Please let me know if you have any concern on this, @ravisuhag |
||
option (google.api.http) = { | ||
get: "/v1/project/{project_name}/replay" | ||
}; | ||
} | ||
// TODO(kush.sharma): disabled ATM | ||
|
@@ -660,4 +665,21 @@ message RegisterJobEventRequest { | |
JobEvent event = 4; | ||
} | ||
|
||
message RegisterJobEventResponse {} | ||
message RegisterJobEventResponse {} | ||
|
||
message GetReplayListRequest { | ||
string project_name = 1; | ||
} | ||
|
||
message GetReplayListResponse { | ||
repeated ReplaySpec replay_list = 1; | ||
} | ||
|
||
message ReplaySpec { | ||
string id = 1; | ||
string job_name = 2; | ||
string start_date = 3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i'm fine either way, but since start and end date is a date, i figured the response we are sending is already represented as expected, not in protobuf timestamp. any concern on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. discussed this and decided to use timestamp |
||
string end_date = 4; | ||
string state = 5; | ||
google.protobuf.Timestamp created_at = 6; | ||
} |
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.
sinc dryrun is custom method. it can go as
:dryrun
or maybe just:dry
?https://cloud.google.com/apis/design/custom_methods
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.
makes sense. let me change it to
:dryrun
and test itThere 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.
@ravisuhag using colon for identifying a custom verb is one way of doing it, other way is to split these custom verbs via slash. The advantage we have here when not using
:verb
is it avoid conflicts with the resource name. For exampleAlso I wonder how will the gateway regex be able to differentiate that when a URL looks like
job_name is
test-job:dryrun
ortest-job
? So these colon based verbs are nice when we have a fixed endpoint for example likeand have everything in the POST payload but then we won't be able to do GET calls nicely.
Its very rare we will be going to allow a job name that contains a
/
whereas a job name can contain:
now or in the future. These colon based verbs can be used if we split them after a slash though likeBut then this looks like more of a choice of convention. For example github follows without colon custom verbs. What do you think?
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.
Ok cool. fine with slash as well.