-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Warn when operating system end of life is approaching #7913
Warn when operating system end of life is approaching #7913
Conversation
First prototype that includes a user interface and localized messages with parameters to support the specific operating system.
Admin monitors are disabled and enabled by a user interface action. There is not an obvious way to detect that a date has passed so that it should be enabled again.
Do not depend on the existence of /etc/os-release
The pull request has been changed to use a single admin monitor to check for many different operating systems. Interactive testing was performed as described in "Testing done" with the most recent version of these changes. Automated tests have been created to cover most of the branches and statements in the new class. The Red Hat Enterprise Linux 7 end of life stated in this pull request is intended to happen at about the same time as Jenkins 2.425.1, the 2nd LTS baseline after 2.401.1. That gives weekly users 6 months of warning and gives LTS users 3 months of warning. Definitely must be squash merged. I used this pull request as a learning experience. My path is indicated in the commits but no one else should be bothered by the many commits that I made while exploring. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
core/src/test/java/jenkins/monitor/EndOfLifeOperatingSystemAdminMonitorTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Alexander Brandes <brandes.alexander@web.de>
core/src/main/java/jenkins/monitor/EndOfLifeOperatingSystemAdminMonitor.java
Outdated
Show resolved
Hide resolved
core/src/main/resources/jenkins/monitor/EndOfLifeOperatingSystemAdminMonitor/message.properties
Outdated
Show resolved
Hide resolved
core/src/main/resources/jenkins/monitor/EndOfLifeOperatingSystemAdminMonitor/message.properties
Outdated
Show resolved
Hide resolved
core/src/main/resources/jenkins/monitor/EndOfLifeOperatingSystemAdminMonitor/message.properties
Outdated
Show resolved
Hide resolved
Non-breaking spaces are not recommended. Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
The fragment may be useful in the future for analytics. Harmless to send the fragment to www.jenkins.io and www.jenkins.io may be able to make use of it to direct the reader to information that is specific to their operating system.
core/src/test/java/jenkins/monitor/OperatingSystemEndOfLifeAdminMonitorTest.java
Outdated
Show resolved
Hide resolved
jenkinsci#7913 (comment) is the comment that prompted the improvement.
This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. |
* Ubuntu 18.04 end of life admin monitor First prototype that includes a user interface and localized messages with parameters to support the specific operating system. * Use a base class for common features Admin monitors are disabled and enabled by a user interface action. There is not an obvious way to detect that a date has passed so that it should be enabled again. * Better comment * Make the logging clearer * Split pattern check to separate method * Add a message to show after end of life * Suppress most logging * Minor logging improvements * Use actual end of life date for Ubuntu 18.04 * Logger not needed * Add Alpine 3.14 end of life admin monitor * Add Alpine 3.15 end of life monitor * Add Alpine 3.16 end of life monitor * Add Alpine 3.17 end of life monitor * Spotless cleanup * Add Fedora 37, 38, and Red Hat 7 * More accurate regex to detect version * Add Debian 10 end of life admin monitor * Add a few tests * Add another test * Fix checkstyle violations * Fix spotbugs warning * Correct the copyright * Make test viable on non-Linux machines Do not depend on the existence of /etc/os-release * Name the setup function more accurately * Test a file with non-matching content * Test the Alpine end of life admin monitors * Add more tests * Test Fedora 37 admin monitor * Add RHEL 7 test * Announce RHEL 7 early end of support immediately * Use consistent logging calls * Add Red Hat 8 to RHEL 7 as a test * Use past date to report RHEL 7 end of life * Remove Red Hat 8 from RHEL 7 end of life * Log more information * Display end of support date Incorrect to declare end of support as the date when we begin warning the user about end of life. * Add descriptions of the admin monitors * Use a better redirect URL * Group admin monitors better by display name * Remove unnused message.properties files * Add description.jelly file * Better description of the admin monitors * Add endOfSupportDate getter Needed for UI * Fix minor indentation error * Each monitor must be independently disabled * Repurpose identifier for use in disabled property Don't need the idenitfier anywhere except in the initial constructor call that is later used to enable and disable the admin monitor. * Add Red Hat 8 to RHEL 7 as a test * Add os-release tests and data files * Remove unused URL arg to constructor * Reduce duplication in data Easier to test with symbolic constants that are consistently named across all the classes. Includes tests of os-release files from each of the end of life operating systems * Fix inaccurate comment * Use constant for documentation URL * Remove RHEL 8 from RHEL 8 Admin Monitor * Fedora 36 security support ends 18 May 2023 * Fedora 37 support ends 15 Dec 2023 * Fix spelling error in description * Read data file with UTF-8 character set * Do not use extension point name in symbol * Use single word 'Ignore' in button, not name of monitor * Use a smaller layout for monitor name * Include operating system version in RHEL 7 check Includes a TODO comment to remove the RHEL 8 entry that I use for testing and development * Fix regex syntax error * First prototype using a data file * Start the conversion to a single monitor * Latest experiments with end of life data as JSON * More exploring and evolving * Remove Alpine admin monitor * Remove Fedora admin monitor * Remove Debian admin monitor * Remove Ubuntu admin monitor * Throw IOException rather than check for null IOException should be uncommon and mistakes should be detected by automated tests * Stop inheriting from EndOfLifeAdminMonitor * Simplify initialization logic Else clauses not required due to break. * Add isActivated implementation * Add setDisabled test method * Minor formatting changes * Test some additional methods * Call super in constructor * Minor updates from study of upstream class * Format JSON data * Fix formatting errors * Fix assertion * Better variable naming * Explain the purpose of ignoreEndOfLife flag * Remove unused import * Store the pretty name, not the pattern * Test pretty name with sample os-release data files * Remove RedHat 7 specific monitor * Set RHEL 8 end of life early for test * Ongoing debugging * Describe the monitor * Honor start date * Add pretty name as monitor attribute * Add end of support date * Remove earlier implementations * Move end of life data * Rename end of support to end of life End of life is used throughout the monitor * Improve message with after end of life date status * Undo .gitignore change * Rename effective date to end of life date * Rename pretty name to operating system name * More rename of prettyName * Fix logging mistakes * Add RHEL 8 * Default start date is 6 months before end of life * Add operating system end of life patterns and dates * Fix JSON file formatting * Simplify logging code * Better logging * Add Alma and Rocky Linux tests and patterns * Add methods to help test automation * Remove unused methods * Start warning RHEL 7 users immediately * Suppress spotbugs traversal_in warning - false positive * Throw IOException on bad data file Fail tests quickly when a a bad data file is used * Better exception message * Correct RHEL 8 end of life date * Enable isActivated test * Increase test coverage * Fix spelling error Co-authored-by: Alexander Brandes <brandes.alexander@web.de> * Remove non-breaking spaces from message Non-breaking spaces are not recommended. Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> * Rename class to match symbol https://github.com/jenkinsci/jenkins/pull/7913/files#r1199814150 * Sort end of life data alphabetically * Included OS query parameter and fragment in docs URL The fragment may be useful in the future for analytics. Harmless to send the fragment to www.jenkins.io and www.jenkins.io may be able to make use of it to direct the reader to information that is specific to their operating system. * Scientific Linux 8 does not exist * Remove fragment, only need query parameter jenkinsci#7913 (comment) is the comment that prompted the improvement. --------- Co-authored-by: Alexander Brandes <brandes.alexander@web.de> Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> Co-authored-by: Alexander Brandes <mc.cache@web.de> (cherry picked from commit ab06bf5)
Warn when operating system end of life is approaching
Jenkins controllers run on many different operating systems. The Linux Support Policy states that the Jenkins project does not support Jenkins on operating systems that are no longer supported by the operating system provider. Administrative monitors added in this pull request will alert administrators of the end of life of the operating system that is running Jenkins so that they can upgrade to a supported operating system.
The operating system end of life dates are taken from the endoflife.date site.
Early end of life for RHEL 7, CentOS 7, and others
This pull request proposes to accelerate the end of life date for Red Hat Enterprise Linux 7, CentOS Linux 7, Scientific Linux 7, and Oracle Linux 7. Those operating systems will be unsupported by their providers after June 30, 2024. This pull request proposes to end Jenkins support for those operating systems by December 31, 2023.
Those operating systems are already unsupported by the
systemd
rpm based installer for Jenkins. The CentOS 7 container image that is the basis for the Jenkinscentos7
container image is already deprecated. It was last updated Nov 16, 2020.Command line git 1.8 as included with those operating systems is far behind the command line git 2.x versions on every other operating system tested by the Jenkins project. It lacks features that are available on every other operating system supported by Jenkins.
OpenSSH 7.4 as included with those operating systems is far behind the OpenSSH versions on every other operating system tested by the Jenkins project. It lacks features that are available on every other operating system supported by Jenkins.
If it will be more acceptable, I'm willing to split this pull request into two pull requests, one that adds the Admin monitors for scheduled operating system end of life (like Ubuntu 18.04, Alpine Linux 3.14, etc.) and one that proposes to accelerate the Red Hat Enterprise Linux 7 end of life.
I'm also willing to submit a Jenkins Enhancement Proposal for the accelerated end of life, if there is a strong preference for that to be discussed in a JEP.
Screenshots
The end of life admin monitor for CentOS 7 looks like this when displayed to the administrator from the main page:
The administrative monitor looks like this from the "Manage Jenkins" page
The administrative monitor covers the operating systems that will reach end of life by the end of 2024 and beyond.
Testing done
Tested interactively with a private build of the Jenkins
centos7
container image to confirm that the admin monitor displays correctly when run with CentOS 7 and that it is not displayed when running on other operating systems like Red Hat Enterprise Linux 8.Tested interactively that the administrative monitor checkboxes in the "Manage Jenkins" / "System" page correctly enable and disable individual monitors.
Confirmed the published end of life dates match the dates in the source files, with the exception of the RHEL 7 accelerated end of life date.
Automated tests include sample data from each of the target operating systems. Input / output exceptions reading the operating system data files are the only lines not covered by automated tests.
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
@Restricted
or have@since TODO
Javadocs, as appropriate.@Deprecated(since = "TODO")
or@Deprecated(forRemoval = true, since = "TODO")
, if applicable.eval
to ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
Maintainer checklist
Before the changes are marked as
ready-for-merge
:upgrade-guide-needed
label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidate
to be considered (see query).