hooks

package
v0.0.0-...-e2948ef Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitFiles

type CommitFiles struct {
	Modified []string `json:"modified,omitempty"`
	Added    []string `json:"added,omitempty"`
	Removed  []string `json:"removed,omitempty"`
}

CommitFiles contains the file changes for a single commit

type Duplicates

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

Duplicates is a map of active/duplicate commit IDs.

func NewDuplicateMap

func NewDuplicateMap() *Duplicates

NewDuplicateMap creates a new DuplicateMap.

func (*Duplicates) Duplicate

func (dm *Duplicates) Duplicate(commitID string) bool

Duplicate returns true if the commitID is a duplicate.

func (*Duplicates) Remove

func (dm *Duplicates) Remove(commitID string)

Remove removes the commitID from the duplicate map to avoid ever growing map. Should be called after the push event has been processed.

type GitHubWebHook

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

GitHubWebHook holds references and data for handling webhook events.

func NewGitHubWebHook

func NewGitHubWebHook(logger *zap.SugaredLogger, db database.Database, mgr *scm.Manager, runner ci.Runner, secret string, streams *stream.StreamServices, tm *auth.TokenManager) *GitHubWebHook

NewGitHubWebHook creates a new webhook to handle POST requests from GitHub to the QuickFeed server.

func (GitHubWebHook) Handle

func (wh GitHubWebHook) Handle() http.HandlerFunc

Handle take POST requests from GitHub, representing Push events associated with course repositories, which then triggers various actions on the QuickFeed backend.

type PullRequestEventSummary

type PullRequestEventSummary struct {
	Type      string `json:"type"`
	Action    string `json:"action"`
	RepoID    int64  `json:"repo_id"`
	RepoName  string `json:"repo_name"`
	Number    int    `json:"pr_number"`
	Title     string `json:"pr_title,omitempty"`
	Body      string `json:"pr_body,omitempty"`
	Merged    bool   `json:"merged,omitempty"`
	SourceRef string `json:"source_ref,omitempty"`
	Sender    string `json:"sender"`
}

PullRequestEventSummary contains the essential fields from a GitHub pull request event for logging

type PullRequestReviewEventSummary

type PullRequestReviewEventSummary struct {
	Type        string `json:"type"`
	Action      string `json:"action"`
	RepoID      int64  `json:"repo_id"`
	RepoName    string `json:"repo_name"`
	OrgID       int64  `json:"org_id"`
	Number      int    `json:"pr_number"`
	Title       string `json:"pr_title"`
	ReviewState string `json:"review_state"`
	Sender      string `json:"sender"`
}

PullRequestReviewEventSummary contains the essential fields from a GitHub pull request review event for logging

type PushEventSummary

type PushEventSummary struct {
	Type          string        `json:"type"`
	Ref           string        `json:"ref"`
	RepoID        int64         `json:"repo_id"`
	RepoName      string        `json:"repo_name"`
	DefaultBranch string        `json:"default_branch"`
	CommitID      string        `json:"commit_id"`
	Sender        string        `json:"sender"`
	CommitCount   int           `json:"commit_count"`
	Commits       []CommitFiles `json:"commits,omitempty"`
}

PushEventSummary contains the essential fields from a GitHub push event for logging

Jump to

Keyboard shortcuts

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