public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: ben.hutchings@codethink.co.uk (Ben Hutchings)
To: cip-dev@lists.cip-project.org
Subject: [cip-dev] [cip-kernel-sec] report_affected: report cip branches
Date: Thu, 20 Jun 2019 21:03:54 +0100	[thread overview]
Message-ID: <1561061034.21054.53.camel@codethink.co.uk> (raw)
In-Reply-To: <1561060306.21054.51.camel@codethink.co.uk>

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(match.group(1))
> > +????if 'cip' in branch_name:
> > +????????match = _CIP_BRANCH_RE.match(branch_name)
> > +????????return match and get_base_ver_cip_branch(match.group(1))
> > +????else:
> > +????????match = _STABLE_BRANCH_RE.match(branch_name)
> > +????????return match and get_base_ver_stable_branch(match.group(1))
> 
> [...]
> 
> Does this function actually need to know anything about specific branch
> names???It seems like we should be able to implement it as something
> like:
> 
> ????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 reported_affected.py, which can avoid
calling get_live_branches() multiple times.

Ben.

-- 
Ben Hutchings, Software Developer                ?        Codethink Ltd
https://www.codethink.co.uk/                 Dale House, 35 Dale Street
                                     Manchester, M1 2HF, United Kingdom

      reply	other threads:[~2019-06-20 20:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20  6:13 [cip-dev] [cip-kernel-sec] report_affected: report cip branches Daniel Sangorrin
2019-06-20 19:51 ` Ben Hutchings
2019-06-20 20:03   ` Ben Hutchings [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1561061034.21054.53.camel@codethink.co.uk \
    --to=ben.hutchings@codethink.co.uk \
    --cc=cip-dev@lists.cip-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox