Documentation
¶
Index ¶
- func HasProjectConfig() (string, error)
- func SearchConfigFileFromDirEntries(baseName string, entries []fs.DirEntry) (string, bool)
- func SearchConfigFileFromPath(searchPath string) (string, error)
- type ConfigLoader
- type DependencyConfig
- type DevcontainerFeatureDependency
- type GonovateConfig
- func (config *GonovateConfig) ApplyToDependency(dependency *common.Dependency) error
- func (config *GonovateConfig) GetDatasource(datasourceType common.DatasourceType, logger *slog.Logger, ...) (common.IDatasource, error)
- func (config *GonovateConfig) GetManager(managerId string, managerType common.ManagerType, logger *slog.Logger) (common.IManager, error)
- func (config *GonovateConfig) GetManagerConfigById(managerId string) *Manager
- func (config *GonovateConfig) GetMergedManagerConfig(managerId string, managerType common.ManagerType) *ManagerConfig
- func (cfg *GonovateConfig) MatchStringPresetsToPresets() map[string]*presets.MatchStringPreset
- func (configA *GonovateConfig) MergeWith(configB *GonovateConfig)
- func (configA *GonovateConfig) MergeWithAsCopy(configB *GonovateConfig) *GonovateConfig
- func (c *GonovateConfig) PostLoadProcess()
- func (cfg *GonovateConfig) ToCommonPlatformSettings(logger *slog.Logger) *common.PlatformSettings
- type Manager
- type ManagerConfig
- type MatchStringPreset
- type PlatformConfig
- type Rule
- type RuleMatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasProjectConfig ¶
Checks if a project has its own configuration.
func SearchConfigFileFromPath ¶
Searches for a config file with the given base name
Types ¶
type ConfigLoader ¶ added in v0.10.5
type ConfigLoader struct {
// contains filtered or unexported fields
}
func NewConfigLoader ¶ added in v0.10.5
func NewConfigLoader(logger *slog.Logger) *ConfigLoader
func (*ConfigLoader) Load ¶ added in v0.10.5
func (cl *ConfigLoader) Load(configPath string) (*GonovateConfig, error)
Loads the given configuration
type DependencyConfig ¶
type DependencyConfig struct {
// A flag that allows disabling individual dependencies.
Skip *bool `json:"skip" yaml:"skip"`
// An optional text to describe, why a dependency was disabled.
SkipReason string `json:"skipReason" yaml:"skipReason"`
// Deprecated, use UpdateTypes.
MaxUpdateType common.UpdateType `json:"maxUpdateType" yaml:"maxUpdateType"`
// A list of update types that are allowed. Can be "major", "minor", or "patch".
UpdateTypes []common.UpdateType `json:"updateTypes" yaml:"updateTypes"`
// This flag defines if unstable releases are allowed. Unstable usually means a version that also has parts with text.
AllowUnstable *bool `json:"allowUnstable" yaml:"allowUnstable"`
// A list of registry urls to use. Allows overwriting the default. Depends on the datasource.
RegistryUrls []string `json:"registryUrls" yaml:"registryUrls"`
// Defines the regexp to use to parse the version into separate parts. See gover for more details.
Versioning string `json:"versioning" yaml:"versioning"`
// An optional regexp that is used to separate the version part from the rest from the raw string from external sources.
ExtractVersion string `json:"extractVersion" yaml:"extractVersion"`
// A flag to indicate if versions from a remote that do not match the versioning should be ignored or give an exception.
IgnoreNonMatching *bool `json:"ignoreNonMatching" yaml:"ignoreNonMatching"`
// Allows hard-coding a dependencyName in rules. Is used if it is not captured via matchString.
DependencyName string `json:"dependencyName" yaml:"dependencyName"`
// Allows hard-coding a datasource in rules. Is used if it is not captured via matchString.
Datasource common.DatasourceType `json:"datasource" yaml:"datasource"`
// Allows defining regexes that replace further information from dependencies (like hash) after updating
PostUpgradeReplacements []string `json:"postUpgradeReplacements" yaml:"postUpgradeReplacements"`
// An optional name of a group to group dependency updates together.
GroupName string `json:"groupName" yaml:"groupName"`
// A list of labels to add to the created PR for this dependency.
Labels []string `json:"labels" yaml:"labels"`
// A list of reviewers to add to the created PR for this dependency. Will never delete reviewers on update, only add.
Reviewers []string `json:"reviewers" yaml:"reviewers"`
// A template for the title when committing and creating an MR/PR.
TitleTemplate string `json:"titleTemplate" yaml:"titleTemplate"`
// A template for the branch name when creating an MR/PR.
BranchNameTemplate string `json:"branchNameTemplate" yaml:"branchNameTemplate"`
}
func (*DependencyConfig) MergeWith ¶
func (DependencyConfigA *DependencyConfig) MergeWith(DependencyConfigB *DependencyConfig)
type DevcontainerFeatureDependency ¶
type DevcontainerFeatureDependency struct {
Property string `json:"property" yaml:"property"`
Datasource common.DatasourceType `json:"datasource" yaml:"datasource"`
DependencyName string `json:"dependencyName" yaml:"dependencyName"`
}
func (*DevcontainerFeatureDependency) MergeWith ¶
func (objA *DevcontainerFeatureDependency) MergeWith(objB *DevcontainerFeatureDependency)
type GonovateConfig ¶
type GonovateConfig struct {
// Settings that are relevant for the platform.
Platform *PlatformConfig `json:"platform" yaml:"platform"`
// A map of presets for matchstrings that can be used and referenced.
MatchStringPresets map[string]*MatchStringPreset `json:"matchStringPresets" yaml:"matchStringPresets"`
// A map of presets for versionings that can be used and referenced.
VersioningPresets map[string]string `json:"versioningPresets" yaml:"versioningPresets"`
// A list of presets to also load before loading this config. All configs are merged together.
Extends []string `json:"extends" yaml:"extends"`
// A list of patterns that will be completely ignored.
IgnorePatterns []string `json:"ignorePatterns" yaml:"ignorePatterns"`
// A list of configurations for managers
Managers []*Manager `json:"managers" yaml:"managers"`
// A list of rules that can apply to managers or dependencies.
Rules []*Rule `json:"rules" yaml:"rules"`
// A list of rules that can apply to hosts.
HostRules []*common.HostRule `json:"hostRules" yaml:"hostRules"`
}
This type represents the gonovate config object.
func (*GonovateConfig) ApplyToDependency ¶
func (config *GonovateConfig) ApplyToDependency(dependency *common.Dependency) error
Applies rules and presets to the dependency
func (*GonovateConfig) GetDatasource ¶ added in v0.6.2
func (config *GonovateConfig) GetDatasource(datasourceType common.DatasourceType, logger *slog.Logger, cache cache.Cache[[]*common.ReleaseInfo]) (common.IDatasource, error)
Creates a datasource out of the config of the given datasource type.
func (*GonovateConfig) GetManager ¶ added in v0.6.1
func (config *GonovateConfig) GetManager(managerId string, managerType common.ManagerType, logger *slog.Logger) (common.IManager, error)
Creates a manager out of the config with the given id and manager type.
func (*GonovateConfig) GetManagerConfigById ¶ added in v0.6.1
func (config *GonovateConfig) GetManagerConfigById(managerId string) *Manager
func (*GonovateConfig) GetMergedManagerConfig ¶
func (config *GonovateConfig) GetMergedManagerConfig(managerId string, managerType common.ManagerType) *ManagerConfig
func (*GonovateConfig) MatchStringPresetsToPresets ¶
func (cfg *GonovateConfig) MatchStringPresetsToPresets() map[string]*presets.MatchStringPreset
func (*GonovateConfig) MergeWith ¶
func (configA *GonovateConfig) MergeWith(configB *GonovateConfig)
func (*GonovateConfig) MergeWithAsCopy ¶
func (configA *GonovateConfig) MergeWithAsCopy(configB *GonovateConfig) *GonovateConfig
func (*GonovateConfig) PostLoadProcess ¶
func (c *GonovateConfig) PostLoadProcess()
This method processes the gonovate config object. This should be called on any config object just after loading.
func (*GonovateConfig) ToCommonPlatformSettings ¶
func (cfg *GonovateConfig) ToCommonPlatformSettings(logger *slog.Logger) *common.PlatformSettings
type Manager ¶
type Manager struct {
Id string `json:"id" yaml:"id"`
Type common.ManagerType `json:"type" yaml:"type"`
// These settings are immediately converted to rules to keep the right order, so they should not be used directly
ManagerConfig *ManagerConfig `json:"managerConfig" yaml:"managerConfig"`
DependencyConfig *DependencyConfig `json:"dependencyConfig" yaml:"dependencyConfig"`
}
This type represents an instance of manager with its configs and configs that apply for all dependencies within this manager.
type ManagerConfig ¶
type ManagerConfig struct {
// General settings
Disabled *bool `json:"disabled" yaml:"disabled"`
FilePatterns []string `json:"filePatterns" yaml:"filePatterns"`
ClearFilePatterns *bool `json:"clearFilePatterns" yaml:"clearFilePatterns"`
// Specific settings for RegexManager
MatchStrings []string `json:"matchStrings" yaml:"matchStrings"`
// Specific settings for DevcontainerManager
DevcontainerConfig map[string][]*DevcontainerFeatureDependency `json:"devcontainerConfig" yaml:"devcontainerConfig"`
}
func (*ManagerConfig) MergeWith ¶
func (ManagerConfigA *ManagerConfig) MergeWith(ManagerConfigB *ManagerConfig)
func (*ManagerConfig) ToCommonDevcontainerManagerSettings ¶
func (managerConfig *ManagerConfig) ToCommonDevcontainerManagerSettings() *common.DevcontainerManagerSettings
type MatchStringPreset ¶
type PlatformConfig ¶
type PlatformConfig struct {
// The type of the platform to use.
Type common.PlatformType `json:"type" yaml:"type"`
Token string `json:"token" yaml:"token"`
// The author to use when committing changes. Defaults to null which will use the platform credentials to get the author.
GitAuthor string `json:"gitAuthor" yaml:"gitAuthor"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
Inplace *bool `json:"inplace" yaml:"inplace"`
Projects []string `json:"projects" yaml:"projects"`
// The name of the base branch, defaults to "main".
BaseBranch string `json:"baseBranch" yaml:"baseBranch"`
// The prefix for branches created by gonovate. Defaults to "gonovate/".
BranchPrefix string `json:"branchPrefix" yaml:"branchPrefix"`
// The prefix for commit messages created by gonovate. Defaults to null.
CommitMessagePrefix string `json:"commitMessagePrefix" yaml:"commitMessagePrefix"`
}
This type defines configurations regarding the platform.
func (*PlatformConfig) MergeWith ¶
func (platformConfigA *PlatformConfig) MergeWith(platformConfigB *PlatformConfig)
type Rule ¶
type Rule struct {
Matches *RuleMatch `json:"matches" yaml:"matches"`
ManagerConfig *ManagerConfig `json:"managerConfig" yaml:"managerConfig"`
DependencyConfig *DependencyConfig `json:"dependencyConfig" yaml:"dependencyConfig"`
}
type RuleMatch ¶
type RuleMatch struct {
Managers []string `json:"managers" yaml:"managers"`
ManagerTypes []common.ManagerType `json:"managerTypes" yaml:"managerTypes"`
Files []string `json:"files" yaml:"files"`
DependencyNames []string `json:"dependencyNames" yaml:"dependencyNames"`
Datasources []common.DatasourceType `json:"datasources" yaml:"datasources"`
}
func (*RuleMatch) IsMatchAll ¶
A MatchAll rule is a rule that has no matches defined at all, so it will match everything.