apply-pr 3.2.0__tar.gz → 3.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {apply_pr-3.2.0 → apply_pr-3.2.2}/PKG-INFO +1 -1
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr/fabfile.py +27 -4
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr.egg-info/PKG-INFO +1 -1
- {apply_pr-3.2.0 → apply_pr-3.2.2}/setup.py +1 -1
- {apply_pr-3.2.0 → apply_pr-3.2.2}/MANIFEST.in +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/README.md +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr/__init__.py +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr/cli.py +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr/exceptions.py +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr/version.py +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr.egg-info/SOURCES.txt +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr.egg-info/dependency_links.txt +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr.egg-info/entry_points.txt +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr.egg-info/requires.txt +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/apply_pr.egg-info/top_level.txt +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/requirements.txt +0 -0
- {apply_pr-3.2.0 → apply_pr-3.2.2}/setup.cfg +0 -0
|
@@ -46,8 +46,25 @@ for k in output.keys():
|
|
|
46
46
|
output[k] = False
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
def is_github_token_valid(token):
|
|
50
|
+
headers = {'Authorization': 'token {token}'.format(token=token)}
|
|
51
|
+
url = "https://api.github.com/user"
|
|
52
|
+
|
|
53
|
+
r = requests.get(url, headers=headers)
|
|
54
|
+
|
|
55
|
+
return r.status_code == 200
|
|
56
|
+
|
|
57
|
+
|
|
49
58
|
def github_config(**config):
|
|
50
|
-
|
|
59
|
+
def validate(_config):
|
|
60
|
+
if 'token' not in _config or not _config['token']:
|
|
61
|
+
raise EnvironmentError("GITHUB_TOKEN variable not provided")
|
|
62
|
+
if not is_github_token_valid(_config['token']):
|
|
63
|
+
raise EnvironmentError("GITHUB_TOKEN not valid or expired")
|
|
64
|
+
|
|
65
|
+
res = config_from_environment('GITHUB', ['token'], **config)
|
|
66
|
+
validate(res)
|
|
67
|
+
return res
|
|
51
68
|
|
|
52
69
|
|
|
53
70
|
def apply_pr_config(**config):
|
|
@@ -920,7 +937,7 @@ def prs_status(
|
|
|
920
937
|
pr_number = pull_info['pullRequest']['number']
|
|
921
938
|
try:
|
|
922
939
|
pull = pull_info['pullRequest']
|
|
923
|
-
projects_info = pull_info
|
|
940
|
+
projects_info = pull_info.get('projectItems', None)
|
|
924
941
|
projects_show = ''
|
|
925
942
|
to_apply = '{}'.format(str(pr_number))
|
|
926
943
|
projects = ''
|
|
@@ -984,7 +1001,7 @@ def prs_status(
|
|
|
984
1001
|
for prmsg in PRS[milestone]:
|
|
985
1002
|
print('\t{}'.format(prmsg))
|
|
986
1003
|
for prmsg in ERRORS:
|
|
987
|
-
|
|
1004
|
+
print('ERR\t{}'.format(prmsg))
|
|
988
1005
|
if version:
|
|
989
1006
|
print(colors.magenta('\nIncluded in projects\n'))
|
|
990
1007
|
for x in IN_PROJECTS:
|
|
@@ -993,9 +1010,15 @@ def prs_status(
|
|
|
993
1010
|
for _pr_project in TO_APPLY_CAUSE_PROJECT_VERSION_ERROR:
|
|
994
1011
|
print(colors.red('* {}'.format(_pr_project)))
|
|
995
1012
|
if CLOSED_PRS:
|
|
996
|
-
print(colors.red('\
|
|
1013
|
+
print(colors.red('\n############# Closed PRS: "{}"\n'.format(
|
|
997
1014
|
' '.join(CLOSED_PRS)
|
|
998
1015
|
)))
|
|
1016
|
+
if ERRORS:
|
|
1017
|
+
print(colors.yellow('\n⚠ ️WARNING ⚠ ️! ERRORS IN PRS. MUST BE REVIEW\n'))
|
|
1018
|
+
print(colors.yellow('##########################################\n'))
|
|
1019
|
+
for prmsg in ERRORS:
|
|
1020
|
+
print('ERR\t{}'.format(prmsg))
|
|
1021
|
+
print(colors.yellow('############# END ERROR PRS ###############\n'))
|
|
999
1022
|
print(colors.yellow(
|
|
1000
1023
|
'\nNot Included: "{}"\n'.format(' '.join(TO_APPLY))
|
|
1001
1024
|
))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|