Merge ~pfsmorigo/review-tools:pfsmorigo/core24 into review-tools:master

Proposed by Paulo Flabiano Smorigo
Status: Merged
Merged at revision: 16774166e20f9f5362dea3193f26dc35343663ed
Proposed branch: ~pfsmorigo/review-tools:pfsmorigo/core24
Merge into: review-tools:master
Diff against target: 141 lines (+43/-13)
6 files modified
reviewtools/overrides.py (+28/-1)
reviewtools/sr_lint.py (+2/-2)
reviewtools/store.py (+1/-0)
reviewtools/tests/test_store.py (+10/-0)
tests/manual-lzo-part2.sh (+1/-5)
tests/manual-lzo.sh (+1/-5)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Review via email: mp+446424@code.launchpad.net

Description of the change

Hello team, can you review this pull request? Some doubts I had while doing it:

r/overrides.py:1038:
func_base_state_files_snaps_overrides = {"core22": "20220421"}
Do I need to do a state files overrride for core24 too?

r/store.py:46:
I use "undefined" for snap_to_release. Is that ok?

r/t/test_store.py:2121:
There is this test and to add one for core24 I need the release name right?
test_check_get_ubuntu_release_from_manifest_os_release_neon_bionic_core22

To post a comment you must log in.
Revision history for this message
Alex Murray (alexmurray) wrote :

> r/overrides.py:1038:
> func_base_state_files_snaps_overrides = {"core22": "20220421"}
> Do I need to do a state files overrride for core24 too?
>

This state files override exists so that as soon as that date passes, we consider the contents of the snap to be stable and from that point onwards will run the stateful checks - since we don't know the exact release date of 24.04 this is a bit tricky, but perhaps set this as 20240430 for now since it should definitely be released not too long before that date.

> r/store.py:46:
> I use "undefined" for snap_to_release. Is that ok?
>

We know this will be NN - so how about nanimal for now (as this kind of nomenclature has been used before)?

> r/t/test_store.py:2121:
> There is this test and to add one for core24 I need the release name right?
> test_check_get_ubuntu_release_from_manifest_os_release_neon_bionic_core22

You could use nanimal again here if you want.

review: Needs Fixing
Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM - but could you please add code comments around the overrides timestamp and nanimal name bits so we don't forget to update these in the future - something like:

// TODO: update when 24.04 is announced / released

review: Needs Fixing
Revision history for this message
Paulo Flabiano Smorigo (pfsmorigo) wrote :

Add the comments and ran the review over the snap locally: `core24.snap: pass`.

Revision history for this message
Alex Murray (alexmurray) wrote :

