(ctx context.Context, id int64)
| 168 | } |
| 169 | |
| 170 | func (g *githubClient) PingEntityHook(ctx context.Context, id int64) (ret *github.Response, err error) { |
| 171 | metrics.GithubOperationCount.WithLabelValues( |
| 172 | "PingHook", // label: operation |
| 173 | g.entity.LabelScope(), // label: scope |
| 174 | ).Inc() |
| 175 | defer func() { |
| 176 | if err != nil { |
| 177 | metrics.GithubOperationFailedCount.WithLabelValues( |
| 178 | "PingHook", // label: operation |
| 179 | g.entity.LabelScope(), // label: scope |
| 180 | ).Inc() |
| 181 | } |
| 182 | }() |
| 183 | switch g.entity.EntityType { |
| 184 | case params.ForgeEntityTypeRepository: |
| 185 | ret, err = g.repo.PingHook(ctx, g.entity.Owner, g.entity.Name, id) |
| 186 | case params.ForgeEntityTypeOrganization: |
| 187 | ret, err = g.org.PingHook(ctx, g.entity.Owner, id) |
| 188 | default: |
| 189 | return nil, errors.New("invalid entity type") |
| 190 | } |
| 191 | |
| 192 | if err == nil && ret != nil { |
| 193 | g.recordLimits(ret.Rate) |
| 194 | } |
| 195 | return ret, err |
| 196 | } |
| 197 | |
| 198 | func (g *githubClient) ListEntityRunners(ctx context.Context, opts *github.ListRunnersOptions) (*github.Runners, *github.Response, error) { |
| 199 | var ret *github.Runners |
nothing calls this directly
no test coverage detected