@@ -17,24 +17,24 @@ func newCIServiceClient() civ1connect.CIServiceClient {
1717}
1818
1919// CIGetRunStatus returns the current status of a CI run including its workflows, jobs, and attempts.
20- func CIGetRunStatus (ctx context.Context , token , runID string ) (* civ1.GetRunStatusResponse , error ) {
20+ func CIGetRunStatus (ctx context.Context , token , orgID , runID string ) (* civ1.GetRunStatusResponse , error ) {
2121 client := newCIServiceClient ()
22- resp , err := client .GetRunStatus (ctx , WithAuthentication (connect .NewRequest (& civ1.GetRunStatusRequest {RunId : runID }), token ))
22+ resp , err := client .GetRunStatus (ctx , WithAuthenticationAndOrg (connect .NewRequest (& civ1.GetRunStatusRequest {RunId : runID }), token , orgID ))
2323 if err != nil {
2424 return nil , err
2525 }
2626 return resp .Msg , nil
2727}
2828
2929// CIGetJobAttemptLogs returns all log lines for a job attempt, paginating through all pages.
30- func CIGetJobAttemptLogs (ctx context.Context , token , attemptID string ) ([]* civ1.LogLine , error ) {
30+ func CIGetJobAttemptLogs (ctx context.Context , token , orgID , attemptID string ) ([]* civ1.LogLine , error ) {
3131 client := newCIServiceClient ()
3232 var allLines []* civ1.LogLine
3333 var pageToken string
3434
3535 for {
3636 req := & civ1.GetJobAttemptLogsRequest {AttemptId : attemptID , PageToken : pageToken }
37- resp , err := client .GetJobAttemptLogs (ctx , WithAuthentication (connect .NewRequest (req ), token ))
37+ resp , err := client .GetJobAttemptLogs (ctx , WithAuthenticationAndOrg (connect .NewRequest (req ), token , orgID ))
3838 if err != nil {
3939 return nil , err
4040 }
@@ -49,9 +49,9 @@ func CIGetJobAttemptLogs(ctx context.Context, token, attemptID string) ([]*civ1.
4949}
5050
5151// CIRun triggers a CI run.
52- func CIRun (ctx context.Context , token string , req * civ1.RunRequest ) (* civ1.RunResponse , error ) {
52+ func CIRun (ctx context.Context , token , orgID string , req * civ1.RunRequest ) (* civ1.RunResponse , error ) {
5353 client := newCIServiceClient ()
54- resp , err := client .Run (ctx , WithAuthentication (connect .NewRequest (req ), token ))
54+ resp , err := client .Run (ctx , WithAuthenticationAndOrg (connect .NewRequest (req ), token , orgID ))
5555 if err != nil {
5656 return nil , err
5757 }
@@ -60,7 +60,7 @@ func CIRun(ctx context.Context, token string, req *civ1.RunRequest) (*civ1.RunRe
6060
6161// CIListRuns returns CI runs, paginating as needed to collect up to `limit` results.
6262// If limit is 0, all results are returned.
63- func CIListRuns (ctx context.Context , token string , statuses []civ1.CIRunStatus , limit int32 ) ([]* civ1.ListRunsResponseRun , error ) {
63+ func CIListRuns (ctx context.Context , token , orgID string , statuses []civ1.CIRunStatus , limit int32 ) ([]* civ1.ListRunsResponseRun , error ) {
6464 client := newCIServiceClient ()
6565 var allRuns []* civ1.ListRunsResponseRun
6666 var pageToken string
@@ -80,7 +80,7 @@ func CIListRuns(ctx context.Context, token string, statuses []civ1.CIRunStatus,
8080 PageSize : pageSize ,
8181 PageToken : pageToken ,
8282 }
83- resp , err := client .ListRuns (ctx , WithAuthentication (connect .NewRequest (req ), token ))
83+ resp , err := client .ListRuns (ctx , WithAuthenticationAndOrg (connect .NewRequest (req ), token , orgID ))
8484 if err != nil {
8585 return nil , err
8686 }
0 commit comments