forked from ansible/ansibullbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
triage_simple.py
executable file
·73 lines (56 loc) · 2.63 KB
/
triage_simple.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible 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.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import argparse
from lib.triagers.simpletriager import SimpleTriager
def main():
description = "Triage issue and pullrequest queues for any github repo.\n"
description += " (NOTE: only useful if you have commit access to"
description += " the repo in question.)"
parser = argparse.ArgumentParser(description=description)
parser.add_argument("--configfile", type=str,
default='/tmp/triager_cache/config.cfg')
parser.add_argument("--cachedir", type=str,
default='/tmp/triager_cache')
parser.add_argument("--logfile", type=str,
default='/tmp/triager_cache/bot.log',
help="Send logging to this file")
parser.add_argument("--daemonize", action="store_true",
help="run in a continuos loop")
parser.add_argument("--daemonize_interval", type=int, default=(30 * 60),
help="seconds to sleep between loop iterations")
parser.add_argument("--repo", "-r", type=str, required=True,
help="Github repo to triage")
parser.add_argument("--debug", "-d", action="store_true",
help="Debug output")
parser.add_argument("--verbose", "-v", action="store_true",
help="Verbose output")
parser.add_argument("--dry-run", "-n", action="store_true",
help="Don't make any changes")
parser.add_argument("--force", "-f", action="store_true",
help="Do not ask questions")
parser.add_argument("--always_pause", "-p", action="store_true",
help="Always pause between prs|issues")
parser.add_argument(
"--number", "--pr", "--id", type=str,
help="Triage only the specified pr|issue (separated by commas)"
)
args = parser.parse_args()
# Run the triager ...
SimpleTriager(args).start()
if __name__ == "__main__":
main()