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

Proposed by Paulo Flabiano Smorigo
Status: Merged
Merged at revision: 8a9f1a14df1874d07ab94c325ef7e2b677204432
Proposed branch: ~pfsmorigo/review-tools:pfsmorigo/add_microk8s_username
Merge into: review-tools:master
Diff against target: 83 lines (+11/-11)
3 files modified
reviewtools/overrides.py (+1/-1)
reviewtools/sr_common.py (+1/-1)
reviewtools/tests/test_sr_lint.py (+9/-9)
Reviewer Review Type Date Requested Status
Ian Johnson (community) Approve
Alex Murray Approve
Review via email: mp+405358@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM, thanks @pfsmorigo.

review: Approve
Revision history for this message
Ian Johnson (anonymouse67) wrote :

This LGTM

Revision history for this message
Ian Johnson (anonymouse67) wrote :

(forgot to change the review type to approve)

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 7427c90..5463685 100644
--- a/reviewtools/overrides.py
+++ b/reviewtools/overrides.py
@@ -922,7 +922,7 @@ lint_redflagged_base_dep_override = {
922# For a given snapd_<username>, list the snaps that are allowed to922# For a given snapd_<username>, list the snaps that are allowed to
923# specify it. Note, as a special case, 'snap_daemon' may be used923# specify it. Note, as a special case, 'snap_daemon' may be used
924# by any snap and is not tracked here.924# by any snap and is not tracked here.
925lint_system_usernames_override = {"snap_docker": ["docker"]}925lint_system_usernames_override = {"snap_microk8s": ["microk8s"]}
926926
927# Some publisher_emails represent a shared account. For snaps with a shared927# Some publisher_emails represent a shared account. For snaps with a shared
928# email, also send to other addresses.928# email, also send to other addresses.
diff --git a/reviewtools/sr_common.py b/reviewtools/sr_common.py
index 58941ac..8d3685d 100644
--- a/reviewtools/sr_common.py
+++ b/reviewtools/sr_common.py
@@ -189,7 +189,7 @@ class SnapReview(Review):
189 # IMPORTANT: anything listed here is assumed to be usable by all189 # IMPORTANT: anything listed here is assumed to be usable by all
190 # snaps. If use of the username should be limited to specific190 # snaps. If use of the username should be limited to specific
191 # snaps, also adjust overrides.py:lint_system_usernames_override.191 # snaps, also adjust overrides.py:lint_system_usernames_override.
192 valid_system_usernames = ["snap_daemon", "snap_docker"]192 valid_system_usernames = ["snap_daemon", "snap_microk8s"]
193193
194 valid_compiled_architectures = [194 valid_compiled_architectures = [
195 "amd64",195 "amd64",
diff --git a/reviewtools/tests/test_sr_lint.py b/reviewtools/tests/test_sr_lint.py
index 8e303a4..abd970f 100644
--- a/reviewtools/tests/test_sr_lint.py
+++ b/reviewtools/tests/test_sr_lint.py
@@ -5850,9 +5850,9 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
5850 }5850 }
5851 self.check_results(r, expected=expected)5851 self.check_results(r, expected=expected)
58525852
5853 def test_check_system_usernames_unsupported_snap_docker_user_for_generic_snap(self):5853 def test_check_system_usernames_unsupported_snap_microk8s_user_for_generic_snap(self):
5854 """Test check_system_usernames - unsupported user"""5854 """Test check_system_usernames - unsupported user"""
5855 d = {"snap_docker": "shared"}5855 d = {"snap_microk8s": "shared"}
5856 self.set_test_snap_yaml("system-usernames", d)5856 self.set_test_snap_yaml("system-usernames", d)
5857 c = SnapReviewLint(self.test_name)5857 c = SnapReviewLint(self.test_name)
5858 c.check_system_usernames()5858 c.check_system_usernames()
@@ -5861,8 +5861,8 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
5861 self.check_results(r, expected_counts)5861 self.check_results(r, expected_counts)
5862 expected = {5862 expected = {
5863 "error": {5863 "error": {
5864 "lint-snap-v2:system-usernames:snap_docker": {5864 "lint-snap-v2:system-usernames:snap_microk8s": {
5865 "text": "unsupported system-username: snap_docker for snap foo"5865 "text": "unsupported system-username: snap_microk8s for snap foo"
5866 }5866 }
5867 },5867 },
5868 "warn": {},5868 "warn": {},
@@ -5874,15 +5874,15 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
5874 """Test check_system_usernames overrides"""5874 """Test check_system_usernames overrides"""
5875 from reviewtools.overrides import lint_system_usernames_override5875 from reviewtools.overrides import lint_system_usernames_override
58765876
5877 lint_system_usernames_override["snap_docker"].append("foo")5877 lint_system_usernames_override["snap_microk8s"].append("foo")
58785878
5879 self.set_test_snap_yaml("name", "foo")5879 self.set_test_snap_yaml("name", "foo")
5880 self.set_test_snap_yaml("system-usernames", {"snap_docker": "shared"})5880 self.set_test_snap_yaml("system-usernames", {"snap_microk8s": "shared"})
5881 c = SnapReviewLint(self.test_name)5881 c = SnapReviewLint(self.test_name)
5882 c.check_system_usernames()5882 c.check_system_usernames()
58835883
5884 # then cleanup the overrides5884 # then cleanup the overrides
5885 lint_system_usernames_override["snap_docker"].remove("foo")5885 lint_system_usernames_override["snap_microk8s"].remove("foo")
58865886
5887 r = c.review_report5887 r = c.review_report
5888 expected_counts = {"info": 2, "warn": 0, "error": 0}5888 expected_counts = {"info": 2, "warn": 0, "error": 0}
@@ -5893,8 +5893,8 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
5893 "warn": {},5893 "warn": {},
5894 "info": {5894 "info": {
5895 "lint-snap-v2:system-usernames_valid": {"text": "OK"},5895 "lint-snap-v2:system-usernames_valid": {"text": "OK"},
5896 "lint-snap-v2:system-usernames:snap_docker": {5896 "lint-snap-v2:system-usernames:snap_microk8s": {
5897 "text": "OK (override snap_docker for snap: foo)"5897 "text": "OK (override snap_microk8s for snap: foo)"
5898 },5898 },
5899 },5899 },
5900 }5900 }

Subscribers

People subscribed via source and target branches