Documentation
¶
Overview ¶
Package gitlab implements port.Forge for GitLab over stdlib net/http. REST is the default transport because GitLab's GraphQL API rejects CI job tokens outright; see ADR-0043.
Index ¶
- Variables
- type Forge
- func (f *Forge) ChangeURL(number int) string
- func (f *Forge) CommitURL(sha string) string
- func (f *Forge) CompareURL(from, to string) string
- func (f *Forge) Enrich(ctx context.Context, commits []port.Commit, ref string) (port.Enrichment, error)
- func (f *Forge) Identity() port.ForgeIdentity
- func (f *Forge) Type() string
Constants ¶
This section is empty.
Variables ¶
var ErrJobTokenGraphQL = errors.New("gitlab graphql: CI job tokens cannot authenticate GraphQL")
ErrJobTokenGraphQL reports the one combination GitLab forbids: a CI job token on GraphQL.
Functions ¶
This section is empty.
Types ¶
type Forge ¶
type Forge struct {
// contains filtered or unexported fields
}
Forge is the GitLab implementation of port.Forge.
func New ¶
func New(id port.ForgeIdentity, client *http.Client) *Forge
New constructs a GitLab forge. A nil client gets a default with a 30s timeout, matching the Azure enrichment client (ADR-0035).
func (*Forge) CompareURL ¶
func (*Forge) Enrich ¶
func (f *Forge) Enrich(ctx context.Context, commits []port.Commit, ref string) (port.Enrichment, error)
Enrich resolves per-commit MR references and author handles. api_mode: graphql opts into the batched GraphQL transport (linked @usernames, requires a non-job token); the default is REST, which resolves per-commit and ignores ref. GraphQL anchors its commits(ref:) walk on ref (T153).
func (*Forge) Identity ¶
func (f *Forge) Identity() port.ForgeIdentity