Re: [cip-kernel-sec] report_affected: report cip branches

Ben Hutchings <ben.hutchings@...>

On Thu, 2019-06-20 at 20:51 +0100, Ben Hutchings wrote:
On Thu, 2019-06-20 at 15:13 +0900, Daniel Sangorrin wrote:
Allow reporting on cip branches, instead of returning an
error like this one:
 def get_stable_branch(branch_name):
-    match = _STABLE_BRANCH_RE.match(branch_name)
-    return match and get_base_ver_stable_branch(
+    if 'cip' in branch_name:
+        match = _CIP_BRANCH_RE.match(branch_name)
+        return match and get_base_ver_cip_branch(
+    else:
+        match = _STABLE_BRANCH_RE.match(branch_name)
+        return match and get_base_ver_stable_branch(

Does this function actually need to know anything about specific branch
names?  It seems like we should be able to implement it as something

    for branch in get_live_branches():
        if branch['short_name'] == branch_name:
            return branch
    return None
In fact it would probably make more sense to get rid of this function
altogether and put that code in, which can avoid
calling get_live_branches() multiple times.


Ben Hutchings, Software Developer   Codethink Ltd Dale House, 35 Dale Street
Manchester, M1 2HF, United Kingdom

Join { to automatically receive all group messages.