workflow

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPlugins added in v0.18.16

func GetPlugins() map[string]StepPlugin

GetPlugins returns a map of all the plugins

Types

type CreateIssueResponse

type CreateIssueResponse struct {
	ID   string `json:"id"`
	Key  string `json:"key"`
	Self string `json:"self"`
}

type DynamoDBClientInterface added in v0.18.13

type DynamoDBClientInterface interface {
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
}

DynamoDBClientInterface defines the interface for DynamoDB operations

type DynamoDBRecord added in v0.18.13

type DynamoDBRecord struct {
	PullRequest  string `dynamodbav:"pull_request"`
	Timestamp    int64  `dynamodbav:"timestamp"`
	GithubCaller string `dynamodbav:"github_caller"`
	Organization string `dynamodbav:"organization"`
	Repository   string `dynamodbav:"repository"`
	PRNumber     string `dynamodbav:"pr_number"`
	Explanation  string `dynamodbav:"explanation"`
}

type ForcemergeImpl

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

func (*ForcemergeImpl) ExecuteWorkflow added in v0.17.2

func (g *ForcemergeImpl) ExecuteWorkflow(ctx context.Context, repoconfigForceMergeworkflows []string, username, workflowName, explanation string, properties map[string]string, dryrun bool) ([]string, error)

type IssueType

type IssueType struct {
	Name string `json:"name"`
}

type JiraADFDescription

type JiraADFDescription struct {
	Type    string          `json:"type"`
	Version int             `json:"version"`
	Content []JiraParagraph `json:"content"`
}

type JiraFields

type JiraFields struct {
	Project     JiraProject        `json:"project"`
	Summary     string             `json:"summary"`
	Description JiraADFDescription `json:"description"`
	Issuetype   IssueType          `json:"issuetype"`
}

type JiraIssue

type JiraIssue struct {
	Fields JiraFields `json:"fields"`
}

type JiraParagraph

type JiraParagraph struct {
	Type    string     `json:"type"`
	Content []JiraText `json:"content"`
}

type JiraProject

type JiraProject struct {
	Key string `json:"key"`
}

type JiraText

type JiraText struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type NoopImpl added in v0.17.2

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

func (*NoopImpl) ExecuteWorkflow added in v0.17.2

func (g *NoopImpl) ExecuteWorkflow(ctx context.Context, repoconfigForceMergeworkflows []string, username, workflowName, explanation string, properties map[string]string, dryrun bool) ([]string, error)

type RepositoryGoliacApprovers added in v0.18.9

type RepositoryGoliacApprovers struct {
	Teams []string
	Users []string
}

type SlackMessage

type SlackMessage struct {
	Channel string `json:"channel"`
	Text    string `json:"text"`
}

type StepPlugin added in v0.17.2

type StepPlugin interface {
	Execute(ctx context.Context, username, workflowDescription, explanation string, url *url.URL, properties map[string]interface{}) (string, error)
}

func NewStepPluginDynamoDB added in v0.18.13

func NewStepPluginDynamoDB() StepPlugin

NewStepPluginDynamoDB creates a new DynamoDB plugin with default AWS client

func NewStepPluginDynamoDBWithClient added in v0.18.13

func NewStepPluginDynamoDBWithClient(client DynamoDBClientInterface) StepPlugin

NewStepPluginDynamoDBWithClient creates a new DynamoDB plugin with a custom client This is used for testing

func NewStepPluginJira added in v0.17.2

func NewStepPluginJira() StepPlugin

func NewStepPluginSlack added in v0.17.2

func NewStepPluginSlack() StepPlugin

type StepPluginDynamoDB added in v0.18.13

type StepPluginDynamoDB struct {
	TableName string
	// contains filtered or unexported fields
}

func (*StepPluginDynamoDB) Execute added in v0.18.13

func (f *StepPluginDynamoDB) Execute(ctx context.Context, username, workflowDescription, explanation string, url *url.URL, properties map[string]interface{}) (string, error)

type StepPluginJira added in v0.17.2

type StepPluginJira struct {
	AtlassianUrlDomain string // something like "https://mycompany.atlassian.net"
	ProjectKey         string
	Email              string
	ApiToken           string //generate a Jira API token here: https://id.atlassian.com/manage/api-tokens
	IssueType          string
}

func (*StepPluginJira) Execute added in v0.17.2

func (f *StepPluginJira) Execute(ctx context.Context, username, workflowDescription, explanation string, url *url.URL, properties map[string]interface{}) (string, error)

type StepPluginSlack added in v0.17.2

type StepPluginSlack struct {
	SlackUrl   string
	SlackToken string
	Channel    string
}

func (*StepPluginSlack) Execute added in v0.17.2

func (f *StepPluginSlack) Execute(ctx context.Context, username, workflowDescription, explanation string, url *url.URL, properties map[string]interface{}) (string, error)

type Workflow added in v0.17.2

type Workflow interface {
	ExecuteWorkflow(ctx context.Context, repoconfigForceMergeworkflows []string, username, workflowName, explanation string, properties map[string]string, dryrun bool) ([]string, error)
}

func NewForcemergeImpl

func NewForcemergeImpl(ws WorkflowService) Workflow

func NewNoopImpl added in v0.17.2

func NewNoopImpl(ws WorkflowService) Workflow

type WorkflowGithubClient added in v0.18.9

type WorkflowGithubClient interface {
	CallRestAPI(ctx context.Context, endpoint, parameters, method string, body map[string]interface{}, githubToken *string) ([]byte, error)
}

strip down version of GithubClient

type WorkflowLocalResource added in v0.17.2

type WorkflowLocalResource interface {
	Workflows() map[string]*entity.Workflow
	Teams() map[string]*entity.Team
	Users() map[string]*entity.User // github username, user definition
}

strip down version of Goliac Local

type WorkflowRemoteResource added in v0.17.2

type WorkflowRemoteResource interface {
	// return the teams from github (with the slugified name as)
	Teams(ctx context.Context, current bool) map[string]*engine.GithubTeam
}

strip down version of Goliac Remote (if we have an externally managed team)

type WorkflowService added in v0.18.9

type WorkflowService interface {
	GetWorkflow(ctx context.Context, repoconfigForceMergeworkflows []string, workflowName, repo, githubId string) (*entity.Workflow, error)
	CallRestAPI(ctx context.Context, endpoint, parameters, method string, body map[string]interface{}, githubToken *string) ([]byte, error)
}

WorkflowService is here to select the right workflow and check the ACL

func NewWorkflowService added in v0.18.9

func NewWorkflowService(organization string, local WorkflowLocalResource, remote WorkflowRemoteResource, ghclient WorkflowGithubClient) WorkflowService

type WorkflowServiceImpl added in v0.18.9

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

func (*WorkflowServiceImpl) CallRestAPI added in v0.18.9

func (ws *WorkflowServiceImpl) CallRestAPI(ctx context.Context, endpoint, parameters, method string, body map[string]interface{}, githubToken *string) ([]byte, error)

func (*WorkflowServiceImpl) GetWorkflow added in v0.18.9

func (ws *WorkflowServiceImpl) GetWorkflow(ctx context.Context, repoconfigForceMergeworkflows []string, workflowName, repo, githubId string) (*entity.Workflow, error)

Jump to

Keyboard shortcuts

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