-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Toolstate: remove redundant beta-week check. #69705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -215,13 +215,18 @@ impl Step for ToolStateCheck { | |
tool, old_state, state | ||
); | ||
} else { | ||
// This warning only appears in the logs, which most | ||
// people won't read. It's mostly here for testing and | ||
// debugging. | ||
eprintln!( | ||
"warning: Tool `{}` is not test-pass (is `{}`), \ | ||
this should be fixed before beta is branched.", | ||
tool, state | ||
); | ||
} | ||
} | ||
// publish_toolstate.py will be responsible for creating | ||
// comments/issues warning people if there is a regression. | ||
} | ||
} | ||
|
||
|
@@ -230,7 +235,7 @@ impl Step for ToolStateCheck { | |
} | ||
|
||
if builder.config.channel == "nightly" && env::var_os("TOOLSTATE_PUBLISH").is_some() { | ||
commit_toolstate_change(&toolstates, in_beta_week); | ||
commit_toolstate_change(&toolstates); | ||
} | ||
} | ||
|
||
|
@@ -325,11 +330,11 @@ fn prepare_toolstate_config(token: &str) { | |
Err(_) => false, | ||
}; | ||
if !success { | ||
panic!("git config key={} value={} successful (status: {:?})", key, value, status); | ||
panic!("git config key={} value={} failed (status: {:?})", key, value, status); | ||
} | ||
} | ||
|
||
// If changing anything here, then please check that src/ci/publish_toolstate.sh is up to date | ||
// If changing anything here, then please check that `src/ci/publish_toolstate.sh` is up to date | ||
// as well. | ||
git_config("user.email", "[email protected]"); | ||
git_config("user.name", "Rust Toolstate Update"); | ||
|
@@ -373,14 +378,14 @@ fn read_old_toolstate() -> Vec<RepoState> { | |
/// | ||
/// * See <https://help.github.com/articles/about-commit-email-addresses/> | ||
/// if a private email by GitHub is wanted. | ||
fn commit_toolstate_change(current_toolstate: &ToolstateData, in_beta_week: bool) { | ||
let old_toolstate = read_old_toolstate(); | ||
|
||
fn commit_toolstate_change(current_toolstate: &ToolstateData) { | ||
let message = format!("({} CI update)", OS.expect("linux/windows only")); | ||
let mut success = false; | ||
for _ in 1..=5 { | ||
// Update the toolstate results (the new commit-to-toolstate mapping) in the toolstate repo. | ||
change_toolstate(¤t_toolstate, &old_toolstate, in_beta_week); | ||
// Upload the test results (the new commit-to-toolstate mapping) to the toolstate repo. | ||
// This does *not* change the "current toolstate"; that only happens post-landing | ||
// via `src/ci/docker/publish_toolstate.sh`. | ||
change_toolstate(¤t_toolstate); | ||
RalfJung marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// `git commit` failing means nothing to commit. | ||
let status = t!(Command::new("git") | ||
|
@@ -429,31 +434,7 @@ fn commit_toolstate_change(current_toolstate: &ToolstateData, in_beta_week: bool | |
} | ||
} | ||
|
||
fn change_toolstate( | ||
current_toolstate: &ToolstateData, | ||
old_toolstate: &[RepoState], | ||
in_beta_week: bool, | ||
) { | ||
let mut regressed = false; | ||
for repo_state in old_toolstate { | ||
let tool = &repo_state.tool; | ||
let state = repo_state.state(); | ||
let new_state = current_toolstate[tool.as_str()]; | ||
|
||
if new_state != state { | ||
eprintln!("The state of `{}` has changed from `{}` to `{}`", tool, state, new_state); | ||
if new_state < state { | ||
if !NIGHTLY_TOOLS.iter().any(|(name, _path)| name == tool) { | ||
regressed = true; | ||
} | ||
} | ||
} | ||
} | ||
|
||
if regressed && in_beta_week { | ||
std::process::exit(1); | ||
} | ||
|
||
fn change_toolstate(current_toolstate: &ToolstateData) { | ||
let commit = t!(std::process::Command::new("git").arg("rev-parse").arg("HEAD").output()); | ||
let commit = t!(String::from_utf8(commit.stdout)); | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.