Skip to content

Commit bd03bec

Browse files
committed
Pull PullReqState into its own file
Extract PullReqState into its own file for code readability. Because PullReqState shares some constants with main and server, extract those constants into a `consts.py` file as well.
1 parent 3016dba commit bd03bec

File tree

5 files changed

+348
-337
lines changed

5 files changed

+348
-337
lines changed

homu/consts.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import re
2+
from enum import Enum
3+
4+
STATUS_TO_PRIORITY = {
5+
'success': 0,
6+
'pending': 1,
7+
'approved': 2,
8+
'': 3,
9+
'error': 4,
10+
'failure': 5,
11+
}
12+
13+
INTERRUPTED_BY_HOMU_FMT = 'Interrupted by Homu ({})'
14+
INTERRUPTED_BY_HOMU_RE = re.compile(r'Interrupted by Homu \((.+?)\)')
15+
DEFAULT_TEST_TIMEOUT = 3600 * 10
16+
17+
WORDS_TO_ROLLUP = {
18+
'rollup-': 0,
19+
'rollup': 1,
20+
'rollup=maybe': 0,
21+
'rollup=never': -1,
22+
'rollup=always': 1,
23+
}
24+
25+
26+
class LabelEvent(Enum):
27+
APPROVED = 'approved'
28+
REJECTED = 'rejected'
29+
CONFLICT = 'conflict'
30+
SUCCEED = 'succeed'
31+
FAILED = 'failed'
32+
TRY = 'try'
33+
TRY_SUCCEED = 'try_succeed'
34+
TRY_FAILED = 'try_failed'
35+
EXEMPTED = 'exempted'
36+
TIMED_OUT = 'timed_out'
37+
INTERRUPTED = 'interrupted'
38+
PUSHED = 'pushed'

0 commit comments

Comments
 (0)