AzaToth has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/50044


Change subject: Pester IRC as well when a draft is published
......................................................................

Pester IRC as well when a draft is published

Change-Id: I0033e7b3e186fc44079b5a7b110eb4f7dde041bf
---
A files/gerrit/hooks/draft-published
1 file changed, 29 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/44/50044/1

diff --git a/files/gerrit/hooks/draft-published 
b/files/gerrit/hooks/draft-published
new file mode 100755
index 0000000..11d72ae
--- /dev/null
+++ b/files/gerrit/hooks/draft-published
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+import sys
+import re
+from hookhelper import HookHelper
+
+sys.path.append('/var/lib/gerrit2/review_site/etc')
+import hookconfig
+
+
+class DraftPublished(HookHelper):
+    def run(self):
+        self.parser.set_usage("patchset-created --change")
+        self.parser.add_option("--uploader", dest="uploader")
+        self.parser.add_option("--commit", dest="commit")
+        self.parser.add_option("--patchset", dest="patchset", type="int")
+        self.parser.add_option("--topic", dest="topic")
+        (options, args) = self.parser.parse_args()
+        if not options.change or not options.change.isalnum():
+            self.parser.error("No change id, or changeid invalid")
+        if hookconfig.debug:
+            sys.stderr.write("Patchset passed in: " + str(options.patchset) + 
"\n")
+        subject = self.get_subject(options.change)
+        user = re.sub(' \(.*', "", options.uploader)
+        message = "Published patchset: " + user + '; "' + subject + '" [' + 
options.project + "] (" + options.branch + ") - " + options.changeurl + "\n"
+        self.log_to_file(options.project, options.branch, message, user)
+
+if __name__ == '__main__':
+    hook = DraftPublished()
+    hook.run()

-- 
To view, visit https://gerrit.wikimedia.org/r/50044
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0033e7b3e186fc44079b5a7b110eb4f7dde041bf
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: AzaToth <azat...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to