Skip to content
Snippets Groups Projects
Verified Commit a40dead4 authored by Bob Van Landuyt :neckbeard:'s avatar Bob Van Landuyt :neckbeard: 😎
Browse files

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

This allows projects to opt out again from the truncated versions by
overriding the configuration to use full-semver again.

The annoying thing with this implementation is that we need to keep
the list in `renovate-truncated-versions.json` and
`renovate-no-truncated-versions.json` in sync. It might be better to
sprinkle this with some jsonnet, but both resulting files would need
to be checked in anyway for consumption by renovate downstream.

Follow up to https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/merge_requests/909#note_2355440070
parent b607de48
No related branches found
No related tags found
No related merge requests found
Pipeline #24956087 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