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

feat(docker/java): add workaround to limit releases to java LTS versions #18007

Merged
merged 15 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 14 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
14 changes: 14 additions & 0 deletions docs/usage/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ description: Java versions support in Renovate
Renovate can update Gradle and Maven dependencies.
This includes libraries and plugins as well as the Gradle Wrapper.

## LTS releases

The `config:base` preset includes the `workarounds:javaLTSVersions` preset.
The workaround limits Renovate to upgrade to LTS versions of the Java runtime only.

If you want Renovate to offer all `major` Java updates then add `workarounds:javaLTSVersions` to the `ignorePreset` array:

```
{
"extends": ["config:base"],
"ignorePresets": ["workarounds:javaLTSVersions"]
}
```

## Gradle

Renovate detects versions that are specified in a string `'group:artifact:version'` and those specified in a map `(group:groupName, name:ArtifactName, version:Version)`.
Expand Down
21 changes: 21 additions & 0 deletions lib/config/presets/internal/workarounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const presets: Record<string, Preset> = {
'workarounds:reduceRepologyServerLoad',
'workarounds:doNotUpgradeFromAlpineStableToEdge',
'workarounds:supportRedHatImageVersion',
'workarounds:javaLTSVersions',
],
ignoreDeps: [],
},
Expand Down Expand Up @@ -118,4 +119,24 @@ export const presets: Record<string, Preset> = {
},
],
},
javaLTSVersions: {
description: 'Limit Java runtime versions to LTS releases',
rarkins marked this conversation as resolved.
Show resolved Hide resolved
packageRules: [
{
description:
'Limit Java runtime versions to LTS releases. To receive all major releases add `javaLTSVersions` to the `ignorePresets` array.',
matchDatasources: ['docker', 'adoptium-java'],
matchPackageNames: [
'eclipse-temurin',
'amazoncorretto',
'adoptopenjdk',
'openjdk',
'java',
],
versioning:
'regex:^(?<major>\\d+)?(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?([\\._+](?<build>\\d+))?(-(?<compatibility>.*))?$',
rarkins marked this conversation as resolved.
Show resolved Hide resolved
allowedVersions: '/^(?:8|11|17|21|25|29)(?:\\.|$)/',
},
],
},
};