File tree 2 files changed +27
-12
lines changed
src/ci/docker/x86_64-gnu-tools
2 files changed +27
-12
lines changed Original file line number Diff line number Diff line change 18
18
os_name = sys .argv [1 ]
19
19
toolstate_file = sys .argv [2 ]
20
20
current_state = sys .argv [3 ]
21
+ verb = sys .argv [4 ] # 'regressed' or 'changed'
21
22
22
23
with open (toolstate_file , 'r' ) as f :
23
24
toolstate = json .load (f )
29
30
tool = cur ['tool' ]
30
31
state = cur [os_name ]
31
32
new_state = toolstate .get (tool , '' )
32
- if new_state < state :
33
+ if verb == 'regressed' :
34
+ updated = new_state < state
35
+ elif verb == 'changed' :
36
+ updated = new_state != state
37
+ else :
38
+ print ('Unknown verb {}' .format (updated ))
39
+ sys .exit (2 )
40
+ if updated :
33
41
print (
34
- 'Error: The state of "{}" has regressed from "{}" to "{}"'
35
- .format (tool , state , new_state )
42
+ 'The state of "{}" has {} from "{}" to "{}"'
43
+ .format (tool , verb , state , new_state )
36
44
)
37
45
regressed = True
38
46
Original file line number Diff line number Diff line change @@ -91,19 +91,26 @@ status_check() {
91
91
92
92
status_check " submodule_changed"
93
93
94
- if [ " $RUST_RELEASE_CHANNEL " = nightly -a -n " ${TOOLSTATE_REPO_ACCESS_TOKEN+is_set} " ]; then
95
- . " $( dirname $0 ) /repo.sh"
96
- MESSAGE_FILE=$( mktemp -t msg.XXXXXX)
97
- echo " ($OS CI update)" > " $MESSAGE_FILE "
98
- commit_toolstate_change " $MESSAGE_FILE " \
94
+ CHECK_NOT=" $( dirname $0 ) /checkregression.py"
95
+ change_toolstate () {
96
+ # only update the history
97
+ if python2.7 " $CHECK_NOT " " $OS " " $TOOLSTATE_FILE " " _data/latest.json" changed; then
98
+ echo ' Toolstate is not changed. Not updating.'
99
+ else
100
+ if [ $SIX_WEEK_CYCLE -eq 5 ]; then
101
+ python2.7 " $CHECK_NOT " " $OS " " $TOOLSTATE_FILE " " _data/latest.json" regressed
102
+ fi
99
103
sed -i " 1 a\\
100
104
$COMMIT \t$( cat " $TOOLSTATE_FILE " )
101
105
" " history/$OS .tsv"
102
- # if we are at the last week in the 6-week release cycle, reject any kind of regression.
103
- if [ $SIX_WEEK_CYCLE -eq 5 ]; then
104
- python2.7 " $( dirname $0 ) /checkregression.py" \
105
- " $OS " " $TOOLSTATE_FILE " " rust-toolstate/_data/latest.json"
106
106
fi
107
+ }
108
+
109
+ if [ " $RUST_RELEASE_CHANNEL " = nightly -a -n " ${TOOLSTATE_REPO_ACCESS_TOKEN+is_set} " ]; then
110
+ . " $( dirname $0 ) /repo.sh"
111
+ MESSAGE_FILE=$( mktemp -t msg.XXXXXX)
112
+ echo " ($OS CI update)" > " $MESSAGE_FILE "
113
+ commit_toolstate_change " $MESSAGE_FILE " change_toolstate
107
114
rm -f " $MESSAGE_FILE "
108
115
exit 0
109
116
fi
You can’t perform that action at this time.
0 commit comments