Merge ~jslarraz/review-tools:allow-gadget into review-tools:master

Proposed by Jorge Sancho Larraz
Status: Merged
Merged at revision: b100807a57640db8fb1db53b86818dcd78a1de96
Proposed branch: ~jslarraz/review-tools:allow-gadget
Merge into: review-tools:master
Diff against target: 42 lines (+13/-0)
2 files modified
bin/snap-review (+5/-0)
reviewtools/sr_lint.py (+8/-0)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Review via email: mp+466884@code.launchpad.net

Commit message

Adds the --allow-gadget parameter to snap-review as a quick way to bypass the check_type_redflagged for gadget snaps

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

LGTM as a temporary work-around. Thanks @jslarraz.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/snap-review b/bin/snap-review
2index 299473e..8199929 100755
3--- a/bin/snap-review
4+++ b/bin/snap-review
5@@ -63,6 +63,9 @@ def main():
6 parser.add_argument(
7 "--allow-classic", help="allow confinement: classic", action="store_true"
8 )
9+ parser.add_argument(
10+ "--allow-gadget", help="don't flag gadget snaps", action="store_true"
11+ )
12 parser.add_argument("--on-store", default=None, help="store id for the snap")
13 parser.add_argument("--on-brand", default=None, help="brand id for the snap")
14 parser.add_argument("--state-input", default=None, help="store state input blob")
15@@ -100,6 +103,8 @@ def main():
16 error("Failed to read slots: %s" % e, output_type=error_output_type)
17 if args.allow_classic:
18 overrides["snap_allow_classic"] = args.allow_classic
19+ if args.allow_gadget:
20+ overrides["snap_allow_gadget"] = args.allow_gadget
21 if args.on_store:
22 overrides["snap_on_store"] = args.on_store
23 if args.on_brand:
24diff --git a/reviewtools/sr_lint.py b/reviewtools/sr_lint.py
25index f5bc8ae..2da0ae1 100644
26--- a/reviewtools/sr_lint.py
27+++ b/reviewtools/sr_lint.py
28@@ -103,6 +103,14 @@ class SnapReviewLint(SnapReview):
29 and pkgname in redflagged_snap_types_overrides[snaptype]
30 ):
31 s = "OK (override '%s' for 'type: %s')" % (pkgname, snaptype)
32+ # TODO: temporal work around to enable --allow-gadget in snap-review
33+ elif (
34+ snaptype == "gadget"
35+ and self.overrides is not None
36+ and "snap_allow_gadget" in self.overrides
37+ and self.overrides["snap_allow_gadget"]
38+ ):
39+ s = "OK (override '%s' for 'type: %s')" % (pkgname, snaptype)
40 else:
41 t = "error"
42 s = "(NEEDS REVIEW) type '%s' not allowed" % self.snap_yaml["type"]

Subscribers

People subscribed via source and target branches