Skip to content

Commit

Permalink
Update operating system end of life data (#8864)
Browse files Browse the repository at this point in the history
Add end of life data for several more Linux releases

Adds data for:

* Alpine Linux 3.19
* Amazon Linux 2 (already end of life for Jenkins)
* Amazon Linux 2023
* Fedora 39

Includes test data for more Linux operating systems that were already
included in the end of life data.
  • Loading branch information
MarkEWaite authored Jan 14, 2024
1 parent 48661db commit 72eb26a
Show file tree
Hide file tree
Showing 14 changed files with 245 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ String readOperatingSystemName(File dataFile, @NonNull String patternStr) {
if (dataFile == null || !dataFile.exists()) {
return "";
}
Pattern pattern = Pattern.compile("^PRETTY_NAME=[\"](" + patternStr + ".*)[\"]");
Pattern pattern = Pattern.compile("^PRETTY_NAME=[\"](" + patternStr + ")[\"]");
String name = "";
try {
List<String> lines = dataFile.equals(lastDataFile) ? lastLines : Files.readAllLines(dataFile.toPath());
Expand Down Expand Up @@ -229,8 +229,8 @@ String readDocumentationUrl(File dataFile, @NonNull String patternStr) {
if (dataFile == null || !dataFile.exists()) {
return "";
}
String operatingSystemName = readOperatingSystemName(dataFile, patternStr);
return buildDocumentationUrl(operatingSystemName);
String name = readOperatingSystemName(dataFile, patternStr);
return buildDocumentationUrl(name);
}

private String buildDocumentationUrl(String operatingSystemName) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[
{
"pattern": "AlmaLinux.* 8",
"pattern": "AlmaLinux.* 8.*",
"endOfLife": "2029-03-31"
},
{
"pattern": "AlmaLinux.* 9",
"pattern": "AlmaLinux.* 9.*",
"endOfLife": "2032-05-31"
},
{
Expand All @@ -28,111 +28,129 @@
"endOfLife": "2025-05-01"
},
{
"pattern": "CentOS Linux.* 7",
"pattern": "Alpine Linux v3.19",
"endOfLife": "2025-11-01"
},
{
"pattern": "Amazon Linux 2",
"start": "2023-05-01",
"endOfLife": "2023-11-16"
},
{
"pattern": "Amazon Linux 2023",
"start": "2027-09-15",
"endOfLife": "2028-03-15"
},
{
"pattern": "CentOS Linux.* 7.*",
"start": "2023-05-01",
"endOfLife": "2023-11-16"
},
{
"pattern": "CentOS Linux.* 8",
"pattern": "CentOS Linux.* 8.*",
"endOfLife": "2029-03-31"
},
{
"pattern": "Debian.* 10",
"pattern": "Debian.* 10.*",
"endOfLife": "2024-06-30"
},
{
"pattern": "Debian.* 11",
"pattern": "Debian.* 11.*",
"endOfLife": "2026-06-30"
},
{
"pattern": "Debian.* 12",
"pattern": "Debian.* 12.*",
"endOfLife": "2028-06-30"
},
{
"pattern": "Fedora.* 36",
"pattern": "Fedora.* 36.*",
"endOfLife": "2023-05-18"
},
{
"pattern": "Fedora.* 37",
"pattern": "Fedora.* 37.*",
"endOfLife": "2023-12-15"
},
{
"pattern": "Fedora.* 38",
"pattern": "Fedora.* 38.*",
"endOfLife": "2024-05-18"
},
{
"pattern": "Oracle Linux.* 7",
"pattern": "Fedora.* 39.*",
"endOfLife": "2024-12-07"
},
{
"pattern": "Oracle Linux.* 7.*",
"start": "2023-05-01",
"endOfLife": "2023-11-16"
},
{
"pattern": "Oracle Linux.* 8",
"pattern": "Oracle Linux.* 8.*",
"endOfLife": "2029-03-31"
},
{
"pattern": "Oracle Linux.* 9",
"pattern": "Oracle Linux.* 9.*",
"endOfLife": "2034-06-30"
},
{
"pattern": "Red Hat Enterprise Linux.* 7",
"pattern": "Red Hat Enterprise Linux.* 7.*",
"start": "2023-05-01",
"endOfLife": "2023-11-16"
},
{
"pattern": "Red Hat Enterprise Linux.* 8",
"pattern": "Red Hat Enterprise Linux.* 8.*",
"endOfLife": "2029-03-31"
},
{
"pattern": "Red Hat Enterprise Linux.* 9",
"pattern": "Red Hat Enterprise Linux.* 9.*",
"endOfLife": "2032-05-31"
},
{
"pattern": "Rocky Linux.* 8",
"pattern": "Rocky Linux.* 8.*",
"endOfLife": "2029-03-31"
},
{
"pattern": "Rocky Linux.* 9",
"pattern": "Rocky Linux.* 9.*",
"endOfLife": "2032-05-31"
},
{
"pattern": "Scientific Linux.* 7",
"pattern": "Scientific Linux.* 7.*",
"start": "2023-05-01",
"endOfLife": "2023-11-16"
},
{
"pattern": "Ubuntu.* 16.04",
"pattern": "Ubuntu.* 16.04.*",
"endOfLife": "2021-04-02"
},
{
"pattern": "Ubuntu.* 18.04",
"pattern": "Ubuntu.* 18.04.*",
"endOfLife": "2023-05-31"
},
{
"pattern": "Ubuntu.* 20.04",
"pattern": "Ubuntu.* 20.04.*",
"endOfLife": "2025-04-02"
},
{
"pattern": "Ubuntu.* 20.10",
"pattern": "Ubuntu.* 20.10.*",
"endOfLife": "2021-07-22"
},
{
"pattern": "Ubuntu.* 21.04",
"pattern": "Ubuntu.* 21.04.*",
"endOfLife": "2022-01-20"
},
{
"pattern": "Ubuntu.* 21.10",
"pattern": "Ubuntu.* 21.10.*",
"endOfLife": "2022-07-14"
},
{
"pattern": "Ubuntu.* 22.04",
"pattern": "Ubuntu.* 22.04.*",
"endOfLife": "2027-04-01"
},
{
"pattern": "Ubuntu.* 22.10",
"pattern": "Ubuntu.* 22.10.*",
"endOfLife": "2023-07-20"
},
{
"pattern": "Ubuntu.* 23.04",
"pattern": "Ubuntu.* 23.04.*",
"endOfLife": "2024-01-20"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.Random;
import java.util.stream.Stream;
import org.junit.Test;
Expand Down Expand Up @@ -111,30 +113,43 @@ private String docsUrl(String component) {

private static Stream<Arguments> testReadDocumentationUrls() {
return Stream.of(
Arguments.of("os-release-alma-8", "AlmaLinux.* 8", "AlmaLinux-8.7-Stone-Smilodon"),
Arguments.of("os-release-alma-8", "AlmaLinux.* 8.*", "AlmaLinux-8.7-Stone-Smilodon"),
Arguments.of("os-release-alma-9", "AlmaLinux.* 9.*", "AlmaLinux-9.3-Shamrock-Pampas-Cat"),
Arguments.of("os-release-alpine-3.14", "Alpine Linux v3.14", "Alpine-Linux-v3.14"),
Arguments.of("os-release-alpine-3.15", "Alpine Linux v3.15", "Alpine-Linux-v3.15"),
Arguments.of("os-release-alpine-3.16", "Alpine Linux v3.16", "Alpine-Linux-v3.16"),
Arguments.of("os-release-alpine-3.17", "Alpine Linux v3.17", "Alpine-Linux-v3.17"),
Arguments.of("os-release-alpine-3.18", "Alpine Linux v3.18", "Alpine-Linux-v3.18"),
Arguments.of("os-release-centos-7", "CentOS Linux.* 7", "CentOS-Linux-7-Core"),
Arguments.of("os-release-debian-10", "Debian.* 10", "Debian-GNU-Linux-10-buster"),
Arguments.of("os-release-fedora-36", "Fedora.* 36", "Fedora-Linux-36-Container-Image"),
Arguments.of("os-release-fedora-37", "Fedora.* 37", "Fedora-Linux-37-Container-Image"),
Arguments.of("os-release-oracle-7", "Oracle Linux.* 7", "Oracle-Linux-Server-7.9"),
Arguments.of("os-release-oracle-8", "Oracle Linux.* 8", "Oracle-Linux-Server-8.7"),
Arguments.of("os-release-redhat-7", "Red Hat Enterprise Linux.* 7", "Red-Hat-Enterprise-Linux-Server-7.9-Maipo"),
Arguments.of("os-release-redhat-8", "Red Hat Enterprise Linux.* 8", "Red-Hat-Enterprise-Linux-8.8-Ootpa"),
Arguments.of("os-release-rocky-8", "Rocky Linux.* 8", "Rocky-Linux-8.7-Green-Obsidian"),
Arguments.of("os-release-scientific-7", "Scientific Linux.* 7", "Scientific-Linux-7.9-Nitrogen"),
Arguments.of("os-release-ubuntu-18.04", "Ubuntu.* 18", "Ubuntu-18.04.6-LTS")
Arguments.of("os-release-alpine-3.19", "Alpine Linux v3.19", "Alpine-Linux-v3.19"),
Arguments.of("os-release-amazon-linux-2", "Amazon Linux 2", "Amazon-Linux-2"),
Arguments.of("os-release-amazon-linux-2023", "Amazon Linux 2023", "Amazon-Linux-2023"),
Arguments.of("os-release-centos-7", "CentOS Linux.* 7.*", "CentOS-Linux-7-Core"),
Arguments.of("os-release-centos-8", "CentOS Linux.* 8.*", "CentOS-Linux-8"),
Arguments.of("os-release-debian-10", "Debian.* 10.*", "Debian-GNU-Linux-10-buster"),
Arguments.of("os-release-debian-11", "Debian.* 11.*", "Debian-GNU-Linux-11-bullseye"),
Arguments.of("os-release-debian-12", "Debian.* 12.*", "Debian-GNU-Linux-12-bookworm"),
Arguments.of("os-release-fedora-36", "Fedora.* 36.*", "Fedora-Linux-36-Container-Image"),
Arguments.of("os-release-fedora-37", "Fedora.* 37.*", "Fedora-Linux-37-Container-Image"),
Arguments.of("os-release-fedora-38", "Fedora.* 38.*", "Fedora-Linux-38-Container-Image"),
Arguments.of("os-release-fedora-39", "Fedora.* 39.*", "Fedora-Linux-39-Container-Image"),
Arguments.of("os-release-oracle-7", "Oracle Linux.* 7.*", "Oracle-Linux-Server-7.9"),
Arguments.of("os-release-oracle-8", "Oracle Linux.* 8.*", "Oracle-Linux-Server-8.7"),
Arguments.of("os-release-redhat-7", "Red Hat Enterprise Linux.* 7.*", "Red-Hat-Enterprise-Linux-Server-7.9-Maipo"),
Arguments.of("os-release-redhat-8", "Red Hat Enterprise Linux.* 8.*", "Red-Hat-Enterprise-Linux-8.8-Ootpa"),
Arguments.of("os-release-rocky-8", "Rocky Linux.* 8.*", "Rocky-Linux-8.7-Green-Obsidian"),
Arguments.of("os-release-scientific-7", "Scientific Linux.* 7.*", "Scientific-Linux-7.9-Nitrogen"),
Arguments.of("os-release-ubuntu-18.04", "Ubuntu.* 18.*", "Ubuntu-18.04.6-LTS"),
Arguments.of("os-release-ubuntu-20.04", "Ubuntu.* 20.*", "Ubuntu-20.04.6-LTS"),
Arguments.of("os-release-ubuntu-22.04", "Ubuntu.* 22.*", "Ubuntu-22.04.3-LTS")
);
}

@ParameterizedTest
@MethodSource
public void testReadDocumentationUrls(String fileName, String pattern, String component) throws Exception {
File releaseFile = new File(this.getClass().getResource(fileName).toURI());
URL fileUrl = this.getClass().getResource(fileName);
assertTrue("Resource file '" + fileName + "' not found", fileUrl != null);
File releaseFile = new File(fileUrl.toURI());
assertThat(monitor.readDocumentationUrl(releaseFile, pattern), is(docsUrl(component)));
}

Expand All @@ -158,30 +173,40 @@ public void testReadOperatingSystemListNoPattern() {

private static Stream<Arguments> testReadOperatingSystemNames() {
return Stream.of(
Arguments.of("os-release-alma-8", "AlmaLinux.* 8", "AlmaLinux 8.7 (Stone Smilodon)"),
Arguments.of("os-release-alma-8", "AlmaLinux.* 8.*", "AlmaLinux 8.7 (Stone Smilodon)"),
Arguments.of("os-release-alma-9", "AlmaLinux.* 9.*", "AlmaLinux 9.3 (Shamrock Pampas Cat)"),
Arguments.of("os-release-alpine-3.14", "Alpine Linux v3.14", "Alpine Linux v3.14"),
Arguments.of("os-release-alpine-3.15", "Alpine Linux v3.15", "Alpine Linux v3.15"),
Arguments.of("os-release-alpine-3.16", "Alpine Linux v3.16", "Alpine Linux v3.16"),
Arguments.of("os-release-alpine-3.17", "Alpine Linux v3.17", "Alpine Linux v3.17"),
Arguments.of("os-release-alpine-3.18", "Alpine Linux v3.18", "Alpine Linux v3.18"),
Arguments.of("os-release-centos-7", "CentOS Linux.* 7", "CentOS Linux 7 (Core)"),
Arguments.of("os-release-debian-10", "Debian.* 10", "Debian GNU/Linux 10 (buster)"),
Arguments.of("os-release-fedora-36", "Fedora.* 36", "Fedora Linux 36 (Container Image)"),
Arguments.of("os-release-fedora-37", "Fedora.* 37", "Fedora Linux 37 (Container Image)"),
Arguments.of("os-release-oracle-7", "Oracle Linux.* 7", "Oracle Linux Server 7.9"),
Arguments.of("os-release-oracle-8", "Oracle Linux.* 8", "Oracle Linux Server 8.7"),
Arguments.of("os-release-redhat-7", "Red Hat Enterprise Linux.* 7", "Red Hat Enterprise Linux Server 7.9 (Maipo)"),
Arguments.of("os-release-redhat-8", "Red Hat Enterprise Linux.* 8", "Red Hat Enterprise Linux 8.8 (Ootpa)"),
Arguments.of("os-release-rocky-8", "Rocky Linux.* 8", "Rocky Linux 8.7 (Green Obsidian)"),
Arguments.of("os-release-scientific-7", "Scientific Linux.* 7", "Scientific Linux 7.9 (Nitrogen)"),
Arguments.of("os-release-ubuntu-18.04", "Ubuntu.* 18", "Ubuntu 18.04.6 LTS")
Arguments.of("os-release-alpine-3.19", "Alpine Linux v3.19", "Alpine Linux v3.19"),
Arguments.of("os-release-amazon-linux-2", "Amazon Linux 2", "Amazon Linux 2"),
Arguments.of("os-release-amazon-linux-2023", "Amazon Linux 2023", "Amazon Linux 2023"),
Arguments.of("os-release-centos-7", "CentOS Linux.* 7.*", "CentOS Linux 7 (Core)"),
Arguments.of("os-release-debian-10", "Debian.* 10.*", "Debian GNU/Linux 10 (buster)"),
Arguments.of("os-release-debian-11", "Debian.* 11.*", "Debian GNU/Linux 11 (bullseye)"),
Arguments.of("os-release-debian-12", "Debian.* 12.*", "Debian GNU/Linux 12 (bookworm)"),
Arguments.of("os-release-fedora-36", "Fedora.* 36.*", "Fedora Linux 36 (Container Image)"),
Arguments.of("os-release-fedora-37", "Fedora.* 37.*", "Fedora Linux 37 (Container Image)"),
Arguments.of("os-release-oracle-7", "Oracle Linux.* 7.*", "Oracle Linux Server 7.9"),
Arguments.of("os-release-oracle-8", "Oracle Linux.* 8.*", "Oracle Linux Server 8.7"),
Arguments.of("os-release-redhat-7", "Red Hat Enterprise Linux.* 7.*", "Red Hat Enterprise Linux Server 7.9 (Maipo)"),
Arguments.of("os-release-redhat-8", "Red Hat Enterprise Linux.* 8.*", "Red Hat Enterprise Linux 8.8 (Ootpa)"),
Arguments.of("os-release-rocky-8", "Rocky Linux.* 8.*", "Rocky Linux 8.7 (Green Obsidian)"),
Arguments.of("os-release-scientific-7", "Scientific Linux.* 7.*", "Scientific Linux 7.9 (Nitrogen)"),
Arguments.of("os-release-ubuntu-18.04", "Ubuntu.* 18.*", "Ubuntu 18.04.6 LTS"),
Arguments.of("os-release-ubuntu-20.04", "Ubuntu.* 20.*", "Ubuntu 20.04.6 LTS"),
Arguments.of("os-release-ubuntu-22.04", "Ubuntu.* 22.*", "Ubuntu 22.04.3 LTS")
);
}

@ParameterizedTest
@MethodSource
public void testReadOperatingSystemNames(String fileName, String pattern, String job) throws Exception {
File releaseFile = new File(this.getClass().getResource(fileName).toURI());
URL fileUrl = this.getClass().getResource(fileName);
assertTrue("Resource file '" + fileName + "' not found", fileUrl != null);
File releaseFile = new File(fileUrl.toURI());
assertThat(monitor.readOperatingSystemName(releaseFile, pattern), is(job));
}

Expand Down
18 changes: 18 additions & 0 deletions core/src/test/resources/jenkins/monitor/os-release-alma-9
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
NAME="AlmaLinux"
VERSION="9.3 (Shamrock Pampas Cat)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.3"
PLATFORM_ID="platform:el9"
PRETTY_NAME="AlmaLinux 9.3 (Shamrock Pampas Cat)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.3"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.3"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.19.0
PRETTY_NAME="Alpine Linux v3.19"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
10 changes: 10 additions & 0 deletions core/src/test/resources/jenkins/monitor/os-release-amazon-linux-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
SUPPORT_END="2025-06-30"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
SUPPORT_END="2028-03-15"
13 changes: 13 additions & 0 deletions core/src/test/resources/jenkins/monitor/os-release-centos-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
9 changes: 9 additions & 0 deletions core/src/test/resources/jenkins/monitor/os-release-debian-11
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
9 changes: 9 additions & 0 deletions core/src/test/resources/jenkins/monitor/os-release-debian-12
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Loading

0 comments on commit 72eb26a

Please sign in to comment.