Documentation ¶
Index ¶
- Constants
- Variables
- func AddNewBranchToTheExistedRepositoryTasksOnTheSameHosts(tasks []*Task, component *git.ScmComponent) bool
- func AddNewRepoToTasksOnTheSameHostsWithSameCredentials(tasks []*Task, component *git.ScmComponent, ...) bool
- func GetRenovatePatternConfiguration() string
- type BasicAuthTaskProvider
- type GithubAppRenovaterTaskProvider
- type JobConfig
- type JobCoordinator
- type PackageRule
- type Repository
- type Task
- type TaskProvider
- type Tekton
Constants ¶
const ( RenovateMatchPatternEnvName = "RENOVATE_PATTERN" DefaultRenovateMatchPattern = "^quay.io/redhat-appstudio-tekton-catalog/" )
const ( TasksPerJob = 20 InstallationsPerJobEnvName = "RENOVATE_INSTALLATIONS_PER_JOB" TimeToLiveOfJob = 24 * time.Hour RenovateImageEnvName = "RENOVATE_IMAGE" DefaultRenovateImageUrl = "quay.io/redhat-appstudio/renovate:v37.74.1" )
Variables ¶
var (
DisableAllPackageRules = PackageRule{MatchPackagePatterns: []string{"[*]"}, Enabled: false}
)
Functions ¶
func AddNewBranchToTheExistedRepositoryTasksOnTheSameHosts ¶
func AddNewBranchToTheExistedRepositoryTasksOnTheSameHosts(tasks []*Task, component *git.ScmComponent) bool
AddNewBranchToTheExistedRepositoryTasksOnTheSameHosts iterates over the tasks and adds a new branch to the repository if it already exists NOTE: performing this operation on a slice containing tasks from different platforms or hosts is unsafe.
func AddNewRepoToTasksOnTheSameHostsWithSameCredentials ¶
func AddNewRepoToTasksOnTheSameHostsWithSameCredentials(tasks []*Task, component *git.ScmComponent, cred *credentials.BasicAuthCredentials) bool
AddNewRepoToTasksOnTheSameHostsWithSameCredentials iterates over the tasks and adds a new repository to the task with same credentials NOTE: performing this operation on a slice containing tasks from different platforms or hosts is unsafe.
func GetRenovatePatternConfiguration ¶
func GetRenovatePatternConfiguration() string
Types ¶
type BasicAuthTaskProvider ¶
type BasicAuthTaskProvider struct {
// contains filtered or unexported fields
}
BasicAuthTaskProvider is an implementation of the renovate.TaskProvider that creates the renovate.Task for the components based on the generic algorithm and not tied to any specific SCM provider implementation.
func NewBasicAuthTaskProvider ¶
func NewBasicAuthTaskProvider(credentialsProvider credentials.BasicAuthCredentialsProvider) BasicAuthTaskProvider
func (BasicAuthTaskProvider) GetNewTasks ¶
func (g BasicAuthTaskProvider) GetNewTasks(ctx context.Context, components []*git.ScmComponent) []*Task
GetNewTasks returns the list of new renovate tasks for the components. It uses such an algorithm: 1. Group components by namespace 2. Group components by platform 3. Group components by host 4. For each host creating tasksOnHost 5. For each component looking for an existing task with the same repository and adding a new branch to it 6. If there is no task with the same repository, looking for a task with the same credentials and adding a new repository to it 7. If there is no task with the same credentials, creating a new task and adding it to the tasksOnHost 8. Adding tasksOnHost to the newTasks
type GithubAppRenovaterTaskProvider ¶
type GithubAppRenovaterTaskProvider struct {
// contains filtered or unexported fields
}
GithubAppRenovaterTaskProvider is an implementation of TaskProvider that provides Renovate tasks for GitHub App installations.
func NewGithubAppRenovaterTaskProvider ¶
func NewGithubAppRenovaterTaskProvider(appConfigReader githubapp.ConfigReader) GithubAppRenovaterTaskProvider
func (GithubAppRenovaterTaskProvider) GetNewTasks ¶
func (g GithubAppRenovaterTaskProvider) GetNewTasks(ctx context.Context, components []*git.ScmComponent) []*Task
type JobConfig ¶
type JobConfig struct { Platform string `json:"platform"` Username string `json:"username"` GitAuthor string `json:"gitAuthor"` Onboarding bool `json:"onboarding"` RequireConfig string `json:"requireConfig"` EnabledManagers []string `json:"enabledManagers"` Repositories []*Repository `json:"repositories"` Tekton Tekton `json:"tekton"` ForkProcessing string `json:"forkProcessing"` DependencyDashboard bool `json:"dependencyDashboard"` Endpoint string `json:"endpoint,omitempty"` }
func NewTektonJobConfig ¶
func NewTektonJobConfig(platform, endpoint, username, gitAuthor string, repositories []*Repository) JobConfig
type JobCoordinator ¶
type JobCoordinator struct {
// contains filtered or unexported fields
}
JobCoordinator is responsible for creating and managing renovate k8s jobs
func NewJobCoordinator ¶
func NewJobCoordinator(client client.Client, scheme *runtime.Scheme) *JobCoordinator
func (*JobCoordinator) Execute ¶
func (j *JobCoordinator) Execute(ctx context.Context, tasks []*Task) error
func (*JobCoordinator) ExecuteWithLimits ¶
func (j *JobCoordinator) ExecuteWithLimits(ctx context.Context, tasks []*Task) error
type PackageRule ¶
type PackageRule struct { MatchPackagePatterns []string `json:"matchPackagePatterns"` Enabled bool `json:"enabled"` MatchDepPatterns []string `json:"matchDepPatterns,omitempty"` GroupName string `json:"groupName,omitempty"` BranchName string `json:"branchName,omitempty"` CommitBody string `json:"commitBody,omitempty"` CommitMessageExtra string `json:"commitMessageExtra,omitempty"` CommitMessageTopic string `json:"commitMessageTopic,omitempty"` SemanticCommits string `json:"semanticCommits,omitempty"` PRBodyColumns []string `json:"prBodyColumns,omitempty"` PRBodyDefinitions string `json:"prBodyDefinitions,omitempty"` PRBodyTemplate string `json:"prBodyTemplate,omitempty"` RecreateWhen string `json:"recreateWhen,omitempty"` RebaseWhen string `json:"rebaseWhen,omitempty"` }
type Repository ¶
type Repository struct { Repository string `json:"repository"` BaseBranches []string `json:"baseBranches"` }
func (*Repository) AddBranch ¶
func (r *Repository) AddBranch(branch string)
type Task ¶
type Task struct { Platform string Username string GitAuthor string Token string Endpoint string Repositories []*Repository }
Task represents a task to be executed by Renovate with credentials and repositories
func NewBasicAuthTask ¶
func NewBasicAuthTask(platform, host, endpoint string, credentials *credentials.BasicAuthCredentials, repositories []*Repository) *Task
type TaskProvider ¶
type TaskProvider interface {
GetNewTasks(ctx context.Context, components []*git.ScmComponent) []*Task
}
TaskProvider is an interface for providing tasks to be executed by Renovate
type Tekton ¶
type Tekton struct { FileMatch []string `json:"fileMatch"` IncludePaths []string `json:"includePaths"` PackageRules []PackageRule `json:"packageRules"` }