MCPcopy
hub / github.com/harness/harness / HandleCodeOwner

Function HandleCodeOwner

app/api/handler/pullreq/codeowner.go:25–50  ·  view source on GitHub ↗
(pullreqCtrl *pullreq.Controller)

Source from the content-addressed store, hash-verified

23)
24
25func HandleCodeOwner(pullreqCtrl *pullreq.Controller) http.HandlerFunc {
26 return func(w http.ResponseWriter, r *http.Request) {
27 ctx := r.Context()
28 session, _ := request.AuthSessionFrom(ctx)
29
30 repoRef, err := request.GetRepoRefFromPath(r)
31 if err != nil {
32 render.TranslatedUserError(ctx, w, err)
33 return
34 }
35
36 pullreqNumber, err := request.GetPullReqNumberFromPath(r)
37 if err != nil {
38 render.TranslatedUserError(ctx, w, err)
39 return
40 }
41
42 owners, err := pullreqCtrl.CodeOwners(ctx, session, repoRef, pullreqNumber)
43 if err != nil {
44 render.TranslatedUserError(ctx, w, err)
45 return
46 }
47
48 render.JSON(w, http.StatusOK, owners)
49 }
50}

Callers

nothing calls this directly

Calls 6

AuthSessionFromFunction · 0.92
GetRepoRefFromPathFunction · 0.92
TranslatedUserErrorFunction · 0.92
GetPullReqNumberFromPathFunction · 0.92
JSONFunction · 0.92
CodeOwnersMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…