Skip to content
Snippets Groups Projects
Commit 4a72ed70 authored by Andrew Newdigate's avatar Andrew Newdigate
Browse files

Merge branch 'bvl/truncated-versions-opt-out' into 'main'

feat(renovate): allow opting-out of truncated versions

See merge request gitlab-com/gl-infra/common-ci-tasks!910
parents b607de48 a40dead4
No related branches found
No related tags found
No related merge requests found
Pipeline #24956297 failed
Loading
Loading
@@ -274,8 +274,6 @@ To disable Renovate, run a pipeline with `RENOVATE_DISABLED=1` set.
 
## Truncated Versions
 
**[This is Experimental](https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/issues/19)**.
In an effort to reduce Renovate noise, and toil for Infrastructure teams, for certain low-risk dependencies,
a preset Renovate configuration is available which will configure Renovate to exclude Patch versions
from the specified dependency version.
Loading
Loading
@@ -299,20 +297,26 @@ In order for this to work effectively and safely, several conditions must be met
of the produced artifacts is more important.
1. Truncated versions should be avoided for projects that do not strictly follow semver semantics.
 
### Including the Truncated Versions Preset in your Renovate Configuration
This is enabled by default by extending from `gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-common`
in a project's `renovate.json` file.
### Disabling Truncated Versions Preset in your Renovate Configuration
 
Extend your configuration with the `gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-truncated-versions` preset.
Extend your configuration with the `gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-no-truncated-versions` preset.
 
```json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-common",
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-truncated-versions"
"gitlab>gitlab-com/gl-infra/common-ci-tasks:renovate-no-truncated-versions"
]
}
```
 
This will make the listed dependencies use regular semver (`x.y.z`)
version numbers again on renovate runs.
### Publishing Truncated Versions in Upstream Dependencies
 
#### For Projects that Rely on Git Tags for Versioning
Loading
Loading
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"description": "++++++++++ SEE https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/renovate-bot.md#truncated-versions FOR DETAILS ON THIS PRESET ++++++++++",
"packageRules": [
{
"matchPackageNames": [
"gitlab-com/gl-infra/pmv",
"gitlab-com/gl-infra/common-ci-tasks",
"mvdan/sh",
"koalaman/shellcheck",
"golangci/golangci-lint",
"goreleaser/goreleaser",
"gitlab.com/gitlab-com/gl-infra/jsonnet-tool"
],
"extractVersion": "^v?(?<version>\\d+\\.\\d+\\.d+)"
},
{
"matchPackageNames": [
"gitlab-com/gl-infra/common-ci-tasks"
],
"matchManagers": ["gitlabci", "gitlabci-include", "pre-commit"],
"extractVersion": "^v?(?<version>\\d+\\.\\d+\\.d+)"
}
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment