-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
9a01c32
commit e6d37ee
Showing
5 changed files
with
348 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import re | ||
from enum import Enum | ||
|
||
STATUS_TO_PRIORITY = { | ||
'success': 0, | ||
'pending': 1, | ||
'approved': 2, | ||
'': 3, | ||
'error': 4, | ||
'failure': 5, | ||
} | ||
|
||
INTERRUPTED_BY_HOMU_FMT = 'Interrupted by Homu ({})' | ||
INTERRUPTED_BY_HOMU_RE = re.compile(r'Interrupted by Homu \((.+?)\)') | ||
DEFAULT_TEST_TIMEOUT = 3600 * 10 | ||
|
||
WORDS_TO_ROLLUP = { | ||
'rollup-': 0, | ||
'rollup': 1, | ||
'rollup=maybe': 0, | ||
'rollup=never': -1, | ||
'rollup=always': 1, | ||
} | ||
|
||
|
||
class LabelEvent(Enum): | ||
APPROVED = 'approved' | ||
REJECTED = 'rejected' | ||
CONFLICT = 'conflict' | ||
SUCCEED = 'succeed' | ||
FAILED = 'failed' | ||
TRY = 'try' | ||
TRY_SUCCEED = 'try_succeed' | ||
TRY_FAILED = 'try_failed' | ||
EXEMPTED = 'exempted' | ||
TIMED_OUT = 'timed_out' | ||
INTERRUPTED = 'interrupted' | ||
PUSHED = 'pushed' |
Oops, something went wrong.