gitlab_hooks

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const GitlabHookIgnoreReasonUnhandledEventType = "unhandled-event-type"
View Source
const GitlabHooksSubject = "gitlab"
View Source
const GitlabTokenHeader = "X-Gitlab-Token"
View Source
const MergeRequestEventsSubject = "mrevents"
View Source
const NoteEventsSubject = "noteevents"

Variables

This section is empty.

Functions

This section is empty.

Types

type GitlabEventWorker

type GitlabEventWorker struct {
	// contains filtered or unexported fields
}

type GitlabHookEvent

type GitlabHookEvent struct {
}

GitlabHookEvent represents all types of Gitlab Hooks events to be processed.

func (*GitlabHookEvent) GetPlatform

func (e *GitlabHookEvent) GetPlatform() string

type GitlabHooksHandler

type GitlabHooksHandler struct {
	// contains filtered or unexported fields
}

func (*GitlabHooksHandler) GroupHandler

func (h *GitlabHooksHandler) GroupHandler() func(c echo.Context) error

func (*GitlabHooksHandler) ProjectHandler

func (h *GitlabHooksHandler) ProjectHandler() func(c echo.Context) error

type MergeRequestEventMsg

type MergeRequestEventMsg struct {
	GitlabHookEvent

	Payload *gogitlab.MergeEvent `json:"payload"`
	// DeliveryID identifies the upstream webhook delivery, so a redelivery is
	// recognised as the same trigger.
	DeliveryID string                 `json:"deliveryID"`
	Carrier    propagation.MapCarrier `json:"Carrier"`
	Context    context.Context
}

func (*MergeRequestEventMsg) DecodeEventData

func (e *MergeRequestEventMsg) DecodeEventData(b []byte) error

func (*MergeRequestEventMsg) EncodeEventData

func (e *MergeRequestEventMsg) EncodeEventData(ctx context.Context) []byte

func (*MergeRequestEventMsg) GetId

GetId is the event's Nats-Msg-Id, which the HOOKS stream uses to drop a duplicate publish within its Duplicates window. It includes the MR's updated_at, which changes with every state change: without it, reopening an MR at the same commit again inside the window was dropped as a duplicate of the earlier reopen, and the MR was not planned. Retries of one delivery carry the same payload and so the same ID, and so does the same event delivered through both a group and a project webhook.

func (*MergeRequestEventMsg) GetPayload

func (e *MergeRequestEventMsg) GetPayload() interface{}

func (*MergeRequestEventMsg) GetType

func (e *MergeRequestEventMsg) GetType(ctx context.Context) string

type NoteEventMsg

type NoteEventMsg struct {
	GitlabHookEvent

	Payload *gitlab.GitlabMergeCommentEvent `json:"payload"`
	// DeliveryID identifies the upstream webhook delivery (X-Gitlab-Event-UUID
	// or Idempotency-Key), so a redelivery is recognised as the same trigger.
	DeliveryID string                 `json:"deliveryID"`
	Carrier    propagation.MapCarrier `json:"Carrier"`
	Context    context.Context
}

func (*NoteEventMsg) DecodeEventData

func (e *NoteEventMsg) DecodeEventData(b []byte) error

func (*NoteEventMsg) EncodeEventData

func (e *NoteEventMsg) EncodeEventData(ctx context.Context) []byte

func (*NoteEventMsg) GetAttributes

func (e *NoteEventMsg) GetAttributes() vcs.MRAttributes

func (*NoteEventMsg) GetDeliveryID added in v0.5.0

func (e *NoteEventMsg) GetDeliveryID() string

func (*NoteEventMsg) GetEventSequence added in v0.7.0

func (e *NoteEventMsg) GetEventSequence() int64

func (*NoteEventMsg) GetId

func (e *NoteEventMsg) GetId(ctx context.Context) string

GetId is the event's Nats-Msg-Id, which the HOOKS stream uses to drop a duplicate publish within its Duplicates window. It includes the note ID: with the discussion ID alone, a second comment in the same thread inside the window was dropped as a duplicate of the first.

func (*NoteEventMsg) GetLastCommit

func (e *NoteEventMsg) GetLastCommit() vcs.Commit

func (*NoteEventMsg) GetMR

func (e *NoteEventMsg) GetMR() vcs.MR

func (*NoteEventMsg) GetProject

func (e *NoteEventMsg) GetProject() vcs.Project

type TriggerCreationFunc

type TriggerCreationFunc func(appCfg config.Config,
	gl vcs.GitClient,
	tfc tfc_api.ApiClient,
	runstream runstream.StreamClient,
	triggerCfg *tfc_trigger.TFCTriggerOptions) tfc_trigger.Trigger

Jump to

Keyboard shortcuts

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