summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2013-09-13 17:44:21 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-09-18 13:57:04 -0500
commitea1d37d7f7c107ea700d9ba125334ec869e91c40 (patch)
tree4e6549f8c4717dd9f94055c1895d1a7ea70b1b34 /src
parent71f0f9b62fe2369493bd9f323423490a62abb85f (diff)
downloadtalos-hostboot-ea1d37d7f7c107ea700d9ba125334ec869e91c40.tar.gz
talos-hostboot-ea1d37d7f7c107ea700d9ba125334ec869e91c40.zip
Support CQ tag in tools.
Change-Id: I403ddc4dae11daaf1758daf9c525ed539635f3b4 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6160 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/build/tools/hbRelease54
-rwxr-xr-xsrc/build/tools/verify-commit28
2 files changed, 78 insertions, 4 deletions
diff --git a/src/build/tools/hbRelease b/src/build/tools/hbRelease
index 6c38b9902..695708968 100755
--- a/src/build/tools/hbRelease
+++ b/src/build/tools/hbRelease
@@ -520,7 +520,7 @@ STYLESHEET
print RELNOTE "<h2>Included commits:</h2>\n";
print RELNOTE "<table class='release'>\n";
print RELNOTE " <tr>\n";
- print RELNOTE " <th>RTC Number</th>\n";
+ print RELNOTE " <th>RTC/CQ Number(s)</th>\n";
print RELNOTE " <th>Subject</th>\n";
print RELNOTE " <th>Git Commit</th>\n";
print RELNOTE " </tr>\n";
@@ -531,15 +531,27 @@ STYLESHEET
my $subject = git_get_subject($commit);
my $rtc = rtc_workitem_num($commit);
my $rtc_hyper = "";
+ my $cq = cq_workitem_num($commit);
+ my $cq_hyper = "";
if ($rtc ne "")
{
$rtc_hyper = rtc_hyperlink($rtc);
$rtc_hyper = "<a href='$rtc_hyper' target='_blank'>$rtc</a>";
}
+ if ($cq ne "")
+ {
+ $cq_hyper = cq_hyperlink($cq);
+ $cq_hyper = "<a href='$cq_hyper' target='_blank'>$cq</a>";
+
+ if ($rtc_hyper ne "")
+ {
+ $cq_hyper = "<br>$cq_hyper";
+ }
+ }
print RELNOTE " <tr>\n";
- print RELNOTE " <td>$rtc_hyper</td>\n";
+ print RELNOTE " <td>$rtc_hyper $cq_hyper</td>\n";
print RELNOTE " <td>$subject</td>\n";
print RELNOTE " <td>$commit</td>\n";
print RELNOTE " </tr>\n";
@@ -1366,6 +1378,30 @@ sub rtc_workitem_num
}
}
+# sub cq_workitem_num
+#
+# Determine the CQ WorkItem associated with a git commit.
+#
+# @param[in] commit - The git commit.
+#
+# @return string - CQ WorkItem number (or "").
+#
+sub cq_workitem_num
+{
+ my $commit = shift;
+ my $message = git_commit_msg($commit);
+
+ if ($message =~ m/CQ:\s*([A-Z][A-Z][0-9]+)/)
+ {
+ return $1;
+ }
+ else
+ {
+ return "";
+ }
+}
+
+
# sub rtc_hyperlink
#
# Turn an RTC WorkItem number into the https:// address to the RTC server.
@@ -1381,6 +1417,20 @@ sub rtc_hyperlink
"$workitem.hover.html";
}
+# sub cq_hyperlink
+#
+# Turn a CQ WorkItem number into the http:// address to the BQ server.
+#
+# @param[in] workitem - CQ workitem number.
+#
+# @return string - The http:// address of the CQ item on the server.
+#
+sub cq_hyperlink
+{
+ my $workitem = shift;
+ return "http://w3.rchland.ibm.com/projects/bestquest/?defect=$workitem";
+}
+
# sub json_parse
#
# Parse a line of JSON into an hash-object.
diff --git a/src/build/tools/verify-commit b/src/build/tools/verify-commit
index fc6002407..f42d53884 100755
--- a/src/build/tools/verify-commit
+++ b/src/build/tools/verify-commit
@@ -191,6 +191,7 @@ sub verifyCommitMsg
open COMMIT_CONTENTS, "git log -n1 --pretty=format:%B |";
my $lineCount = 0;
my $rtcTag = "";
+ my $cqTag = "";
my $taggedLine = "";
my $untaggedLine = "";
@@ -227,6 +228,7 @@ sub verifyCommitMsg
}
$rtcTag = "";
+ $cqTag = "";
$untaggedLine = "";
$taggedLine = "";
}
@@ -243,6 +245,12 @@ sub verifyCommitMsg
# Verify format of RTC message.
if ($line =~ m/^\s*RTC:\s*[0-9]+(.*)/)
{
+ if ("" ne $rtcTag)
+ {
+ error("Commit Message",$line,$lineCount,
+ "Duplicate RTC tag found.");
+ }
+
$rtcTag = $line;
if ("" ne $1)
{
@@ -251,6 +259,22 @@ sub verifyCommitMsg
}
}
+ if ($line =~ m/^\s*CQ: \s*[A-Z][A-Z][0-9]+(.*)/)
+ {
+ if ("" ne $cqTag)
+ {
+ error("Commit Message",$line,$lineCount,
+ "Duplicate CQ tag found.");
+ }
+
+ $cqTag = $line;
+ if ("" ne $1)
+ {
+ error("Commit Message",$line,$lineCount,
+ (sprintf "CQ tag format incorrect (%s).", $1));
+ }
+ }
+
# Identify if this is a tagged line or a non-tagged line and store
# away.
if ($line =~ m/^\s*[A-Za-z0-9\-_]+:[^:]/)
@@ -269,10 +293,10 @@ sub verifyCommitMsg
}
# Warn for missing RTC tag.
- if ("" eq $rtcTag)
+ if (("" eq $rtcTag) && ("" eq $cqTag))
{
warning("Commit Message","<end-of-file>",$lineCount,
- "RTC tag not found.");
+ "Neither RTC nor CQ tag found.");
}
# Error for a mix of tag / untagged in the last section (ie. untagged
OpenPOWER on IntegriCloud