MCPcopy Index your code
hub / github.com/git-bug/git-bug / BugStatusOpen

Method BugStatusOpen

api/graphql/resolvers/mutation.go:257–283  ·  view source on GitHub ↗
(ctx context.Context, input models.BugStatusOpenInput)

Source from the content-addressed store, hash-verified

255}
256
257func (r mutationResolver) BugStatusOpen(ctx context.Context, input models.BugStatusOpenInput) (*models.BugStatusOpenPayload, error) {
258 repo, b, err := r.getBug(input.RepoRef, input.Prefix)
259 if err != nil {
260 return nil, err
261 }
262
263 author, err := auth.UserFromCtx(ctx, repo)
264 if err != nil {
265 return nil, err
266 }
267
268 op, err := b.OpenRaw(author, time.Now().Unix(), nil)
269 if err != nil {
270 return nil, err
271 }
272
273 err = b.Commit()
274 if err != nil {
275 return nil, err
276 }
277
278 return &models.BugStatusOpenPayload{
279 ClientMutationID: input.ClientMutationID,
280 Bug: models.NewLoadedBug(b.Snapshot()),
281 Operation: op,
282 }, nil
283}
284
285func (r mutationResolver) BugStatusClose(ctx context.Context, input models.BugStatusCloseInput) (*models.BugStatusClosePayload, error) {
286 repo, b, err := r.getBug(input.RepoRef, input.Prefix)

Callers

nothing calls this directly

Calls 6

getBugMethod · 0.95
UserFromCtxFunction · 0.92
NewLoadedBugFunction · 0.92
OpenRawMethod · 0.80
SnapshotMethod · 0.80
CommitMethod · 0.65

Tested by

no test coverage detected