Help us shape the future of Go! Take the 2026 Go Developer Survey

epicworkitems

package
v3.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package epicworkitems is the home for the shared GraphQL helpers used by the epic-family sub-packages (epics, epicnotes, epicdiscussions, epicissues). The exported functions in work_items.go (ResolveEpicGID, ResolveWorkItemGID) translate a (group_path, iid) pair into the work item's global ID for use in subsequent GraphQL mutations, and CheckNoteOnEpic holds a note write to a note of the epic the caller named, since GitLab addresses a note by its global ID alone. RequireEpic, ResolveEpicForNote, RequireNoteOnEpic and EpicNotAnswered are the checks and the refusals the epicnotes and epicdiscussions handlers share, so each is written once.

See ADR-0004 (catalog-first registration) for the broader context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNoteOnEpic added in v3.3.0

func CheckNoteOnEpic(ctx context.Context, client *gitlabclient.Client, op, fullPath string, iid, noteID int64) (string, error)

CheckNoteOnEpic reads the note noteID and returns the address GitLab serves it at when it is a note of the epic fullPath and iid name, and an error naming where the note is otherwise.

The epic note writes take the note's global ID alone, which GitLab resolves whatever it belongs to, so before this an edit or an irreversible delete named through an epic reached a note on a project issue, a merge request or another epic, and the epic named was never consulted (issue 1301). op prefixes every error the way the caller's own do.

func EpicNotAnswered added in v3.3.0

func EpicNotAnswered(op string, errs []toolutil.GraphQLError, fullPath string, iid int64) error

EpicNotAnswered words, under op, an answer to a document reading the epic's work item that carries no work item: what GitLab refused when it refused the document, and otherwise that the group holds no epic of that iid.

GitLab answers a rejected document with HTTP 200 and a top-level errors array, which client-go does not turn into an error, so a query the instance refused reaches a handler looking exactly like an epic that is not there. The epic note and discussion reads both need that answer, which is why it lives here rather than at each call site.

func RequireEpic added in v3.3.0

func RequireEpic(ctx context.Context, op, fullPath string, iid int64) error

RequireEpic refuses under op what an epic note or discussion action is handed when it names no epic: a context that has already ended, no group path, or no epic iid. It sends nothing. Every such action but the two lists starts with it; a list's refusal of a missing path also says where to find one.

func RequireNoteOnEpic added in v3.3.0

func RequireNoteOnEpic(ctx context.Context, client *gitlabclient.Client, op, fullPath string, iid, noteID int64) (string, error)

RequireNoteOnEpic is CheckNoteOnEpic for a write handed the epic and the note alone, a delete: it refuses what RequireEpic refuses and a note_id that names no note before it reads anything.

func ResolveEpicForNote added in v3.3.0

func ResolveEpicForNote(ctx context.Context, client *gitlabclient.Client, op, fullPath string, iid int64, body, hint string) (string, error)

ResolveEpicForNote resolves the work item global ID a note opening a thread on the epic is sent to, once RequireEpic passes and body is not empty, and reports a resolution that failed under op with hint.

func ResolveEpicGID

func ResolveEpicGID(ctx context.Context, client *gitlabclient.Client, fullPath string, iid int64) (string, error)

ResolveEpicGID resolves an epic-backed work item GID by group path and IID.

func ResolveWorkItemGID

func ResolveWorkItemGID(ctx context.Context, client *gitlabclient.Client, fullPath string, iid int64) (string, error)

ResolveWorkItemGID resolves a generic work item GID by namespace path and IID.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL