From 59231462107faa8ca9c46a46045fcbf6852859df Mon Sep 17 00:00:00 2001 From: "Denis S. Soldatov aka General-Beck" Date: Wed, 22 Jan 2020 19:34:34 +0300 Subject: [PATCH] Switching to stable-track (#11377) * sccache "stop server" - > "show stats" * remove testing and beta from update, cli, etc. * Beta->Nigthly updater * Beta->Nightly * ->Nightly and fix * updater ->Stable * Testing->Nightly * Update scripts/gitlab/test-linux.sh Co-Authored-By: Denis Pisarev * sccache "stop server" - > "show stats" * remove testing and beta from update, cli, etc. * Beta->Nigthly updater * Beta->Nightly * ->Nightly and fix * updater ->Stable * Testing->Nightly * Update scripts/gitlab/test-linux.sh Co-Authored-By: Denis Pisarev * Update CHANGELOGs and version * temporarily allow darwin and windows to be built on any branch * fix check-benches job * Revert "temporarily allow darwin and windows to be built on any branch" This reverts commit 45c72f69e99cbe891f694e528a53eb3c3bd8f331. * fix check-benches job * Revert changing track from `nightly` to `stable` * fix test: rpc_parity_upgrade_ready * fix tests: rpc_parity_version_info, rpc_parity_releases_info Co-authored-by: Denis Pisarev Co-authored-by: s3krit --- .gitlab-ci.yml | 3 +-- parity/cli/mod.rs | 2 +- parity/configuration.rs | 30 +++------------------- rpc/src/v1/tests/helpers/update_service.rs | 4 +-- rpc/src/v1/tests/mocked/parity.rs | 4 +-- rpc/src/v1/tests/mocked/parity_set.rs | 2 +- rpc/src/v1/types/consensus_status.rs | 4 --- scripts/docker/hub/publish-docker.sh | 16 ++---------- scripts/gitlab/publish-snap.sh | 1 - scripts/gitlab/rust-changes.sh | 2 +- updater/src/types/release_track.rs | 26 +++---------------- updater/src/updater.rs | 7 +++-- util/version/Cargo.toml | 2 +- util/version/src/lib.rs | 2 +- 14 files changed, 22 insertions(+), 83 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b467bda9..06862bcea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,6 @@ variables: .releaseable_branches: # list of git refs for building GitLab artifacts (think "pre-release binaries") only: &releaseable_branches - stable - - beta - tags - schedules @@ -308,7 +307,7 @@ publish-release-awss3-nightly: &publish-release-awss3 script: - echo "__________Push binaries to AWS S3____________" - case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in - (beta|stable|nightly) + (stable|nightly) export BUCKET=releases.parity.io/ethereum; ;; (*) diff --git a/parity/cli/mod.rs b/parity/cli/mod.rs index d93195403..caecc9bdf 100644 --- a/parity/cli/mod.rs +++ b/parity/cli/mod.rs @@ -296,7 +296,7 @@ usage! { ARG arg_release_track: (String) = "current", or |c: &Config| c.parity.as_ref()?.release_track.clone(), "--release-track=[TRACK]", - "Set which release track we should use for updates. TRACK can be one of: stable - Stable releases; beta - Beta releases; nightly - Nightly releases (unstable); testing - Testing releases (do not use); current - Whatever track this executable was released on.", + "Set which release track we should use for updates. TRACK can be one of: stable - Stable releases; nightly - Nightly releases (unstable); testing - Testing releases (do not use); current - Whatever track this executable was released on.", ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(), "--chain=[CHAIN]", diff --git a/parity/configuration.rs b/parity/configuration.rs index 05842f7ee..f1b5749f7 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -981,9 +981,7 @@ impl Configuration { }, track: match self.args.arg_release_track.as_ref() { "stable" => ReleaseTrack::Stable, - "beta" => ReleaseTrack::Beta, "nightly" => ReleaseTrack::Nightly, - "testing" => ReleaseTrack::Testing, "current" => ReleaseTrack::Unknown, _ => return Err("Invalid value for `--releases-track`. See `--help` for more information.".into()), }, @@ -1512,23 +1510,11 @@ mod tests { #[test] fn should_parse_updater_options() { // when - let conf0 = parse(&["parity", "--release-track=testing"]); - let conf1 = parse(&["parity", "--auto-update", "all", "--no-consensus", "--auto-update-delay", "300"]); - let conf2 = parse(&["parity", "--no-download", "--auto-update=all", "--release-track=beta", "--auto-update-delay=300", "--auto-update-check-frequency=100"]); - let conf3 = parse(&["parity", "--auto-update=xxx"]); + let conf0 = parse(&["parity", "--auto-update", "all", "--no-consensus", "--auto-update-delay", "300"]); + let conf1 = parse(&["parity", "--auto-update=xxx"]); // then assert_eq!(conf0.update_policy().unwrap(), UpdatePolicy { - enable_downloading: true, - require_consensus: true, - filter: UpdateFilter::Critical, - track: ReleaseTrack::Testing, - path: default_hypervisor_path(), - max_size: 128 * 1024 * 1024, - max_delay: 100, - frequency: 20, - }); - assert_eq!(conf1.update_policy().unwrap(), UpdatePolicy { enable_downloading: true, require_consensus: false, filter: UpdateFilter::All, @@ -1538,17 +1524,7 @@ mod tests { max_delay: 300, frequency: 20, }); - assert_eq!(conf2.update_policy().unwrap(), UpdatePolicy { - enable_downloading: false, - require_consensus: true, - filter: UpdateFilter::All, - track: ReleaseTrack::Beta, - path: default_hypervisor_path(), - max_size: 128 * 1024 * 1024, - max_delay: 300, - frequency: 100, - }); - assert!(conf3.update_policy().is_err()); + assert!(conf1.update_policy().is_err()); } #[test] diff --git a/rpc/src/v1/tests/helpers/update_service.rs b/rpc/src/v1/tests/helpers/update_service.rs index f797eb9b9..b1dd75883 100644 --- a/rpc/src/v1/tests/helpers/update_service.rs +++ b/rpc/src/v1/tests/helpers/update_service.rs @@ -72,7 +72,7 @@ impl UpdateService for TestUpdater { fn version_info(&self) -> VersionInfo { VersionInfo { - track: ReleaseTrack::Beta, + track: ReleaseTrack::Stable, version: Version{major: 1, minor: 5, patch: 0, build: vec![], pre: vec![]}, hash: H160::from_low_u64_be(150), } @@ -84,7 +84,7 @@ impl UpdateService for TestUpdater { this_fork: Some(15000), track: ReleaseInfo { version: VersionInfo { - track: ReleaseTrack::Beta, + track: ReleaseTrack::Stable, version: Version{major: 1, minor: 5, patch: 1, build: vec![], pre: vec![]}, hash: H160::from_low_u64_be(151), }, diff --git a/rpc/src/v1/tests/mocked/parity.rs b/rpc/src/v1/tests/mocked/parity.rs index 35bbe1b29..a9c023f68 100644 --- a/rpc/src/v1/tests/mocked/parity.rs +++ b/rpc/src/v1/tests/mocked/parity.rs @@ -130,7 +130,7 @@ fn rpc_parity_version_info() { let io = deps.default_client(); let request = r#"{"jsonrpc": "2.0", "method": "parity_versionInfo", "params": [], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","result":{"hash":"0x0000000000000000000000000000000000000096","track":"beta","version":{"major":1,"minor":5,"patch":0}},"id":1}"#; + let response = r#"{"jsonrpc":"2.0","result":{"hash":"0x0000000000000000000000000000000000000096","track":"stable","version":{"major":1,"minor":5,"patch":0}},"id":1}"#; assert_eq!(io.handle_request_sync(request), Some(response.to_owned())); } @@ -140,7 +140,7 @@ fn rpc_parity_releases_info() { let io = deps.default_client(); let request = r#"{"jsonrpc": "2.0", "method": "parity_releasesInfo", "params": [], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","result":{"fork":15100,"minor":null,"this_fork":15000,"track":{"binary":"0x00000000000000000000000000000000000000000000000000000000000005e6","fork":15100,"is_critical":true,"version":{"hash":"0x0000000000000000000000000000000000000097","track":"beta","version":{"major":1,"minor":5,"patch":1}}}},"id":1}"#; + let response = r#"{"jsonrpc":"2.0","result":{"fork":15100,"minor":null,"this_fork":15000,"track":{"binary":"0x00000000000000000000000000000000000000000000000000000000000005e6","fork":15100,"is_critical":true,"version":{"hash":"0x0000000000000000000000000000000000000097","track":"stable","version":{"major":1,"minor":5,"patch":1}}}},"id":1}"#; assert_eq!(io.handle_request_sync(request), Some(response.to_owned())); } diff --git a/rpc/src/v1/tests/mocked/parity_set.rs b/rpc/src/v1/tests/mocked/parity_set.rs index 262127713..249d2806f 100644 --- a/rpc/src/v1/tests/mocked/parity_set.rs +++ b/rpc/src/v1/tests/mocked/parity_set.rs @@ -91,7 +91,7 @@ fn rpc_parity_upgrade_ready() { io.extend_with(parity_set_client(&client, &miner, &updater, &network).to_delegate()); let request = r#"{"jsonrpc": "2.0", "method": "parity_upgradeReady", "params": [], "id": 1}"#; - let response = r#"{"jsonrpc":"2.0","result":{"binary":"0x00000000000000000000000000000000000000000000000000000000000005e6","fork":15100,"is_critical":true,"version":{"hash":"0x0000000000000000000000000000000000000097","track":"beta","version":{"major":1,"minor":5,"patch":1}}},"id":1}"#; + let response = r#"{"jsonrpc":"2.0","result":{"binary":"0x00000000000000000000000000000000000000000000000000000000000005e6","fork":15100,"is_critical":true,"version":{"hash":"0x0000000000000000000000000000000000000097","track":"stable","version":{"major":1,"minor":5,"patch":1}}},"id":1}"#; assert_eq!(io.handle_request_sync(request), Some(response.to_owned())); updater.set_updated(true); diff --git a/rpc/src/v1/types/consensus_status.rs b/rpc/src/v1/types/consensus_status.rs index da0a8f477..50dfc5f49 100644 --- a/rpc/src/v1/types/consensus_status.rs +++ b/rpc/src/v1/types/consensus_status.rs @@ -49,8 +49,6 @@ impl Into for CapState { pub enum ReleaseTrack { /// Stable track. Stable, - /// Beta track. - Beta, /// Nightly track. Nightly, /// Testing track. @@ -64,9 +62,7 @@ impl Into for updater::ReleaseTrack { fn into(self) -> ReleaseTrack { match self { updater::ReleaseTrack::Stable => ReleaseTrack::Stable, - updater::ReleaseTrack::Beta => ReleaseTrack::Beta, updater::ReleaseTrack::Nightly => ReleaseTrack::Nightly, - updater::ReleaseTrack::Testing => ReleaseTrack::Testing, updater::ReleaseTrack::Unknown => ReleaseTrack::Unknown, } } diff --git a/scripts/docker/hub/publish-docker.sh b/scripts/docker/hub/publish-docker.sh index 84feedb28..a232cdde8 100755 --- a/scripts/docker/hub/publish-docker.sh +++ b/scripts/docker/hub/publish-docker.sh @@ -23,19 +23,6 @@ case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in --tag "parity/parity:${SCHEDULE_TAG}" \ --file tools/Dockerfile .; docker push "parity/parity:${SCHEDULE_TAG}";; - "beta") - echo "Docker TAGs - 'parity/parity:beta', 'parity/parity:latest', \ - 'parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}'"; - docker build --no-cache \ - --build-arg VCS_REF="${CI_COMMIT_SHA}" \ - --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \ - --tag "parity/parity:beta" \ - --tag "parity/parity:latest" \ - --tag "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}" \ - --file tools/Dockerfile .; - docker push "parity/parity:beta"; - docker push "parity/parity:latest"; - docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}";; "stable") echo "Docker TAGs - 'parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}', 'parity/parity:stable'"; docker build --no-cache \ @@ -45,7 +32,8 @@ case "${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}" in --tag "parity/parity:stable" \ --file tools/Dockerfile .; docker push "parity/parity:${VERSION}-${CI_COMMIT_REF_NAME}"; - docker push "parity/parity:stable";; + docker push "parity/parity:stable"; + docker push "parity/parity:latest";; v[0-9]*.[0-9]*) echo "Docker TAG - 'parity/parity:${VERSION}-${TRACK}'" docker build --no-cache \ diff --git a/scripts/gitlab/publish-snap.sh b/scripts/gitlab/publish-snap.sh index d9f10ce3e..f33be15b6 100755 --- a/scripts/gitlab/publish-snap.sh +++ b/scripts/gitlab/publish-snap.sh @@ -11,7 +11,6 @@ SNAP_PACKAGE="parity_"$VERSION"_"$BUILD_ARCH".snap" # Choose snap release channel based on parity ethereum version track case ${TRACK} in nightly) export GRADE="devel" CHANNEL="edge";; - beta) export GRADE="stable" CHANNEL="beta";; stable) export GRADE="stable" CHANNEL="stable";; *) echo "No release" && exit 0;; esac diff --git a/scripts/gitlab/rust-changes.sh b/scripts/gitlab/rust-changes.sh index 236a20d59..f0283728c 100755 --- a/scripts/gitlab/rust-changes.sh +++ b/scripts/gitlab/rust-changes.sh @@ -7,7 +7,7 @@ echo "__________Checking if Rust files were changed__________" git log --graph --oneline --decorate=short -n 10 case ${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}} in - (beta|stable) + (stable) export GIT_COMPARE=origin/${SCHEDULE_TAG:-${CI_COMMIT_REF_NAME}}~ ;; (master|nightly) diff --git a/updater/src/types/release_track.rs b/updater/src/types/release_track.rs index a5121501c..ab7160c05 100644 --- a/updater/src/types/release_track.rs +++ b/updater/src/types/release_track.rs @@ -24,12 +24,8 @@ use std::fmt; pub enum ReleaseTrack { /// Stable track. Stable = 1, - /// Beta track. - Beta = 2, /// Nightly track. - Nightly = 3, - /// Testing track. - Testing = 4, + Nightly = 2, /// No known track, also "current executable's track" when it's not yet known. Unknown = 0, } @@ -38,9 +34,7 @@ impl fmt::Display for ReleaseTrack { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", match *self { ReleaseTrack::Stable => "stable", - ReleaseTrack::Beta => "beta", ReleaseTrack::Nightly => "nightly", - ReleaseTrack::Testing => "testing", ReleaseTrack::Unknown => "unknown", }) } @@ -50,9 +44,7 @@ impl<'a> From<&'a str> for ReleaseTrack { fn from(s: &'a str) -> Self { match s { "stable" => ReleaseTrack::Stable, - "beta" => ReleaseTrack::Beta, "nightly" => ReleaseTrack::Nightly, - "testing" => ReleaseTrack::Testing, _ => ReleaseTrack::Unknown, } } @@ -62,9 +54,7 @@ impl From for ReleaseTrack { fn from(i: u8) -> Self { match i { 1 => ReleaseTrack::Stable, - 2 => ReleaseTrack::Beta, - 3 => ReleaseTrack::Nightly, - 4 => ReleaseTrack::Testing, + 2 => ReleaseTrack::Nightly, _ => ReleaseTrack::Unknown, } } @@ -83,36 +73,28 @@ mod tests { #[test] fn test_release_track_from() { assert_eq!(ReleaseTrack::Stable, 1u8.into()); - assert_eq!(ReleaseTrack::Beta, 2u8.into()); - assert_eq!(ReleaseTrack::Nightly, 3u8.into()); - assert_eq!(ReleaseTrack::Testing, 4u8.into()); + assert_eq!(ReleaseTrack::Nightly, 2u8.into()); assert_eq!(ReleaseTrack::Unknown, 0u8.into()); } #[test] fn test_release_track_into() { assert_eq!(1u8, u8::from(ReleaseTrack::Stable)); - assert_eq!(2u8, u8::from(ReleaseTrack::Beta)); - assert_eq!(3u8, u8::from(ReleaseTrack::Nightly)); - assert_eq!(4u8, u8::from(ReleaseTrack::Testing)); + assert_eq!(2u8, u8::from(ReleaseTrack::Nightly)); assert_eq!(0u8, u8::from(ReleaseTrack::Unknown)); } #[test] fn test_release_track_from_str() { assert_eq!(ReleaseTrack::Stable, "stable".into()); - assert_eq!(ReleaseTrack::Beta, "beta".into()); assert_eq!(ReleaseTrack::Nightly, "nightly".into()); - assert_eq!(ReleaseTrack::Testing, "testing".into()); assert_eq!(ReleaseTrack::Unknown, "unknown".into()); } #[test] fn test_release_track_into_str() { assert_eq!("stable", ReleaseTrack::Stable.to_string()); - assert_eq!("beta", ReleaseTrack::Beta.to_string()); assert_eq!("nightly", ReleaseTrack::Nightly.to_string()); - assert_eq!("testing", ReleaseTrack::Testing.to_string()); assert_eq!("unknown", ReleaseTrack::Unknown.to_string()); } } diff --git a/updater/src/updater.rs b/updater/src/updater.rs index 059a7de4c..625e8babd 100644 --- a/updater/src/updater.rs +++ b/updater/src/updater.rs @@ -283,8 +283,7 @@ impl OperationsClient for OperationsContractClient { // if the minor version has changed, let's check the minor version on a different track while in_minor.as_ref().expect(PROOF).version.version.minor != this.version.minor { let track = match in_minor.as_ref().expect(PROOF).version.track { - ReleaseTrack::Beta => ReleaseTrack::Stable, - ReleaseTrack::Nightly => ReleaseTrack::Beta, + ReleaseTrack::Nightly => ReleaseTrack::Stable, _ => { in_minor = None; break; } }; @@ -841,7 +840,7 @@ pub mod tests { let rng = FakeGenRange::new(); let this = VersionInfo { - track: ReleaseTrack::Beta, + track: ReleaseTrack::Nightly, version: Version::parse("1.0.0").unwrap(), hash: H160::zero(), }; @@ -881,7 +880,7 @@ pub mod tests { fn new_upgrade(version: &str) -> (VersionInfo, ReleaseInfo, OperationsInfo) { let latest_version = VersionInfo { - track: ReleaseTrack::Beta, + track: ReleaseTrack::Nightly, version: Version::parse(version).unwrap(), hash: H160::from_low_u64_be(1), }; diff --git a/util/version/Cargo.toml b/util/version/Cargo.toml index 65b1be840..7148e2486 100644 --- a/util/version/Cargo.toml +++ b/util/version/Cargo.toml @@ -8,7 +8,7 @@ authors = ["Parity Technologies "] build = "build.rs" [package.metadata] -# This versions track. Should be changed to `stable` or `beta` when on respective branches. +# This versions track. Should be changed to `stable` when on respective branches. # Used by auto-updater and for Parity version string. track = "stable" diff --git a/util/version/src/lib.rs b/util/version/src/lib.rs index 4069ceb30..6b0ac6b73 100644 --- a/util/version/src/lib.rs +++ b/util/version/src/lib.rs @@ -30,7 +30,7 @@ mod generated { #[cfg(feature = "final")] const THIS_TRACK: &'static str = generated::TRACK; -// ^^^ should be reset in Cargo.toml to "stable" or "beta" according to the release branch. +// ^^^ should be reset in Cargo.toml to "stable" according to the release branch. #[cfg(not(feature = "final"))] const THIS_TRACK: &'static str = "unstable";