1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*-
3
3
4
- ## This script publishes the new "current" toolstate in the toolstate repo (not to be
5
- ## confused with publishing the test results, which happens in
6
- ## `src/ci/docker/x86_64-gnu-tools/checktools.sh`).
7
- ## It is set as callback for `src/ci/docker/x86_64-gnu-tools/repo.sh` by the CI scripts
8
- ## when a new commit lands on `master` (i.e., after it passed all checks on `auto`).
4
+ # This script publishes the new "current" toolstate in the toolstate repo (not to be
5
+ # confused with publishing the test results, which happens in
6
+ # `src/ci/docker/x86_64-gnu-tools/checktools.sh`).
7
+ # It is set as callback for `src/ci/docker/x86_64-gnu-tools/repo.sh` by the CI scripts
8
+ # when a new commit lands on `master` (i.e., after it passed all checks on `auto`).
9
9
10
10
from __future__ import print_function
11
11
@@ -103,6 +103,7 @@ def validate_maintainers(repo, github_token):
103
103
print ("The build will fail due to this." )
104
104
exit (1 )
105
105
106
+
106
107
def read_current_status (current_commit , path ):
107
108
'''Reads build status of `current_commit` from content of `history/*.tsv`
108
109
'''
@@ -113,14 +114,17 @@ def read_current_status(current_commit, path):
113
114
return json .loads (status )
114
115
return {}
115
116
117
+
116
118
def gh_url ():
117
119
return os .environ ['TOOLSTATE_ISSUES_API_URL' ]
118
120
121
+
119
122
def maybe_delink (message ):
120
123
if os .environ .get ('TOOLSTATE_SKIP_MENTIONS' ) is not None :
121
124
return message .replace ("@" , "" )
122
125
return message
123
126
127
+
124
128
def issue (
125
129
tool ,
126
130
status ,
@@ -164,6 +168,7 @@ def issue(
164
168
))
165
169
response .read ()
166
170
171
+
167
172
def update_latest (
168
173
current_commit ,
169
174
relevant_pr_number ,
@@ -194,7 +199,7 @@ def update_latest(
194
199
for status in latest :
195
200
tool = status ['tool' ]
196
201
changed = False
197
- create_issue_for_status = None # set to the status that caused the issue
202
+ create_issue_for_status = None # set to the status that caused the issue
198
203
199
204
for os , s in current_status .items ():
200
205
old = status [os ]
0 commit comments