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
diff --git a/reviewtools/overrides.py b/reviewtools/overrides.py
index 2b1bcba..708f662 100644
--- a/reviewtools/overrides.py
+++ b/reviewtools/overrides.py
@@ -132,6 +132,7 @@ redflagged_snap_types_overrides = {
132 "core20",132 "core20",
133 "core22",133 "core22",
134 "core22-desktop",134 "core22-desktop",
135 "core24",
135 "core24-desktop",136 "core24-desktop",
136 "test-snapd-base",137 "test-snapd-base",
137 "test-snapd-core18",138 "test-snapd-core18",
@@ -367,6 +368,26 @@ sec_mode_overrides = {
367 "./usr/sbin/unix_chkpwd": "rwxr-sr-x",368 "./usr/sbin/unix_chkpwd": "rwxr-sr-x",
368 "./var/mail": "rwxrwsr-x",369 "./var/mail": "rwxrwsr-x",
369 },370 },
371 "core24": {
372 "./usr/bin/chage": "rwxr-sr-x",
373 "./usr/bin/chfn": "rwsr-xr-x",
374 "./usr/bin/chsh": "rwsr-xr-x",
375 "./usr/bin/expiry": "rwxr-sr-x",
376 "./usr/bin/gpasswd": "rwsr-xr-x",
377 "./usr/bin/mount": "rwsr-xr-x",
378 "./usr/bin/newgrp": "rwsr-xr-x",
379 "./usr/bin/passwd": "rwsr-xr-x",
380 "./usr/bin/ssh-agent": "rwxr-sr-x",
381 "./usr/bin/su": "rwsr-xr-x",
382 "./usr/bin/sudo": "rwsr-xr-x",
383 "./usr/bin/umount": "rwsr-xr-x",
384 "./usr/bin/wall": "rwxr-sr-x",
385 "./usr/lib/dbus-1.0/dbus-daemon-launch-helper": "rwsr-xr--",
386 "./usr/lib/openssh/ssh-keysign": "rwsr-xr-x",
387 "./usr/sbin/pam_extrausers_chkpwd": "rwxr-sr-x",
388 "./usr/sbin/unix_chkpwd": "rwxr-sr-x",
389 "./var/mail": "rwxrwsr-x",
390 },
370 "core24-desktop": {391 "core24-desktop": {
371 "./usr/bin/chage": "rwxr-sr-x",392 "./usr/bin/chage": "rwxr-sr-x",
372 "./usr/bin/chfn": "rwsr-xr-x",393 "./usr/bin/chfn": "rwsr-xr-x",
@@ -672,6 +693,12 @@ sec_mode_dev_overrides = {
672 "./dev/urandom": ("crw-rw-rw-", "0/0"),693 "./dev/urandom": ("crw-rw-rw-", "0/0"),
673 "./dev/zero": ("crw-rw-rw-", "0/0"),694 "./dev/zero": ("crw-rw-rw-", "0/0"),
674 },695 },
696 "core24": {
697 "./dev/null": ("crw-rw-rw-", "0/0"),
698 "./dev/random": ("crw-rw-rw-", "0/0"),
699 "./dev/urandom": ("crw-rw-rw-", "0/0"),
700 "./dev/zero": ("crw-rw-rw-", "0/0"),
701 },
675 "core24-desktop": {702 "core24-desktop": {
676 "./dev/null": ("crw-rw-rw-", "0/0"),703 "./dev/null": ("crw-rw-rw-", "0/0"),
677 "./dev/random": ("crw-rw-rw-", "0/0"),704 "./dev/random": ("crw-rw-rw-", "0/0"),
@@ -1008,7 +1035,7 @@ func_base_state_files_overrides = {
1008}1035}
10091036
1010# Allow skipping checks for some snaps1037# Allow skipping checks for some snaps
1011func_base_state_files_snaps_overrides = {"core22": "20220421"}1038func_base_state_files_snaps_overrides = {"core24": "20240430"}
10121039
1013# By default we don't regulate which snaps specify which base snaps, but some1040# By default we don't regulate which snaps specify which base snaps, but some
1014# base snaps are highly specialized, so we limit what can use them. Base snaps1041# base snaps are highly specialized, so we limit what can use them. Base snaps
diff --git a/reviewtools/sr_lint.py b/reviewtools/sr_lint.py
index dd1d3b7..a950329 100644
--- a/reviewtools/sr_lint.py
+++ b/reviewtools/sr_lint.py
@@ -66,8 +66,8 @@ class SnapReviewLint(SnapReview):
66 "core18",66 "core18",
67 "core20",67 "core20",
68 "core22",68 "core22",
69 "core22-desktop",69 "core24",
70 "godot-bare",70 "test-snapd-refresh-control-base",
71 "keepstock-base-scot",71 "keepstock-base-scot",
72 "nix-base",72 "nix-base",
73 "test-snapd-base-bare",73 "test-snapd-base-bare",
diff --git a/reviewtools/store.py b/reviewtools/store.py
index 43e6b8c..e84cd00 100644
--- a/reviewtools/store.py
+++ b/reviewtools/store.py
@@ -44,6 +44,7 @@ snap_to_release = {
44 "core18": "bionic",44 "core18": "bionic",
45 "core20": "focal",45 "core20": "focal",
46 "core22": "jammy",46 "core22": "jammy",
47 "core24": "nanimal", # TODO: update when 24.04 is announced / released
47}48}
4849
4950
diff --git a/reviewtools/tests/test_store.py b/reviewtools/tests/test_store.py
index 23d1c1b..cf7a129 100644
--- a/reviewtools/tests/test_store.py
+++ b/reviewtools/tests/test_store.py
@@ -2127,6 +2127,16 @@ class TestStore(TestCase):
2127 res = store.get_ubuntu_release_from_manifest(m)2127 res = store.get_ubuntu_release_from_manifest(m)
2128 self.assertEqual(res, "jammy")2128 self.assertEqual(res, "jammy")
21292129
2130 # TODO: update when 24.04 is announced / released
2131 def test_check_get_ubuntu_release_from_manifest_os_release_neon_bionic_core24(self):
2132 """Test get_ubuntu_release_from_manifest() - neon/18.04 with base: core24"""
2133 m = copy.deepcopy(self.manifest_basic)
2134 m["base"] = "core24"
2135 m["snapcraft-os-release-id"] = "neon"
2136 m["snapcraft-os-release-version-id"] = "18.04"
2137 res = store.get_ubuntu_release_from_manifest(m)
2138 self.assertEqual(res, "nanimal")
2139
2130 def test_check_get_ubuntu_release_from_manifest_os_release_nonexist_os_and_ver(2140 def test_check_get_ubuntu_release_from_manifest_os_release_nonexist_os_and_ver(
2131 self,2141 self,
2132 ):2142 ):
diff --git a/tests/manual-lzo-part2.sh b/tests/manual-lzo-part2.sh
index 6fa085a..826a4e0 100755
--- a/tests/manual-lzo-part2.sh
+++ b/tests/manual-lzo-part2.sh
@@ -35,11 +35,7 @@ TARBALL=$(readlink -f "$1")
3535
36# TODO: share common snippets of this script with manual-lzo.sh ?36# TODO: share common snippets of this script with manual-lzo.sh ?
37function is_core_snap {37function is_core_snap {
38 if [ "$1" = "core" ] || [ "$1" = "core18" ] || [ "$1" = "core20" ] || [ "$1" = "core22" ]; then38 [[ $1 =~ ^core[0-9]*$ ]] && return 0 || return 1
39 return 0
40 else
41 return 1
42 fi
43}39}
4440
45# step 0. ensure pre-reqs are available41# step 0. ensure pre-reqs are available
diff --git a/tests/manual-lzo.sh b/tests/manual-lzo.sh
index 1e7e620..60b2885 100755
--- a/tests/manual-lzo.sh
+++ b/tests/manual-lzo.sh
@@ -96,11 +96,7 @@ function is_core_or_snapd_snap {
96}96}
9797
98function is_core_snap {98function is_core_snap {
99 if [ "$1" = "core" ] || [ "$1" = "core18" ] || [ "$1" = "core20" ] || [ "$1" = "core22" ]; then99 [[ $1 =~ ^core[0-9]*$ ]] && return 0 || return 1
100 return 0
101 else
102 return 1
103 fi
104}100}
105101
106102

Subscribers

People subscribed via source and target branches