Bug References
JDP.BugRefs.Ref
JDP.BugRefs.extract_tags!
JDP.BugRefsParser.AbstractToken
JDP.BugRefsParser.parse_comment
JDP.BugRefsParser.tokval
BugRefs
JDP.BugRefs
— Module.Bug references are usually a three letter abreviation (TLA) for a tracker instance (e.g. bugzilla.suse.com -> bsc) followed by a #
and then an id number, so for example bsc#12345
.
Test failures can be 'tagged' with a bug reference. This usually looks something like test01:bsc#12345
. There are also anti-tags which signal that a failure should no longer be associated with a given bug. These look like test01:!bsc#12345
.
This module provides methods for processing bug references and tags which are typically included in a comment on a test failure, but can be taken from any text.
JDP.BugRefs.extract_tags!
— Method.Parse some text for Bug tags and add them to the given tags index
JDP.BugRefs.Ref
— Type.A reference to a bug on a particular tracker
BugRefsParser (Internal)
JDP.BugRefsParser
— Module.Parser for the Bug references (tags) DSL
See parse_comment
's docs for the format.
JDP.BugRefsParser.parse_comment
— Method.parse_comment(text)
Try to extract the test-name:bug-ref pairs from a comment
Below is the approximate syntax in EBNF. Assume letter ∈ [a-Z] and digit ∈ [0-9] and whitespace is allowed between testnames, bugrefs, ':' and ','. However there should be no gap between ':' and '!'.
testname = letter | digit { letter | digit | '_' | '-' }
tracker = letter { letter }
id = letter | digit { letter | digit }
bugref = tracker '#' id
tagging = testname {',' testname} ':' ['!'] bugref {',' bugref}
taggings = tagging { tagging }
A tagging can assign many bug references to many testnames, which means you can have something like: test1, test2: bsc#1234, git#a33f4. Which tags tests 1 and 2 with both bug references.
Comments many contain many taggings along with other random text. If the algorithm finds an error it discards the current tagging and starts trying to parse a new tagging from the point where it failed.
JDP.BugRefsParser.tokval
— Method.tokval(tok)
Get the textual value of any AbstractToken.
Implement using SubString and not [n:m] because the former is zero-copy.
JDP.BugRefsParser.AbstractToken
— Type.Some kind of symbol or even an expression; so long as it can be represented by SubString