[Asterisk-code-review] digium commits: Make module more tolerant to input data; add... (repotools[master])

Matt Jordan asteriskteam at digium.com
Wed Apr 22 22:22:56 CDT 2015


Hello Mark Michelson,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/178

to look at the new patch set (#2).

Change subject: digium_commits: Make module more tolerant to input data; add some enhancements
......................................................................

digium_commits: Make module more tolerant to input data; add some enhancements

While it would be nice if all commit messages were always formatted
identically, this is rarely the case. There are often subtle differences
in the key fields of a commit message. When parsed, these differences
can cause authors to be misreported, or altogether missed. This patch
makes the DigiumCommitMessageParser class more tolerant in the following
ways:

 * The parser is a bit more paranoid about what data is passed into it,
   and will now strip the username string before passing it into an
   instance of AsteriskUser
 * The parser will now be tolerant of hyphens in the "Reported By" (or
   "Reported-By") and "Tested By" (or "Tested-By") fields.
 * Open issues were previously missed due to the parser looking for the
   keyword "[Ii]ssue" prior to the JIRA issue key. This was the old
   nomenclature, prior to moving to JIRA smart commits. The "[Ii]ssue"
   field has been removed from the regex.

In addition to those cleanups, there are several times when it is
necessary to get at the raw commit message that the
DigiumCommitMessageParser has parsed. The class now supports storing the
raw commit message object.

digium_git: Pass the raw commit message down into the message parser

The release-summary script in particular needs portion of the raw Git
commit object in its generation of SHA1 links. This patch passes the raw
Git commit object down to the DigiumCommitMessageParser.

digium_jira_user: Be more paranoid of input data; fix License reporting

This patch fixes two issues:
 * We are now more paranoid with input data, stripping it of
   leading/trailing whitespace. This helps to prevent misreporting of
   authors.
 * The 'License' prefix was being reported twice, as we do not strip the
   'license' tag from the delineated license number.

REP-13
Reported by: Matt Jordan

Change-Id: I05a3d667b9d56465232eb293682a66fe97c3aaef
---
M digium_commits.py
M digium_git.py
M digium_jira_user.py
3 files changed, 24 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/78/178/2
-- 
To view, visit https://gerrit.asterisk.org/178
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I05a3d667b9d56465232eb293682a66fe97c3aaef
Gerrit-PatchSet: 2
Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list