@@ -215,13 +215,21 @@ impl Step for ToolStateCheck {
215
215
tool, old_state, state
216
216
) ;
217
217
} else {
218
+ // This warning only appears in the logs, which most
219
+ // people won't read. It's mostly here for testing and
220
+ // debugging.
218
221
eprintln ! (
219
222
"warning: Tool `{}` is not test-pass (is `{}`), \
220
223
this should be fixed before beta is branched.",
221
224
tool, state
222
225
) ;
223
226
}
224
227
}
228
+ // `publish_toolstate.py` is responsible for updating
229
+ // `latest.json` and creating comments/issues warning people
230
+ // if there is a regression. That all happens in a separate CI
231
+ // job on the master branch once the PR has passed all tests
232
+ // on the `auto` branch.
225
233
}
226
234
}
227
235
@@ -230,7 +238,7 @@ impl Step for ToolStateCheck {
230
238
}
231
239
232
240
if builder. config . channel == "nightly" && env:: var_os ( "TOOLSTATE_PUBLISH" ) . is_some ( ) {
233
- commit_toolstate_change ( & toolstates, in_beta_week ) ;
241
+ commit_toolstate_change ( & toolstates) ;
234
242
}
235
243
}
236
244
@@ -325,11 +333,11 @@ fn prepare_toolstate_config(token: &str) {
325
333
Err ( _) => false ,
326
334
} ;
327
335
if !success {
328
- panic ! ( "git config key={} value={} successful (status: {:?})" , key, value, status) ;
336
+ panic ! ( "git config key={} value={} failed (status: {:?})" , key, value, status) ;
329
337
}
330
338
}
331
339
332
- // If changing anything here, then please check that src/ci/publish_toolstate.sh is up to date
340
+ // If changing anything here, then please check that ` src/ci/publish_toolstate.sh` is up to date
333
341
// as well.
334
342
git_config ( "user.email" , "7378925+rust-toolstate-update@users.noreply.github.com" ) ;
335
343
git_config ( "user.name" , "Rust Toolstate Update" ) ;
@@ -373,14 +381,14 @@ fn read_old_toolstate() -> Vec<RepoState> {
373
381
///
374
382
/// * See <https://help.github.com/articles/about-commit-email-addresses/>
375
383
/// if a private email by GitHub is wanted.
376
- fn commit_toolstate_change ( current_toolstate : & ToolstateData , in_beta_week : bool ) {
377
- let old_toolstate = read_old_toolstate ( ) ;
378
-
384
+ fn commit_toolstate_change ( current_toolstate : & ToolstateData ) {
379
385
let message = format ! ( "({} CI update)" , OS . expect( "linux/windows only" ) ) ;
380
386
let mut success = false ;
381
387
for _ in 1 ..=5 {
382
- // Update the toolstate results (the new commit-to-toolstate mapping) in the toolstate repo.
383
- change_toolstate ( & current_toolstate, & old_toolstate, in_beta_week) ;
388
+ // Upload the test results (the new commit-to-toolstate mapping) to the toolstate repo.
389
+ // This does *not* change the "current toolstate"; that only happens post-landing
390
+ // via `src/ci/docker/publish_toolstate.sh`.
391
+ publish_test_results ( & current_toolstate) ;
384
392
385
393
// `git commit` failing means nothing to commit.
386
394
let status = t ! ( Command :: new( "git" )
@@ -429,31 +437,12 @@ fn commit_toolstate_change(current_toolstate: &ToolstateData, in_beta_week: bool
429
437
}
430
438
}
431
439
432
- fn change_toolstate (
433
- current_toolstate : & ToolstateData ,
434
- old_toolstate : & [ RepoState ] ,
435
- in_beta_week : bool ,
436
- ) {
437
- let mut regressed = false ;
438
- for repo_state in old_toolstate {
439
- let tool = & repo_state. tool ;
440
- let state = repo_state. state ( ) ;
441
- let new_state = current_toolstate[ tool. as_str ( ) ] ;
442
-
443
- if new_state != state {
444
- eprintln ! ( "The state of `{}` has changed from `{}` to `{}`" , tool, state, new_state) ;
445
- if new_state < state {
446
- if !NIGHTLY_TOOLS . iter ( ) . any ( |( name, _path) | name == tool) {
447
- regressed = true ;
448
- }
449
- }
450
- }
451
- }
452
-
453
- if regressed && in_beta_week {
454
- std:: process:: exit ( 1 ) ;
455
- }
456
-
440
+ /// Updates the "history" files with the latest results.
441
+ ///
442
+ /// These results will later be promoted to `latest.json` by the
443
+ /// `publish_toolstate.py` script if the PR passes all tests and is merged to
444
+ /// master.
445
+ fn publish_test_results ( current_toolstate : & ToolstateData ) {
457
446
let commit = t ! ( std:: process:: Command :: new( "git" ) . arg( "rev-parse" ) . arg( "HEAD" ) . output( ) ) ;
458
447
let commit = t ! ( String :: from_utf8( commit. stdout) ) ;
459
448
0 commit comments