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

fix: add Get latest job runs API #129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions gotocompany/optimus/core/v1beta1/job_run.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ service JobRunService {
get: "/v1beta1/project/{project_name}/job/{job_name}/run"
};
}
// JobRunList returns the current and past run status of jobs on a given range
rpc GetLatestJobRuns(GetLatestJobRunsRequest) returns (GetLatestJobRunsResponse) {

Choose a reason for hiding this comment

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

I'm thinking of keeping the number of rpc methods to less by merging the scope of this rpc method with the existing rpc method to get jobruns, should we look into where all we are using the existing method & try to unify them instead.

option (google.api.http) = {
get: "/v1beta1/project/{project_name}/job/{job_name}/latest-runs"
};
}
// RegisterJobEvent notifies optimus service about an event related to job
rpc RegisterJobEvent(RegisterJobEventRequest) returns (RegisterJobEventResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -111,6 +117,18 @@ message JobRunInputRequest {
string jobrun_id = 7;
}

// get latest 10 runs by schedule time
message GetLatestJobRunsRequest {
string project_name = 1;
string job_name = 2;
// state is an optional filter
string state = 3;
}

message GetLatestJobRunsResponse {
repeated JobRun job_runs = 1;
}

message JobRunRequest {
string project_name = 1;
string job_name = 2;
Expand Down
Loading