Thanks @pfsmorigo - LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reviewtools/overrides.py b/reviewtools/overrides.py
2index 2b1bcba..708f662 100644
3--- a/reviewtools/overrides.py
4+++ b/reviewtools/overrides.py
5@@ -132,6 +132,7 @@ redflagged_snap_types_overrides = {
6 "core20",
7 "core22",
8 "core22-desktop",
9+ "core24",
10 "core24-desktop",
11 "test-snapd-base",
12 "test-snapd-core18",
13@@ -367,6 +368,26 @@ sec_mode_overrides = {
14 "./usr/sbin/unix_chkpwd": "rwxr-sr-x",
15 "./var/mail": "rwxrwsr-x",
16 },
17+ "core24": {
18+ "./usr/bin/chage": "rwxr-sr-x",
19+ "./usr/bin/chfn": "rwsr-xr-x",
20+ "./usr/bin/chsh": "rwsr-xr-x",
21+ "./usr/bin/expiry": "rwxr-sr-x",
22+ "./usr/bin/gpasswd": "rwsr-xr-x",
23+ "./usr/bin/mount": "rwsr-xr-x",
24+ "./usr/bin/newgrp": "rwsr-xr-x",
25+ "./usr/bin/passwd": "rwsr-xr-x",
26+ "./usr/bin/ssh-agent": "rwxr-sr-x",
27+ "./usr/bin/su": "rwsr-xr-x",
28+ "./usr/bin/sudo": "rwsr-xr-x",
29+ "./usr/bin/umount": "rwsr-xr-x",
30+ "./usr/bin/wall": "rwxr-sr-x",
31+ "./usr/lib/dbus-1.0/dbus-daemon-launch-helper": "rwsr-xr--",
32+ "./usr/lib/openssh/ssh-keysign": "rwsr-xr-x",
33+ "./usr/sbin/pam_extrausers_chkpwd": "rwxr-sr-x",
34+ "./usr/sbin/unix_chkpwd": "rwxr-sr-x",
35+ "./var/mail": "rwxrwsr-x",
36+ },
37 "core24-desktop": {
38 "./usr/bin/chage": "rwxr-sr-x",
39 "./usr/bin/chfn": "rwsr-xr-x",
40@@ -672,6 +693,12 @@ sec_mode_dev_overrides = {
41 "./dev/urandom": ("crw-rw-rw-", "0/0"),
42 "./dev/zero": ("crw-rw-rw-", "0/0"),
43 },
44+ "core24": {
45+ "./dev/null": ("crw-rw-rw-", "0/0"),
46+ "./dev/random": ("crw-rw-rw-", "0/0"),
47+ "./dev/urandom": ("crw-rw-rw-", "0/0"),
48+ "./dev/zero": ("crw-rw-rw-", "0/0"),
49+ },
50 "core24-desktop": {
51 "./dev/null": ("crw-rw-rw-", "0/0"),
52 "./dev/random": ("crw-rw-rw-", "0/0"),
53@@ -1008,7 +1035,7 @@ func_base_state_files_overrides = {
54 }
55
56 # Allow skipping checks for some snaps
57-func_base_state_files_snaps_overrides = {"core22": "20220421"}
58+func_base_state_files_snaps_overrides = {"core24": "20240430"}
59
60 # By default we don't regulate which snaps specify which base snaps, but some
61 # base snaps are highly specialized, so we limit what can use them. Base snaps
62diff --git a/reviewtools/sr_lint.py b/reviewtools/sr_lint.py
63index dd1d3b7..a950329 100644
64--- a/reviewtools/sr_lint.py
65+++ b/reviewtools/sr_lint.py
66@@ -66,8 +66,8 @@ class SnapReviewLint(SnapReview):
67 "core18",
68 "core20",
69 "core22",
70- "core22-desktop",
71- "godot-bare",
72+ "core24",
73+ "test-snapd-refresh-control-base",
74 "keepstock-base-scot",
75 "nix-base",
76 "test-snapd-base-bare",
77diff --git a/reviewtools/store.py b/reviewtools/store.py
78index 43e6b8c..e84cd00 100644
79--- a/reviewtools/store.py
80+++ b/reviewtools/store.py
81@@ -44,6 +44,7 @@ snap_to_release = {
82 "core18": "bionic",
83 "core20": "focal",
84 "core22": "jammy",
85+ "core24": "nanimal", # TODO: update when 24.04 is announced / released
86 }
87
88
89diff --git a/reviewtools/tests/test_store.py b/reviewtools/tests/test_store.py
90index 23d1c1b..cf7a129 100644
91--- a/reviewtools/tests/test_store.py
92+++ b/reviewtools/tests/test_store.py
93@@ -2127,6 +2127,16 @@ class TestStore(TestCase):
94 res = store.get_ubuntu_release_from_manifest(m)
95 self.assertEqual(res, "jammy")
96
97+ # TODO: update when 24.04 is announced / released
98+ def test_check_get_ubuntu_release_from_manifest_os_release_neon_bionic_core24(self):
99+ """Test get_ubuntu_release_from_manifest() - neon/18.04 with base: core24"""
100+ m = copy.deepcopy(self.manifest_basic)
101+ m["base"] = "core24"
102+ m["snapcraft-os-release-id"] = "neon"
103+ m["snapcraft-os-release-version-id"] = "18.04"
104+ res = store.get_ubuntu_release_from_manifest(m)
105+ self.assertEqual(res, "nanimal")
106+
107 def test_check_get_ubuntu_release_from_manifest_os_release_nonexist_os_and_ver(
108 self,
109 ):
110diff --git a/tests/manual-lzo-part2.sh b/tests/manual-lzo-part2.sh
111index 6fa085a..826a4e0 100755
112--- a/tests/manual-lzo-part2.sh
113+++ b/tests/manual-lzo-part2.sh
114@@ -35,11 +35,7 @@ TARBALL=$(readlink -f "$1")
115
116 # TODO: share common snippets of this script with manual-lzo.sh ?
117 function is_core_snap {
118- if [ "$1" = "core" ] || [ "$1" = "core18" ] || [ "$1" = "core20" ] || [ "$1" = "core22" ]; then
119- return 0
120- else
121- return 1
122- fi
123+ [[ $1 =~ ^core[0-9]*$ ]] && return 0 || return 1
124 }
125
126 # step 0. ensure pre-reqs are available
127diff --git a/tests/manual-lzo.sh b/tests/manual-lzo.sh
128index 1e7e620..60b2885 100755
129--- a/tests/manual-lzo.sh
130+++ b/tests/manual-lzo.sh
131@@ -96,11 +96,7 @@ function is_core_or_snapd_snap {
132 }
133
134 function is_core_snap {
135- if [ "$1" = "core" ] || [ "$1" = "core18" ] || [ "$1" = "core20" ] || [ "$1" = "core22" ]; then
136- return 0
137- else
138- return 1
139- fi
140+ [[ $1 =~ ^core[0-9]*$ ]] && return 0 || return 1
141 }
142
143

Subscribers

People subscribed via source and target branches