Documentation
¶
Index ¶
- Constants
- type GitlabEventWorker
- type GitlabHookEvent
- type GitlabHooksHandler
- type MergeRequestEventMsg
- func (e *MergeRequestEventMsg) DecodeEventData(b []byte) error
- func (e *MergeRequestEventMsg) EncodeEventData(ctx context.Context) []byte
- func (e *MergeRequestEventMsg) GetId(ctx context.Context) string
- func (e *MergeRequestEventMsg) GetPayload() interface{}
- func (e *MergeRequestEventMsg) GetType(ctx context.Context) string
- type NoteEventMsg
- func (e *NoteEventMsg) DecodeEventData(b []byte) error
- func (e *NoteEventMsg) EncodeEventData(ctx context.Context) []byte
- func (e *NoteEventMsg) GetAttributes() vcs.MRAttributes
- func (e *NoteEventMsg) GetDeliveryID() string
- func (e *NoteEventMsg) GetEventSequence() int64
- func (e *NoteEventMsg) GetId(ctx context.Context) string
- func (e *NoteEventMsg) GetLastCommit() vcs.Commit
- func (e *NoteEventMsg) GetMR() vcs.MR
- func (e *NoteEventMsg) GetProject() vcs.Project
- type TriggerCreationFunc
Constants ¶
const GitlabHookIgnoreReasonUnhandledEventType = "unhandled-event-type"
const GitlabHooksSubject = "gitlab"
const GitlabTokenHeader = "X-Gitlab-Token"
const MergeRequestEventsSubject = "mrevents"
const NoteEventsSubject = "noteevents"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GitlabEventWorker ¶
type GitlabEventWorker struct {
// contains filtered or unexported fields
}
func NewGitlabEventWorker ¶
func NewGitlabEventWorker(h *GitlabHooksHandler, js jetstream.JetStream) *GitlabEventWorker
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 NewGitlabHooksHandler ¶
func NewGitlabHooksHandler(cfg config.Config, gl vcs.GitClient, tfc tfc_api.ApiClient, rs runstream.StreamClient, js nats.JetStreamContext, jsc jetstream.JetStream) *GitlabHooksHandler
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 ¶
func (e *MergeRequestEventMsg) 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 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{}
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