(ctx context.Context, id int64)
| 141 | } |
| 142 | |
| 143 | func (g *githubClient) DeleteEntityHook(ctx context.Context, id int64) (ret *github.Response, err error) { |
| 144 | metrics.GithubOperationCount.WithLabelValues( |
| 145 | "DeleteHook", // label: operation |
| 146 | g.entity.LabelScope(), // label: scope |
| 147 | ).Inc() |
| 148 | defer func() { |
| 149 | if err != nil { |
| 150 | metrics.GithubOperationFailedCount.WithLabelValues( |
| 151 | "DeleteHook", // label: operation |
| 152 | g.entity.LabelScope(), // label: scope |
| 153 | ).Inc() |
| 154 | } |
| 155 | }() |
| 156 | switch g.entity.EntityType { |
| 157 | case params.ForgeEntityTypeRepository: |
| 158 | ret, err = g.repo.DeleteHook(ctx, g.entity.Owner, g.entity.Name, id) |
| 159 | case params.ForgeEntityTypeOrganization: |
| 160 | ret, err = g.org.DeleteHook(ctx, g.entity.Owner, id) |
| 161 | default: |
| 162 | return nil, errors.New("invalid entity type") |
| 163 | } |
| 164 | if err == nil && ret != nil { |
| 165 | g.recordLimits(ret.Rate) |
| 166 | } |
| 167 | return ret, err |
| 168 | } |
| 169 | |
| 170 | func (g *githubClient) PingEntityHook(ctx context.Context, id int64) (ret *github.Response, err error) { |
| 171 | metrics.GithubOperationCount.WithLabelValues( |
nothing calls this directly
no test coverage detected