Documentation
¶
Overview ¶
Package gitlab provides GitLab API client for MR integration
Index ¶
- func FindTerraCIComment(notes []*gitlab.Note) *gitlab.Note
- type Client
- func (c *Client) AddMRLabels(projectID string, mrIID int64, labels []string) error
- func (c *Client) BaseURL() string
- func (c *Client) CreateMRNote(projectID string, mrIID int64, body string) (*gitlab.Note, error)
- func (c *Client) GetMRNotes(projectID string, mrIID int64) ([]*gitlab.Note, error)
- func (c *Client) HasToken() bool
- func (c *Client) UpdateMRNote(projectID string, mrIID, noteID int64, body string) (*gitlab.Note, error)
- type MRContext
- type MRService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the official GitLab client
func NewClientFromEnv ¶
func NewClientFromEnv() *Client
NewClientFromEnv creates a client from GitLab CI environment variables
func (*Client) AddMRLabels ¶
AddMRLabels adds labels to an MR
func (*Client) CreateMRNote ¶
CreateMRNote creates a new note on an MR
func (*Client) GetMRNotes ¶
GetMRNotes retrieves all notes for an MR
type MRContext ¶
type MRContext struct {
ProjectID string
ProjectPath string
MRIID int64
SourceBranch string
TargetBranch string
PipelineID string
JobID string
CommitSHA string
InMR bool
}
MRContext contains information about the current MR context
func DetectMRContext ¶
func DetectMRContext() *MRContext
DetectMRContext detects if we're running in a GitLab MR pipeline
type MRService ¶
type MRService struct {
// contains filtered or unexported fields
}
MRService handles MR-related operations
func NewMRService ¶
NewMRService creates a new MR service with injected dependencies.
func NewMRServiceFromEnv ¶ added in v0.6.5
NewMRServiceFromEnv creates a new MR service with dependencies from environment.
func (*MRService) UpsertComment ¶
func (s *MRService) UpsertComment(plans []ci.ModulePlan, policySummary *ci.PolicySummary) error
UpsertComment creates or updates the terraci comment on the MR