From: Alexander Kanevskiy Date: Tue, 13 Aug 2013 11:39:50 +0000 (+0300) Subject: fishbone for all other hooks X-Git-Tag: submit/devel/20190730.075356~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd69be3ef3002cb7d3751fb4eb0fff6922929f36;p=services%2Fgerrithooks.git fishbone for all other hooks --- diff --git a/gerrithooks/change_abandoned.py b/gerrithooks/change_abandoned.py new file mode 100644 index 0000000..7ae688f --- /dev/null +++ b/gerrithooks/change_abandoned.py @@ -0,0 +1,53 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +change-abandoned hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit change-abandoned hook") + args = ( + "--change", # + "--change-url", # + "--project", # + "--branch", # + "--topic", # + "--abandoner", # + "--reason" # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ change-abandoned hook entry """ + + return run_plugin_hooks("change-abandoned", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/change_merged.py b/gerrithooks/change_merged.py new file mode 100644 index 0000000..aa82878 --- /dev/null +++ b/gerrithooks/change_merged.py @@ -0,0 +1,53 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +change-merged hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit change-merged hook") + args = ( + "--change", # + "--change-url", # + "--project", # + "--branch", # + "--topic", # + "--submitter", # + "--commit", # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ change-merged hook entry """ + + return run_plugin_hooks("change-merged", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/change_restored.py b/gerrithooks/change_restored.py new file mode 100644 index 0000000..ac66758 --- /dev/null +++ b/gerrithooks/change_restored.py @@ -0,0 +1,53 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +change-restored hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit change-restored hook") + args = ( + "--change", # + "--change-url", # + "--project", # + "--branch", # + "--topic", # + "--restorer", # + "--reason", # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ change-restored hook entry """ + + return run_plugin_hooks("change-restored", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/cla_signed.py b/gerrithooks/cla_signed.py new file mode 100644 index 0000000..5bfc81e --- /dev/null +++ b/gerrithooks/cla_signed.py @@ -0,0 +1,49 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +cla-signed hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit cla-signed hook") + args = ( + "--submitter", # + "--user-id", # + "--cla-id", # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ cla-signed hook entry """ + + return run_plugin_hooks("cla-signed", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/comment_added.py b/gerrithooks/comment_added.py new file mode 100644 index 0000000..51772e0 --- /dev/null +++ b/gerrithooks/comment_added.py @@ -0,0 +1,56 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +comment-added hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit comment-added hook") + args = ( + "--change", # + "--is-draft", # + "--change-url", # + "--project", # + "--branch", # + "--topic", # + "--author", # + "--commit", # + "--comment", # + # TODO: [-- ...] + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_known_args(argv) + + +def main(): + """ comment-added hook entry """ + + return run_plugin_hooks("comment-added", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/draft_published.py b/gerrithooks/draft_published.py new file mode 100644 index 0000000..89eebe2 --- /dev/null +++ b/gerrithooks/draft_published.py @@ -0,0 +1,54 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +draft-published hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit draft-published hook") + args = ( + "--change", # + "--change-url", # + "--project", # + "--branch", # + "--topic", # + "--uploader", # + "--commit", # + "--patchset", # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ draft-published hook entry """ + + return run_plugin_hooks("draft-published", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/merge_failed.py b/gerrithooks/merge_failed.py new file mode 100644 index 0000000..75b7708 --- /dev/null +++ b/gerrithooks/merge_failed.py @@ -0,0 +1,54 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +merge-failed hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit merge-failed hook") + args = ( + "--change", # + "--change-url", # + "--project", # + "--branch", # + "--topic", # + "--submitter", # + "--commit", # + "--reason", # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ merge-failed hook entry """ + + return run_plugin_hooks("merge-failed", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/ref_update.py b/gerrithooks/ref_update.py new file mode 100644 index 0000000..b0f8bb6 --- /dev/null +++ b/gerrithooks/ref_update.py @@ -0,0 +1,51 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +ref-update hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit ref-update hook") + args = ( + "--project", # + "--refname", # + "--uploader", # + "--oldrev", # + "--newrev" # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ ref-update hook entry """ + + return run_plugin_hooks("ref-update", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/ref_updated.py b/gerrithooks/ref_updated.py new file mode 100644 index 0000000..a7b91cc --- /dev/null +++ b/gerrithooks/ref_updated.py @@ -0,0 +1,51 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +red-updated hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit red-updated hook") + args = ( + "--oldrev", # + "--newrev", # + "--refname", # + "--project", # + "--submitter", # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ red-updated hook entry """ + + return run_plugin_hooks("red-updated", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gerrithooks/reviewer_added.py b/gerrithooks/reviewer_added.py new file mode 100644 index 0000000..a11e0f6 --- /dev/null +++ b/gerrithooks/reviewer_added.py @@ -0,0 +1,51 @@ +#!/usr/bin/env +# -*- coding: UTF-8 -*- +# vim: sw=4 ts=4 expandtab ai +# +# Copyright (c) 2013 Intel, Inc. +# License: GPLv2 +# Author: Alexander Kanevskiy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License, version 2, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + + +""" +reviewer-added hook entry module +""" + +import sys +import argparse + +from gerrithooks.common import run_plugin_hooks + +def parse_cmdline(argv): + """Parse hook command line parameters.""" + parser = argparse.ArgumentParser( + description="Gerrit reviewer-added hook") + args = ( + "--change", # + "--change-url", # + "--project", # + "--branch", # + "--reviewer", # + ) + for arg in args: + parser.add_argument(arg) + parser.add_argument("-d", "--debug", action="store_true") + return parser.parse_args(argv) + + +def main(): + """ reviewer-added hook entry """ + + return run_plugin_hooks("reviewer-added", parse_cmdline) + +if __name__ == "__main__": + sys.exit(main())