Dzahn has submitted this change and it was merged.
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
M manifests/gerrit.pp
2 files changed, 35 insertions(+), 0 deletions(-)
Approvals:
Demon: Looks good to me, but someone else must approve
jenkins-bot: Verified
Dzahn: Looks good to me, approved
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()
diff --git a/manifests/gerrit.pp b/manifests/gerrit.pp
index 0b51e01..308f5ca 100644
--- a/manifests/gerrit.pp
+++ b/manifests/gerrit.pp
@@ -235,6 +235,12 @@
mode => 0555,
source =>
"puppet:///files/gerrit/hooks/patchset-created",
require => File["/var/lib/gerrit2/review_site/hooks"];
+ "/var/lib/gerrit2/review_site/hooks/draft-published":
+ owner => gerrit2,
+ group => gerrit2,
+ mode => 0555,
+ source =>
"puppet:///files/gerrit/hooks/draft-published",
+ require => File["/var/lib/gerrit2/review_site/hooks"];
}
git::clone {
--
To view, visit https://gerrit.wikimedia.org/r/50044
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0033e7b3e186fc44079b5a7b110eb4f7dde041bf
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: AzaToth <[email protected]>
Gerrit-Reviewer: AzaToth <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: MZMcBride <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: RobLa <[email protected]>
Gerrit-Reviewer: Ryan Lane <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-Reviewer: preilly <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits