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(versioning/redhat): Support for Red Hat release versioning #16294

Merged
merged 10 commits into from
Jul 3, 2022

Conversation

Churro
Copy link
Collaborator

@Churro Churro commented Jun 27, 2022

Changes

This PR adds support for the versioning pattern used by Red Hat-maintained container images. This enables updates for ubi8-minimal, rhel7, ubi9/perl-532 and further images that follow this versioning.

Workaround patterns are added for all container libraries which are maintained exclusively by Red Hat and which only images that follow this versioning concept. So, no false positives should occur, as all images in these paths indeed use this versioning (Yes, I verified that). Note: the absence of trailing slashes in some cases is totally on purpose, as there is e.g. ubi7-minimal but also ubi7/ubi-minimal.

Red Hat version definitions (e.g.. 8.0-7) consist of:

  • the version of the main component, whereas major is mandatory, minor and patch optional
  • optionally a hyphen followed by release information
  • the version of Red Hat's release, described as an integer and optionally followed by a timestamp, e.g. 2.4-195.1655305687 (Apache httpd 2.4)

Test repositories:

Implementation Notes

#15781 (comment) mentioned a promising RegEx, which, unfortunately, only works in very specific cases:

  • It requires a build version to be specified, i.e., with ubi-minimal:8.6 -> "skipReason": "invalid-value"
  • It only works if there is a minor update available, e.g. ubi-minimal:8.5-218 -> 8.6-751

It is possible to make this RegEx more "flexible", e.g. like this:
"versioning": "regex:^(?<major>\\d+)(?:\\.(?<minor>\\d+))?(?:[-\\.](?<patch>\\d+))?(?:[-\\.](?<build>\\d+))?(?:\\.(?<prerelease>\\d+))?$"
-> this will recognize the "major release version" in patch and handle an occasional "minor release version" in build. This is still spurious because with ubi9/ubi-minimal, patch versions were introduced and then this doesn't work anymore. In addition, precedence is not handled correctly because higher minor release versions should trigger an update (e.g. 1-19 -> 1-19.1655193074).

The solution implemented in this PR works with ubi8, ubi9 and any other image following this versioning. Tested also with many different version variations (https://regex101.com/r/MKZaMQ/1).

Context

Closes #15781

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM

lib/modules/versioning/api.ts Outdated Show resolved Hide resolved
lib/modules/versioning/api.ts Outdated Show resolved Hide resolved
Churro and others added 2 commits June 28, 2022 08:11
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
lib/modules/versioning/redhat/readme.md Outdated Show resolved Hide resolved
lib/modules/versioning/redhat/readme.md Outdated Show resolved Hide resolved
Churro and others added 3 commits June 28, 2022 11:07
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
@rarkins rarkins requested a review from viceice June 29, 2022 06:46
Copy link
Collaborator

@HonkingGoose HonkingGoose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs are good to go.

@rarkins rarkins enabled auto-merge (squash) June 29, 2022 10:01
@rarkins rarkins merged commit 8738b0a into renovatebot:main Jul 3, 2022
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 32.105.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renovate doesn't update Docker Images from Red Hat Registry
6 participants