MCPcopy Create free account
hub / github.com/cli/cli / getLog

Function getLog

pkg/cmd/run/view/view.go:473–491  ·  view source on GitHub ↗
(httpClient *http.Client, logURL safeurl.SafeURL)

Source from the content-addressed store, hash-verified

471}
472
473func getLog(httpClient *http.Client, logURL safeurl.SafeURL) (io.ReadCloser, error) {
474 req, err := http.NewRequest("GET", logURL.String(), nil)
475 if err != nil {
476 return nil, err
477 }
478
479 resp, err := httpClient.Do(req)
480 if err != nil {
481 return nil, err
482 }
483
484 if resp.StatusCode == 404 {
485 return nil, errors.New("log not found")
486 } else if resp.StatusCode != 200 {
487 return nil, api.HandleHTTPError(resp)
488 }
489
490 return resp.Body, nil
491}
492
493func getRunLog(cache RunLogCache, httpClient *http.Client, repo ghrepo.Interface, run *shared.Run, attempt uint64) (*zip.ReadCloser, error) {
494 cacheKey := fmt.Sprintf("%d-%d", run.ID, run.StartedTime().Unix())

Callers 1

getRunLogFunction · 0.85

Calls 3

HandleHTTPErrorFunction · 0.92
StringMethod · 0.65
DoMethod · 0.65

Tested by

no test coverage detected