From 7aa1803b296d7bbb2d7293bb517ed6eba3f3c749 Mon Sep 17 00:00:00 2001 From: MaineK00n Date: Fri, 1 Nov 2024 06:07:30 +0900 Subject: [PATCH] feat(fetcher/ubuntu): add 24.10 and drop unavailable releases (#422) --- .github/workflows/fetch.yml | 2 +- GNUmakefile | 12 ++++++------ config/config.go | 3 +++ fetcher/ubuntu/ubuntu.go | 22 ++++------------------ integration/diff_server_mode.py | 2 +- 5 files changed, 15 insertions(+), 26 deletions(-) diff --git a/.github/workflows/fetch.yml b/.github/workflows/fetch.yml index 9adb09b1..7239f3e3 100644 --- a/.github/workflows/fetch.yml +++ b/.github/workflows/fetch.yml @@ -106,7 +106,7 @@ jobs: --health-timeout 5s --health-retries 5 env: - Version: 14.04 16.04 18.04 20.04 21.04 21.10 22.04 22.10 23.04 23.10 24.04 + Version: 14.04 16.04 18.04 20.04 22.04 24.04 24.10 steps: - name: Check out code into the Go module directory uses: actions/checkout@v3 diff --git a/GNUmakefile b/GNUmakefile index 15f202a5..8f55fd88 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -91,7 +91,7 @@ clean-integration: fetch-rdb: integration/goval-dict.old fetch debian --dbpath=$(PWD)/integration/oval.old.sqlite3 7 8 9 10 11 12 - integration/goval-dict.old fetch ubuntu --dbpath=$(PWD)/integration/oval.old.sqlite3 14.04 16.04 18.04 20.04 21.04 21.10 22.04 22.10 23.04 23.10 24.04 + integration/goval-dict.old fetch ubuntu --dbpath=$(PWD)/integration/oval.old.sqlite3 14.04 16.04 18.04 20.04 22.04 24.04 24.10 integration/goval-dict.old fetch redhat --dbpath=$(PWD)/integration/oval.old.sqlite3 5 6 7 8 9 integration/goval-dict.old fetch oracle --dbpath=$(PWD)/integration/oval.old.sqlite3 5 6 7 8 9 integration/goval-dict.old fetch amazon --dbpath=$(PWD)/integration/oval.old.sqlite3 1 2 2022 2023 @@ -103,7 +103,7 @@ fetch-rdb: integration/goval-dict.old fetch fedora --dbpath=$(PWD)/integration/oval.old.sqlite3 32 33 34 35 36 37 38 39 40 integration/goval-dict.new fetch debian --dbpath=$(PWD)/integration/oval.new.sqlite3 7 8 9 10 11 12 - integration/goval-dict.new fetch ubuntu --dbpath=$(PWD)/integration/oval.new.sqlite3 14.04 16.04 18.04 20.04 21.04 21.10 22.04 22.10 23.04 23.10 24.04 + integration/goval-dict.new fetch ubuntu --dbpath=$(PWD)/integration/oval.new.sqlite3 14.04 16.04 18.04 20.04 22.04 24.04 24.10 integration/goval-dict.new fetch redhat --dbpath=$(PWD)/integration/oval.new.sqlite3 5 6 7 8 9 integration/goval-dict.new fetch oracle --dbpath=$(PWD)/integration/oval.new.sqlite3 5 6 7 8 9 integration/goval-dict.new fetch amazon --dbpath=$(PWD)/integration/oval.new.sqlite3 1 2 2022 2023 @@ -119,7 +119,7 @@ fetch-redis: docker run --name redis-new -d -p 127.0.0.1:6380:6379 redis integration/goval-dict.old fetch debian --dbtype redis --dbpath "redis://127.0.0.1:6379/0" 7 8 9 10 11 12 - integration/goval-dict.old fetch ubuntu --dbtype redis --dbpath "redis://127.0.0.1:6379/0" 14.04 16.04 18.04 20.04 21.04 21.10 22.04 22.10 23.04 23.10 24.04 + integration/goval-dict.old fetch ubuntu --dbtype redis --dbpath "redis://127.0.0.1:6379/0" 14.04 16.04 18.04 20.04 22.04 24.04 24.10 integration/goval-dict.old fetch redhat --dbtype redis --dbpath "redis://127.0.0.1:6379/0" 5 6 7 8 9 integration/goval-dict.old fetch oracle --dbtype redis --dbpath "redis://127.0.0.1:6379/0" 5 6 7 8 9 integration/goval-dict.old fetch amazon --dbtype redis --dbpath "redis://127.0.0.1:6379/0" 1 2 2022 2023 @@ -131,7 +131,7 @@ fetch-redis: integration/goval-dict.old fetch fedora --dbtype redis --dbpath "redis://127.0.0.1:6379/0" 32 33 34 35 36 37 38 39 40 integration/goval-dict.new fetch debian --dbtype redis --dbpath "redis://127.0.0.1:6380/0" 7 8 9 10 11 12 - integration/goval-dict.new fetch ubuntu --dbtype redis --dbpath "redis://127.0.0.1:6380/0" 14.04 16.04 18.04 20.04 21.04 21.10 22.04 22.10 23.04 23.10 24.04 + integration/goval-dict.new fetch ubuntu --dbtype redis --dbpath "redis://127.0.0.1:6380/0" 14.04 16.04 18.04 20.04 22.04 24.04 24.10 integration/goval-dict.new fetch redhat --dbtype redis --dbpath "redis://127.0.0.1:6380/0" 5 6 7 8 9 integration/goval-dict.new fetch oracle --dbtype redis --dbpath "redis://127.0.0.1:6380/0" 5 6 7 8 9 integration/goval-dict.new fetch amazon --dbtype redis --dbpath "redis://127.0.0.1:6380/0" 1 2 2022 2023 @@ -144,7 +144,7 @@ fetch-redis: diff-cveid: @ python integration/diff_server_mode.py --sample-rate 0.01 cveid debian 7 8 9 10 11 12 - @ python integration/diff_server_mode.py --sample-rate 0.01 cveid ubuntu 14.04 16.04 18.04 20.04 21.04 21.10 22.04 22.10 23.04 23.10 24.04 + @ python integration/diff_server_mode.py --sample-rate 0.01 cveid ubuntu 14.04 16.04 18.04 20.04 22.04 24.04 24.10 @ python integration/diff_server_mode.py --sample-rate 0.01 cveid redhat 5 6 7 8 9 @ python integration/diff_server_mode.py --sample-rate 0.01 cveid oracle 5 6 7 8 9 @ python integration/diff_server_mode.py --sample-rate 0.01 --arch x86_64 cveid oracle 5 6 7 8 9 @@ -161,7 +161,7 @@ diff-cveid: diff-package: @ python integration/diff_server_mode.py --sample-rate 0.01 package debian 7 8 9 10 11 12 - @ python integration/diff_server_mode.py --sample-rate 0.01 package ubuntu 14.04 16.04 18.04 20.04 21.04 21.10 22.04 22.10 23.04 23.10 24.04 + @ python integration/diff_server_mode.py --sample-rate 0.01 package ubuntu 14.04 16.04 18.04 20.04 22.04 24.04 24.10 @ python integration/diff_server_mode.py --sample-rate 0.01 package redhat 5 6 7 8 9 @ python integration/diff_server_mode.py --sample-rate 0.01 package oracle 5 6 7 8 9 @ python integration/diff_server_mode.py --sample-rate 0.01 --arch x86_64 package oracle 5 6 7 8 9 diff --git a/config/config.go b/config/config.go index 78c6577c..fbd45431 100644 --- a/config/config.go +++ b/config/config.go @@ -55,6 +55,9 @@ const ( // Ubuntu2404 is Noble Numbat Ubuntu2404 = "noble" + // Ubuntu2410 is ⁠Oracular Oriole + Ubuntu2410 = "oracular" + // Debian7 is wheezy Debian7 = "wheezy" diff --git a/fetcher/ubuntu/ubuntu.go b/fetcher/ubuntu/ubuntu.go index 3547c7b8..1d3d79e8 100644 --- a/fetcher/ubuntu/ubuntu.go +++ b/fetcher/ubuntu/ubuntu.go @@ -81,38 +81,24 @@ func getOVALURL(version string) string { return "unknown" } case "21": - switch minor { - case "04": - return fmt.Sprintf(main, config.Ubuntu2104) - case "10": - return fmt.Sprintf(main, config.Ubuntu2110) - default: - return "unknown" - } + return "unsupported" case "22": switch minor { case "04": return fmt.Sprintf(main, config.Ubuntu2204) case "10": - return fmt.Sprintf(main, config.Ubuntu2210) + return "unsupported" default: return "unknown" } case "23": - switch minor { - case "04": - return fmt.Sprintf(main, config.Ubuntu2304) - case "10": - return fmt.Sprintf(main, config.Ubuntu2310) - default: - return "unknown" - } + return "unsupported" case "24": switch minor { case "04": return fmt.Sprintf(main, config.Ubuntu2404) case "10": - return "unsupported" + return fmt.Sprintf(main, config.Ubuntu2410) default: return "unknown" } diff --git a/integration/diff_server_mode.py b/integration/diff_server_mode.py index a14bcc40..296a1719 100644 --- a/integration/diff_server_mode.py +++ b/integration/diff_server_mode.py @@ -126,7 +126,7 @@ def diff_response(args: Tuple[str, str, str, str, str]): f'Failed to diff_response..., err: This Release Version({args.release}) does not support test mode') raise NotImplementedError elif args.ostype == 'ubuntu': - if len(list(set(args.release) - set(['14.04', '16.04', '18.04', '19.10', '20.04', '20.10', '21.04', '21.10', '22.04', '22.10', '23.04', '23.10', '24.04']))) > 0: + if len(list(set(args.release) - set(['14.04', '16.04', '18.04', '20.04', '22.04', '24.04', '24.10']))) > 0: logger.error( f'Failed to diff_response..., err: This Release Version({args.release}) does not support test mode') raise NotImplementedError