You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2016/01/14 03:22:35 UTC

[1/2] mesos git commit: Added flags to update summary / desc for reviews.

Repository: mesos
Updated Branches:
  refs/heads/master d98f9e853 -> 404e661e6


Added flags to update summary / desc for reviews.

Previously if you amended a commit message and posted it to reviewboard
via the support/post_reviews.py script, then the summary / description
on reviewboard would not be updated. The only way to update these was
to modify them directly on the webpage. However, with a simple
directive in the .reviewboardrc file we can force the review's summary
/ description to be updated to the text in the commit message.
This commit adds these directives to the default .reviewboardrc.

Review: https://reviews.apache.org/r/41411/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/1fed14e1
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/1fed14e1
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/1fed14e1

Branch: refs/heads/master
Commit: 1fed14e1b9e8bc90f098805fb61e893e43f2fc9d
Parents: d98f9e8
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Jan 14 01:52:18 2016 +0100
Committer: Till Toenshoff <to...@me.com>
Committed: Thu Jan 14 01:53:27 2016 +0100

----------------------------------------------------------------------
 support/reviewboardrc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/1fed14e1/support/reviewboardrc
----------------------------------------------------------------------
diff --git a/support/reviewboardrc b/support/reviewboardrc
index 56bd8a5..68002aa 100644
--- a/support/reviewboardrc
+++ b/support/reviewboardrc
@@ -1,4 +1,5 @@
 REVIEWBOARD_URL = "https://reviews.apache.org/"
 REPOSITORY_URL = "git://git.apache.org/mesos.git"
 REPOSITORY = "mesos"
+GUESS_FIELDS = "yes"
 TARGET_GROUPS = "mesos"


[2/2] mesos git commit: Updated post-reviews.py to strip review URL in RR description.

Posted by ti...@apache.org.
Updated post-reviews.py to strip review URL in RR description.

Previously, when setting GUESS_FIELDS in .reviewboardrc to automatically
update the description message when posting a review, the description
would include the review URL in the description message. This was due
to the fact that GUESS_FILEDS simply copies the entirety of the commit
message into the RR description field on reviewboard.
Including this line is both redundant, and, in some cases, has been
found to appear (at least) twice in the description message instead of
just once.

This commit ensures that the commit message posted when GUESS_FIELDS is
set will have the review URL stripped before posting.

Review: https://reviews.apache.org/r/42266/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/404e661e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/404e661e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/404e661e

Branch: refs/heads/master
Commit: 404e661e6be6842566806331b36818961bb5c3fc
Parents: 1fed14e
Author: Kevin Klues <kl...@gmail.com>
Authored: Thu Jan 14 02:36:05 2016 +0100
Committer: Till Toenshoff <to...@me.com>
Committed: Thu Jan 14 03:19:26 2016 +0100

----------------------------------------------------------------------
 support/post-reviews.py | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/404e661e/support/post-reviews.py
----------------------------------------------------------------------
diff --git a/support/post-reviews.py b/support/post-reviews.py
index c738f2a..ea36101 100755
--- a/support/post-reviews.py
+++ b/support/post-reviews.py
@@ -234,6 +234,16 @@ for i in range(len(shas)):
         parent_review_request_id = review_request_id
         continue
 
+    # Strip the review url from the commit message, so that it is not included
+    # in the summary message when GUESS_FIELDS is set in .reviewboardc. Update
+    # the sha appropriately.
+    if review_request_id:
+        stripped_message = message[:pos]
+        execute(['git', 'checkout', sha])
+        execute(['git', 'commit', '--amend', '-m', stripped_message])
+        sha = execute(['git', 'rev-parse', 'HEAD']).strip()
+        execute(['git', 'checkout', branch])
+
     revision_range = previous + ':' + sha
 
     # Build the post-review/rbt command up to the point where they are common.
@@ -266,12 +276,17 @@ for i in range(len(shas)):
     print output
 
 
+    # If we already have a request_id, continue on to the next commit in the
+    # chain. We update 'previous' from the shas[] array because we have
+    # overwritten the temporary sha variable above.
     if review_request_id is not None:
-        i = i + 1
-        previous = sha
+        previous = shas[i]
         parent_review_request_id = review_request_id
+        i = i + 1
         continue
 
+    # Otherwise, get the request_id from the output of post-review, append it
+    # to the commit message and rebase all other commits on top of it.
     lines = output.split('\n')
 
     # The last line of output in post-review is the review url.