Merge ~brad-figg/+git/kteam-tools:cranky-config-variable into ~canonical-kernel/+git/kteam-tools:master

Proposed by Brad Figg
Status: Needs review
Proposed branch: ~brad-figg/+git/kteam-tools:cranky-config-variable
Merge into: ~canonical-kernel/+git/kteam-tools:master
Diff against target: 81 lines (+14/-12)
3 files modified
cranky/crl/config.py (+9/-6)
ktl/tracking_bug2.py (+1/-2)
stable/create-kernel-tasks (+4/-4)
Reviewer Review Type Date Requested Status
Cory Todd (community) Needs Fixing
Brad Figg Pending
Review via email: mp+433810@code.launchpad.net

This proposal supersedes a proposal from 2022-11-24.

Description of the change

The commit message says it all.

To post a comment you must log in.
Revision history for this message
Cory Todd (corytodd) wrote :

Looks like this absorbed #433807 regarding the SRU board. Comments left inline for those proposed changes.

Other commentary inline.

review: Needs Fixing
Revision history for this message
Brad Figg (brad-figg) wrote :

I'll resubmit this MP. Yes, it looks like I combined it with another MP.

Revision history for this message
Cory Todd (corytodd) wrote :

Okay, I'll check back on the resubmit.

Side note on creating Launchpad merge proposals, I think this (and the other two) have you listed as a reviewer for some reason. This means that once we apply and push these patches, this UI won't show a "merged" status. You will need to either leave a comment with "Approve" selected from the review dropdown box or you could remove yourself from the reviewers list. Either option should work.

Revision history for this message
Brad Figg (brad-figg) wrote :

Another option would be to fix launchpad so that it helped with merge proposals instead of making the process cumbersome. The fact that I have to remove myself from review is silly, it shouldn’t put me there by default. It should also default to the repo from which the branch was created rather than make me add that information. It should also start defaulting to showing git repositories when I go to the “code” section of a project.

But, it is what it is and I’ll try to remember to remove myself as a reviewer.

Brad

From: <email address hidden> <email address hidden> on behalf of Cory Todd <email address hidden>
Date: Wednesday, December 14, 2022 at 6:47 AM
To: Brad Figg <email address hidden>
Subject: Re: [Merge] ~brad-figg/+git/kteam-tools:cranky-config-variable into ~canonical-kernel/+git/kteam-tools:master
External email: Use caution opening links or attachments

Okay, I'll check back on the resubmit.

Side note on creating Launchpad merge proposals, I think this (and the other two) have you listed as a reviewer for some reason. This means that once we apply and push these patches, this UI won't show a "merged" status. You will need to either leave a comment with "Approve" selected from the review dropdown box or you could remove yourself from the reviewers list. Either option should work.
--
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcode.launchpad.net%2F~brad-figg%2F%2Bgit%2Fkteam-tools%2F%2Bmerge%2F433810&amp;data=05%7C01%7Cbfigg%40nvidia.com%7C2d0035cccef5497ab36b08dadde22c2a%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638066260725442087%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=WE9UAAHLRrSavH6gvJjXJ9CR2EeDzIod1d1se10E7mg%3D&amp;reserved=0
You are the owner of ~brad-figg/+git/kteam-tools:cranky-config-variable.

Launchpad-Message-Rationale: Owner
Launchpad-Message-For: brad-figg
Launchpad-Notification-Type: code-review
Launchpad-Branch: ~brad-figg/+git/kteam-tools:cranky-config-variable

Revision history for this message
Jose Ogando Justo (joseogando) :

Unmerged commits

c7fc0b8... by Brad Figg

crl/config.py: allow an environment variable to specify the location of the cranky config file

Signed-off-by: Brad Figg <email address hidden>

3dec060... by Brad Figg

ktl/tracking_bug2.py: change warning to a more concise, but better to understand message

Signed-off-by: Brad Figg <email address hidden>

8d806fa... by Brad Figg

create-kernel-tasks: Made a couple of the error messages a little easier to understand.

Signed-off-by: Brad Figg <email address hidden>

e2af0b2... by Brad Figg

create-kernel-tasks: document what the variables 'cn' and 'sn' stand for

Signed-off-by: Brad Figg <email address hidden>

bc796a3... by Brad Figg

Create-kernel-tasks: if --nocards is specified then don't import the
SRUBoard class.

