Skip to content

Commit

Permalink
Add Resolves option for tags
Browse files Browse the repository at this point in the history
Allow a github issue to be used in addition to CQ or RTC tags.

Change-Id: I0e7b317fe9f25b5edc864ca877b76b1ede30507f
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59160
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
dcrowell77 committed Jul 11, 2018
1 parent e14387c commit 1534c78
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/build/tools/verify-commit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2013,2017
# Contributors Listed Below - COPYRIGHT 2013,2018
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -239,6 +239,7 @@ sub verifyCommitMsg
my $lineCount = 0;
my $rtcTag = "";
my $cqTag = "";
my $githubTag = "";
my $changeId = "";
my $taggedLine = "";
my $untaggedLine = "";
Expand Down Expand Up @@ -277,6 +278,7 @@ sub verifyCommitMsg

$rtcTag = "";
$cqTag = "";
$githubTag = "";
$untaggedLine = "";
$taggedLine = "";
}
Expand All @@ -290,7 +292,7 @@ sub verifyCommitMsg
}
}

# Verify format of RTC message.
# Verify format of RTC message. "RTC: 123456"
if ($line =~ m/^\s*RTC:\s*[0-9]+(.*)/)
{
$rtcTag = $line;
Expand All @@ -301,6 +303,7 @@ sub verifyCommitMsg
}
}

# Verify format of CQ message. "CQ: 123456"
if ($line =~ m/^\s*CQ:\s*[A-Z][A-Z][0-9]+(.*)/)
{
$cqTag = $line;
Expand All @@ -311,6 +314,18 @@ sub verifyCommitMsg
}
}

# Verify format of Github message. "Resolves somerepo/#12345"
# See https://help.github.com/articles/closing-issues-via-commit-messages
if ($line =~ m/^\s*Resolves \s*.*#[0-9]+(.*)/)
{
$githubTag = $line;
if ("" ne $1)
{
error("Commit Message",$line,$lineCount,
(sprintf "Github tag format incorrect (%s).", $1));
}
}

if ($line =~ m/^\s*Change-Id:\s*[I][\w]+(.*)/)
{
if ("" ne $changeId)
Expand All @@ -331,7 +346,8 @@ sub verifyCommitMsg
# away.
if ( (($line =~ m/^\s*[A-Za-z0-9\-_]+:[^:]/)
&& !($line =~ m/http/)) ||
(($line =~ m/http/) && ($line =~ m/Reviewed-on:/)))
(($line =~ m/http/) && ($line =~ m/Reviewed-on:/)) ||
($line =~ "Resolves") )
{
# We allow lines that look like tags in the topic like...
# "FOO: Adding support for BAR."
Expand All @@ -348,10 +364,10 @@ sub verifyCommitMsg
}

# Warn for missing RTC tag.
if (("" eq $rtcTag) && ("" eq $cqTag))
if (("" eq $rtcTag) && ("" eq $cqTag) && ("" eq $githubTag))
{
warning("Commit Message","<end-of-file>",$lineCount,
"Neither RTC nor CQ tag found.");
"Neither RTC nor CQ nor Github tag found.");
}

# Error for missing Change-Id.
Expand Down

0 comments on commit 1534c78

Please sign in to comment.