webhook

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package webhook handles GitLab webhook events for the reviewer roulette system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler handles GitLab webhook events

func NewHandler

func NewHandler(
	cfg *config.Config,
	gitlabClient *gitlab.Client,
	mattermostClient *mattermost.Client,
	rouletteService *roulette.Service,
	metricsService *metrics.Service,
	userRepo *repository.UserRepository,
	reviewRepo *repository.ReviewRepository,
	translator *i18n.Translator,
	log *logger.Logger,
) *Handler

NewHandler creates a new webhook handler

func (*Handler) HandleGitLabWebhook

func (h *Handler) HandleGitLabWebhook(c *gin.Context)

HandleGitLabWebhook processes GitLab webhook events

type MergeRequestEvent

type MergeRequestEvent struct {
	ObjectKind string `json:"object_kind"`
	Project    struct {
		ID int `json:"id"`
	} `json:"project"`
	ObjectAttributes struct {
		IID    int    `json:"iid"`
		Title  string `json:"title"`
		URL    string `json:"url"`
		State  string `json:"state"`
		Action string `json:"action"`
	} `json:"object_attributes"`
}

MergeRequestEvent represents a GitLab merge request event

type NoteEvent

type NoteEvent struct {
	ObjectKind string `json:"object_kind"`
	User       struct {
		ID       int    `json:"id"`
		Username string `json:"username"`
	} `json:"user"`
	ProjectID int `json:"project_id"`
	Project   struct {
		ID int `json:"id"`
	} `json:"project"`
	ObjectAttributes struct {
		ID           int    `json:"id"`
		Note         string `json:"note"`
		NoteableType string `json:"noteable_type"`
		NoteableID   int    `json:"noteable_id"`
	} `json:"object_attributes"`
	MergeRequest struct {
		IID   int    `json:"iid"`
		Title string `json:"title"`
		URL   string `json:"url"`
	} `json:"merge_request"`
}

NoteEvent represents a GitLab note (comment) event

Jump to

Keyboard shortcuts

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