config

package
v0.3.17 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateReleasesConfig added in v0.3.4

type AggregateReleasesConfig struct {
	TargetRepositoryName string                `mapstructure:"repository" description:"the name of the taget repo"`
	TargetRepositoryURL  string                `mapstructure:"repository-url" description:"the url of the target repo"`
	Branch               *string               `mapstructure:"branch" description:"the branch to push in the target repo"`
	BranchBase           *string               `mapstructure:"branch-base" description:"the base branch to raise the pull request against"`
	CommitMsgTemplate    *string               `mapstructure:"commit-tpl" description:"template of the commit message"`
	PullRequestTitle     *string               `mapstructure:"pull-request-title" description:"title of the pull request"`
	SourceRepos          map[string][]Modifier `mapstructure:"repos" description:"the source repositories to trigger this action"`
}

type Client

type Client struct {
	GitlabAuthConfig *GitlabClient `json:"gitlab" description:"auth config a gitlab client"`
	GithubAuthConfig *GithubClient `json:"github" description:"auth config a github client"`
	Name             string        `json:"name" description:"name of the client, used for referencing in webhook config"`
	OrganizationName string        `json:"organization" description:"name of the organization that this client will act on"`
}

type Configuration

type Configuration struct {
	Clients  []Client  `json:"clients" description:"client configurations"`
	Webhooks []Webhook `json:"webhooks" description:"webhook configurations"`
	Raw      []byte
}

func New

func New(configPath string) (*Configuration, error)

type DistributeReleasesConfig added in v0.3.4

type DistributeReleasesConfig struct {
	SourceRepositoryName string       `mapstructure:"repository" description:"the name of the source repo"`
	SourceRepositoryURL  string       `mapstructure:"repository-url" description:"the url of the source repo"`
	BranchTemplate       *string      `mapstructure:"branch-template" description:"the branch to push in the target repos"`
	CommitMsgTemplate    *string      `mapstructure:"commit-tpl" description:"template of the commit message in the target repos"`
	PullRequestTitle     *string      `mapstructure:"pull-request-title" description:"title of the pull request"`
	TargetRepos          []TargetRepo `mapstructure:"repos" description:"the repositories that will be updated"`
}

type DocsPreviewCommentConfig

type DocsPreviewCommentConfig struct {
	CommentTemplate *string `mapstructure:"comment-tpl" description:"template to be used for the docs PR comment"`
	RepositoryName  string  `mapstructure:"repository" description:"the name of the docs repo"`
}

type GithubClient

type GithubClient struct {
	AppID              int64  `json:"app-id" description:"application id of github app"`
	PrivateKeyCertPath string `json:"key-path" description:"private key pem path of github app"`
}

type GitlabClient

type GitlabClient struct {
	Token string `json:"token" description:"auth token for gitlab client"`
}

type IssuesCommentHandlerConfig added in v0.3.11

type IssuesCommentHandlerConfig struct {
	TargetRepos map[string]any `mapstructure:"repos" description:"the repositories for which issue comment handling will be applied"`
}

type LinePatchConfig

type LinePatchConfig struct {
	File            string  `mapstructure:"file" description:"the name of the file to be patched"`
	Line            int     `mapstructure:"line" description:"the line number in the file to be patched"`
	ReplaceTemplate *string `mapstructure:"template" description:"a special template to be used for patching the line"`
}

type Modifier

type Modifier struct {
	Type string         `json:"type" description:"name of the modifier"`
	Args map[string]any `json:"args" description:"modifier configuration"`
}

type ReleaseDraftConfig added in v0.3.4

