Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitLabMonitor update configuration #1231

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,8 @@ type Update struct {
ReleaseMonitor *ReleaseMonitor `json:"release-monitor,omitempty" yaml:"release-monitor,omitempty"`
// The configuration block for updates tracked via the Github API
GitHubMonitor *GitHubMonitor `json:"github,omitempty" yaml:"github,omitempty"`
// The configuration block for updates tracked via the GitLab rest API
GitLabMonitor *GitLabMonitor `json:"gitlab,omitempty" yaml:"gitlab,omitempty"`
// The configuration block for transforming the `package.version` into an APK version
VersionTransform []VersionTransform `json:"version-transform,omitempty" yaml:"version-transform,omitempty"`
}
Expand Down Expand Up @@ -513,6 +515,23 @@ type GitHubMonitor struct {
UseTags bool `json:"use-tag,omitempty" yaml:"use-tag,omitempty"`
}

// GitLabMonitor indicates using the GitLab API
type GitLabMonitor struct {
// Org/Subgroup/repo for GitLab
Identifier string `json:"identifier" yaml:"identifier"`
// If the version in GitLab contains a prefix which should be ignored
StripPrefix string `json:"strip-prefix,omitempty" yaml:"strip-prefix,omitempty"`
// If the version in GitLab contains a suffix which should be ignored
StripSuffix string `json:"strip-suffix,omitempty" yaml:"strip-suffix,omitempty"`
// Prefix filter to apply when searching tags on a GitLab repository
TagFilterPrefix string `json:"tag-filter-prefix,omitempty" yaml:"tag-filter-prefix,omitempty"`
// Filter to apply when searching tags on a GitLab repository
TagFilterContains string `json:"tag-filter-contains,omitempty" yaml:"tag-filter-contains,omitempty"`
// Override the default of using a GitLab release to identify related tag to
// fetch. Not all projects use GitLab releases but just use tags
UseTags bool `json:"use-tag,omitempty" yaml:"use-tag,omitempty"`
}

// VersionTransform allows mapping the package version to an APK version
type VersionTransform struct {
// Required: The regular expression to match against the `package.version` variable
Expand Down
38 changes: 38 additions & 0 deletions pkg/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,40 @@
],
"description": "GitHubMonitor indicates using the GitHub API"
},
"GitLabMonitor": {
"properties": {
"identifier": {
"type": "string",
"description": "Org/Subgroup/repo for GitLab"
},
"strip-prefix": {
"type": "string",
"description": "If the version in GitLab contains a prefix which should be ignored"
},
"strip-suffix": {
"type": "string",
"description": "If the version in GitLab contains a suffix which should be ignored"
},
"tag-filter-prefix": {
"type": "string",
"description": "Prefix filter to apply when searching tags on a GitLab repository"
},
"tag-filter-contains": {
"type": "string",
"description": "Filter to apply when searching tags on a GitLab repository"
},
"use-tag": {
"type": "boolean",
"description": "Override the default of using a GitLab release to identify related tag to\nfetch. Not all projects use GitLab releases but just use tags"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"identifier"
],
"description": "GitLabMonitor indicates using the GitLab API"
},
"Group": {
"properties": {
"groupname": {
Expand Down Expand Up @@ -900,6 +934,10 @@
"$ref": "#/$defs/GitHubMonitor",
"description": "The configuration block for updates tracked via the Github API"
},
"gitlab": {
"$ref": "#/$defs/GitLabMonitor",
"description": "The configuration block for updates tracked via the GitLab rest API"
},
"version-transform": {
"items": {
"$ref": "#/$defs/VersionTransform"
Expand Down
Loading