This repository has been archived by the owner on Feb 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
104 lines (81 loc) · 3.65 KB
/
README
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Simple script for verifying Cockpit pull requests.
Hubbot is simplistic and not polished at all, but it might be useful
nevertheless.
DO NOT RUN HUBBOT YOURSELF! IT ONLY WORKS CORRECTLY IN ITS SPECIAL
ENVIRONMENT ON OUR CI MACHINE.
But you might find the "trigger-hubbot" utility useful. It can tell
hubbot to work on a pull request, probably to retry a bogus failure.
This could also be used to explicitly white-list pull requests from
external contributors, but that doesn't work yet.
The rest of this README is only about trigger-hubbot.
## Installing
"make install" will copy trigger-hubbot to /usr/local/bin.
## Setup
Put something like this into $HOME/.hubbotrc:
{ 'github_token': "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
'user_whitelist': [],
'master_repo': "cockpit-project/cockpit",
'dry_run': False,
'remote': False,
'keep_work_dirs': 30
'os_arch': [{'os': 'fedora-22',
'short': 'f22',
'arch': 'x86_64',
'offset_master': 20,
'offset_pull': 20,
'publish_images': True
},
{'os': 'rhel-7',
'short': 'r7',
'arch': 'x86_64',
'offset_master': 20,
'offset_pull': 20,
'publish_images': False
}
],
'priority_default': 0,
'priority_needs_attention': -1,
'priority_work_in_progress': -2,
'priority_master_changed': 1,
'priority_essential_failed': 2,
}
'dry_run' if this is true, no changes are pushed to github.
'remote' specifies if hubbot runs on a remote server. If True, the hubbot.work
files will be looked for via http if they aren't found locally.
'keep_work_dirs' specifies how many output directories will be kept that don't
belong to an open pull request or master. All output directories accessible via
github will be kept in addition to this.
'os_arch' entries:
Of these, 'os' and 'arch' will be used to find the correct images,
whereas the short name is used for status messages.
'offset_master' and 'offset_pull' will be added to priorities with this
configuration.
The first entry is used by default if no configuration is specified
via command line.
If 'publish_images' is set to True, images will be made available for public
download automatically.
Priorities:
By default, all tasks are assigned priority_default.
For pull requests, the github labels and title are considered:
priority_needs_attention (labels "needsdesign", "needswork")
priority_work_in_progress (title begins with WIP, case insensitive)
Master is checked daily with the configuration's respective priority.
When checking a pull again because master has changed, its priority is set
to priority_master_changed, ignoring all other modifiers.
If an essential check (base priority >= 20) for a pull request has failed,
other checks for the same pull request will be set to a lower priority:
priority_essential_failed.
The github_token is used to access the GitHub API. You can create one
for your account at
https://github.com/settings/applications
When generating a new personal access token, the scope only needs to
encompass public_repo (or repo if you're accessing a private repo).
## Running
To mark pull request number NNN as 'pending', run
$ trigger-hubbot NNN
This will update the status of the current head commit of the given
pull request in a special way, and hubbot will eventually pick it up
for verification.
If the pull request is target at some other repo than
cockpit-project/cockpit, you can pass it as well:
$ trigger-hubbot cgwalters/cockpit NNN