@@ -215,13 +215,21 @@ impl Step for ToolStateCheck {
215215                            tool,  old_state,  state
216216                        ) ; 
217217                    }  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. 
218221                        eprintln ! ( 
219222                            "warning: Tool `{}` is not test-pass (is `{}`), \  
220223, 
221224                            tool,  state
222225                        ) ; 
223226                    } 
224227                } 
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. 
225233            } 
226234        } 
227235
@@ -230,7 +238,7 @@ impl Step for ToolStateCheck {
230238        } 
231239
232240        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) ; 
234242        } 
235243    } 
236244
@@ -325,11 +333,11 @@ fn prepare_toolstate_config(token: &str) {
325333            Err ( _)  => false , 
326334        } ; 
327335        if  !success { 
328-             panic ! ( "git config key={} value={} successful  (status: {:?})" ,  key,  value,  status) ; 
336+             panic ! ( "git config key={} value={} failed  (status: {:?})" ,  key,  value,  status) ; 
329337        } 
330338    } 
331339
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 
333341    // as well. 
334342    git_config ( "user.email" ,  "[email protected] " ) ;  335343    git_config ( "user.name" ,  "Rust Toolstate Update" ) ; 
@@ -373,14 +381,14 @@ fn read_old_toolstate() -> Vec<RepoState> {
373381/// 
374382///       * See <https://help.github.com/articles/about-commit-email-addresses/> 
375383///           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 )  { 
379385    let  message = format ! ( "({} CI update)" ,  OS . expect( "linux/windows only" ) ) ; 
380386    let  mut  success = false ; 
381387    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) ; 
384392
385393        // `git commit` failing means nothing to commit. 
386394        let  status = t ! ( Command :: new( "git" ) 
@@ -429,31 +437,12 @@ fn commit_toolstate_change(current_toolstate: &ToolstateData, in_beta_week: bool
429437    } 
430438} 
431439
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 )  { 
457446    let  commit = t ! ( std:: process:: Command :: new( "git" ) . arg( "rev-parse" ) . arg( "HEAD" ) . output( ) ) ; 
458447    let  commit = t ! ( String :: from_utf8( commit. stdout) ) ; 
459448
0 commit comments