Skip to content

Commit 19c1b24

Browse files
Properly deactivate packages list from major release pages (#319)
* Add changed unit tests to verify proper handling of GitHub releases * Bump version to `0.10.16` Signed-off-by: Tobias Wolf <wolf@b1-systems.de> On-behalf-of: SAP <tobias.wolf@sap.com>
1 parent 2352ee1 commit 19c1b24

File tree

3 files changed

+40
-10
lines changed

3 files changed

+40
-10
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Installs the given GardenLinux Python library
44
inputs:
55
version:
66
description: GardenLinux Python library version
7-
default: "0.10.15"
7+
default: "0.10.16"
88
python_version:
99
description: Python version to setup
1010
default: "3.13"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "gardenlinux"
3-
version = "0.10.15"
3+
version = "0.10.16"
44
description = "Contains tools to work with the features directory of gardenlinux, for example deducting dependencies from feature sets or validating cnames"
55
authors = ["Garden Linux Maintainers <contact@gardenlinux.io>"]
66
license = "Apache-2.0"

tests/github/test_create_github_release_notes.py

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,25 @@ def test_release_notes_changes_section_broken_glvd_response() -> None:
5959
def test_release_notes_compare_package_versions_section_legacy_versioning_is_recognized() -> (
6060
None
6161
):
62-
assert (
63-
"Full List of Packages in Garden Linux version 1.0"
64-
in release_notes_compare_package_versions_section("1.0", {})
65-
), "Legacy versioning is supported"
62+
with requests_mock.Mocker() as m:
63+
m.get(
64+
f"{GLVD_BASE_URL}/releaseNotes/1.0",
65+
json={
66+
"packageList": [
67+
{
68+
"sourcePackageName": "gardenlinux-release-example",
69+
"oldVersion": "0.9pre1",
70+
"newVersion": "1.0",
71+
"fixedCves": [],
72+
}
73+
]
74+
},
75+
status_code=200,
76+
)
77+
78+
assert "upgrade 'gardenlinux-release-example'" in release_notes_changes_section(
79+
"1.0"
80+
), "Legacy versioning is supported"
6681

6782

6883
def test_release_notes_compare_package_versions_section_legacy_versioning_patch_release_is_recognized(
@@ -87,10 +102,25 @@ def mock_compare_apt_repo_versions(
87102

88103

89104
def test_release_notes_compare_package_versions_section_semver_is_recognized() -> None:
90-
assert (
91-
"Full List of Packages in Garden Linux version 1.20.0"
92-
in release_notes_compare_package_versions_section("1.20.0", {})
93-
), "Semver is supported"
105+
with requests_mock.Mocker() as m:
106+
m.get(
107+
f"{GLVD_BASE_URL}/releaseNotes/1.20.0",
108+
json={
109+
"packageList": [
110+
{
111+
"sourcePackageName": "gardenlinux-release-example",
112+
"oldVersion": "1.19.0",
113+
"newVersion": "1.20.0",
114+
"fixedCves": [],
115+
}
116+
]
117+
},
118+
status_code=200,
119+
)
120+
121+
assert "upgrade 'gardenlinux-release-example'" in release_notes_changes_section(
122+
"1.20.0"
123+
), "Semver is supported"
94124

95125

96126
def test_release_notes_compare_package_versions_section_semver_patch_release_is_recognized(

0 commit comments

Comments
 (0)