type ReleaseDraftConfig struct {
	Repos                map[string]any `mapstructure:"repos" description:"the repositories for that a release draft will be pushed"`
	RepositoryName       string         `mapstructure:"repository" description:"the name of the release repo"`
	Branch               *string        `mapstructure:"branch" description:"the branch considered for releases"`
	BranchBase           *string        `mapstructure:"branch-base" description:"the base branch to raise the pull request against"`
	ReleaseTitleTemplate *string        `mapstructure:"title-template" description:"custom template for the release title"`
	DraftHeadline        *string        `mapstructure:"draft-headline" description:"custom headline for the release draft"`

	MergedPRsHeadline    *string `mapstructure:"merged-prs-section-headline" description:"custom headline for the section of merged pull requests"`
	MergedPRsDescription *string `mapstructure:"merged-prs-section-description" description:"description for the merged pull requests section"`
}

type RepositoryMaintainersConfig

type RepositoryMaintainersConfig struct {
	Suffix                *string `mapstructure:"suffix" description:"suffix for maintainers group"`
	AdditionalMemberships []struct {
		TeamSlug   string `mapstructure:"team" description:"the slug of the team"`
		Permission string `mapstructure:"permission" description:"the permission for the team, must be one of "`
	} `mapstructure:"additional-teams" description:"adds additional teams to this repository"`
}

type TargetRepo added in v0.3.4

type TargetRepo struct {
	RepositoryName string     `mapstructure:"repository" description:"the name of the target repo"`
	RepositoryURL  string     `mapstructure:"repository-url" description:"the name of the target repo"`
	Patches        []Modifier `mapstructure:"modifiers" description:"the name of the target repo"`
}

type VCSType

type VCSType string
const (
	Github VCSType = "github"
	Gitlab VCSType = "gitlab"
)

type Webhook

type Webhook struct {
	VCS       VCSType        `json:"vcs" description:"type of the vcs"`
	ServePath string         `json:"serve-path" description:"path of the webhook to serve on"`
	Secret    string         `json:"secret" description:"the webhook secret"`
	Actions   WebhookActions `json:"actions" description:"webhook actions"`
}

type WebhookAction

type WebhookAction struct {
	Type   string         `json:"type" description:"name of the webhook action"`
	Client string         `json:"client" description:"client that this webhook action uses"`
	Args   map[string]any `json:"args" description:"action configuration"`
}

type WebhookActions

type WebhookActions []WebhookAction

func (WebhookActions) String

func (w WebhookActions) String() string

type YAMLPathPatchConfig

type YAMLPathPatchConfig struct {
	File           string  `mapstructure:"file" description:"the name of the file to be patched"`
	YAMLPath       string  `mapstructure:"yaml-path" description:"the yaml path to the version"`
	Template       *string `mapstructure:"template" description:"a special template to be used for patching the version"`
	VersionCompare *bool   `` /* 143-byte string literal not displayed */
}

type YAMLTranslateReleasesConfig added in v0.3.4

type YAMLTranslateReleasesConfig struct {
	TargetRepositoryName string                       `mapstructure:"repository" description:"the name of the taget repo"`
	TargetRepositoryURL  string                       `mapstructure:"repository-url" description:"the url of the target repo"`
	Branch               *string                      `mapstructure:"branch" description:"the branch to push in the target repo"`
	BranchBase           *string                      `mapstructure:"branch-base" description:"the base branch to raise the pull request against"`
	CommitMsgTemplate    *string                      `mapstructure:"commit-tpl" description:"template of the commit message"`
	PullRequestTitle     *string                      `mapstructure:"pull-request-title" description:"title of the pull request"`
	SourceRepos          map[string][]YAMLTranslation `mapstructure:"repos" description:"the source repositories to trigger this action"`
}

type YAMLTranslation added in v0.3.4

type YAMLTranslation struct {
	From YAMLTranslationRead `mapstructure:"from" description:"the yaml path from where to read the replacement value"`
	To   []Modifier          `mapstructure:"to" description:"the actions to take on the traget repo with the read the replacement value"`
}

type YAMLTranslationRead added in v0.3.4

type YAMLTranslationRead struct {
	File     string `mapstructure:"file" description:"the name of the file to be patched"`
	YAMLPath string `mapstructure:"yaml-path" description:"the yaml path to the version"`
}

Jump to

Keyboard shortcuts

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