The SRUBoard class imports the jira module and not all users of
create-kernel-tasks has that module. If no jira cards are to be created
there is no need to import SRUBoard.

Signed-off-by: Brad Figg <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cranky/crl/config.py b/cranky/crl/config.py
2index c927f31..caea37b 100755
3--- a/cranky/crl/config.py
4+++ b/cranky/crl/config.py
5@@ -12,12 +12,15 @@ class Config:
6 if filename is not None and data is not None:
7 raise ValueError("supply only one of filename and data")
8
9- if data is None and filename is None:
10- for path in (os.path.join(os.environ['HOME'], '.cranky.yaml'),
11- os.path.join(os.environ['HOME'], '.cranky')):
12- if os.path.exists(path):
13- filename = path
14- break
15+ if 'CRANKY_CONFIG_FILE' in os.environ:
16+ filename = os.environ['CRANKY_CONFIG_FILE']
17+ else:
18+ if data is None and filename is None:
19+ for path in (os.path.join(os.environ['HOME'], '.cranky.yaml'),
20+ os.path.join(os.environ['HOME'], '.cranky')):
21+ if os.path.exists(path):
22+ filename = path
23+ break
24
25 if data is None and filename is not None and os.path.exists(filename):
26 with open(filename) as yfd:
27diff --git a/ktl/tracking_bug2.py b/ktl/tracking_bug2.py
28index 3dd00d2..9b92115 100755
29--- a/ktl/tracking_bug2.py
30+++ b/ktl/tracking_bug2.py
31@@ -192,8 +192,7 @@ class TrackingBug(object):
32 # the bug linking completely. So this would be "normal".
33 s._master_bug_id = p_master
34 elif s._master_bug_id != p_master:
35- cwarn('Mismatch between tag and properties: master bug')
36- cwarn('tag: %s / property: %s' % (s._master_bug_id, p_master))
37+ cwarn('Mismatch : master bug - tag: %s; property: %s (lp: #%s)' % (s._master_bug_id, p_master, bug.id))
38 s._master_bug_id = p_master
39 #prefix = 'kernel-sru-%s-of-' % s.__type
40 #s.__update_pfx_tag(prefix, '%s%s' % (prefix, p_master))
41diff --git a/stable/create-kernel-tasks b/stable/create-kernel-tasks
42index c62b6db..4085a96 100755
43--- a/stable/create-kernel-tasks
44+++ b/stable/create-kernel-tasks
45@@ -13,7 +13,6 @@ sys.path.append(os.path.realpath(
46 from ktl.log import Clog, cerror, cwarn, cinfo, cdebug
47 from ktl.kernel_series import KernelSeries
48 from ktl.tracking_bug2 import TrackingBugs, TrackingBugError
49-from ktl.sruboard import SRUBoard, SRUBoardError
50
51 class Task():
52 def __init__(self, taskset, ks_source, ks_snap=None):
53@@ -436,6 +435,7 @@ class TaskSet():
54 def CreateCards(self, boardname, dryrun=False, cve=False):
55 if dryrun is False and self.board is None:
56 try:
57+ from ktl.sruboard import SRUBoard, SRUBoardError
58 self.board = SRUBoard(self.cycletag, cve=cve)
59 except SRUBoardError as e:
60 cerror(e)
61@@ -540,17 +540,17 @@ Examples:
62 devel_set = False
63 for handle in args.handle:
64 try:
65- (cn, sn) = handle.split(':')
66+ (cn, sn) = handle.split(':') # cn = "series codename (focal, jammy, etc.)"; sn = "source name (linux, linux-realtime, linux-aws, etc)"
67 except:
68 cerror('Failed to parse handle({})'.format(handle))
69 sys.exit(2)
70 ks_series = ks.lookup_series(codename=cn)
71 if ks_series is None:
72- cerror('{} seems to be no valid series codename'.format(cn))
73+ cerror(f'"{cn}" is not a valid series codename. It was not found in kernel-series.info.')
74 sys.exit(3)
75 ks_source = ks_series.lookup_source(sn)
76 if ks_source is None:
77- cerror('{} is no valid source in {}'.format(sn, cn))
78+ cerror(f'"{sn} is not a valid source within the "{cn}" series.')
79 sys.exit(3)
80 # The first handle decides whether we treat this as devel cycle or stable.
81 # Instead of trying to figure out whether something originates in a development

Subscribers

People subscribed via source and target branches