Skip to content

Commit

Permalink
Pull PullReqState into its own file
Browse files Browse the repository at this point in the history
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
bryanburgers committed Jun 12, 2019
1 parent 9a01c32 commit e6d37ee
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 337 deletions.
38 changes: 38 additions & 0 deletions homu/consts.py
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'
Loading

0 comments on commit e6d37ee

Please sign in to comment.