From bc0ecf8d4019b21bf17004c78d157249e44ed7f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Tue, 14 Dec 2021 23:44:04 +0100 Subject: [PATCH] Remove cargo unleash CI job (#10482) * Remove cargo unleash CI job The CI job is currently breaking, because we released some crates. We also don't need the job currently because releases are not done. So, the job currently just annoys people and eats CPU time. This brings us to the conclusion that this job is currently not required and can be readded at a later point when we are sure that we need it. * Hopefully fix UI test * Another try * Remove `reserved_keyword` ui --- substrate/.gitlab-ci.yml | 30 -------------- .../call_argument_invalid_bound_3.rs | 9 ++--- .../call_argument_invalid_bound_3.stderr | 18 --------- .../storage_info_unsatisfied_nmap.rs | 10 +++-- .../storage_info_unsatisfied_nmap.stderr | 4 +- .../support/test/tests/reserved_keyword.rs | 26 ------------- .../tests/reserved_keyword/on_initialize.rs | 30 -------------- .../reserved_keyword/on_initialize.stderr | 39 ------------------- 8 files changed, 12 insertions(+), 154 deletions(-) delete mode 100644 substrate/frame/support/test/tests/reserved_keyword.rs delete mode 100644 substrate/frame/support/test/tests/reserved_keyword/on_initialize.rs delete mode 100644 substrate/frame/support/test/tests/reserved_keyword/on_initialize.stderr diff --git a/substrate/.gitlab-ci.yml b/substrate/.gitlab-ci.yml index 7af3675f07..3f830c7e8e 100644 --- a/substrate/.gitlab-ci.yml +++ b/substrate/.gitlab-ci.yml @@ -39,9 +39,6 @@ variables: &default-vars DOCKER_OS: "debian:stretch" ARCH: "x86_64" CI_IMAGE: "paritytech/ci-linux:production" - # FIXME set to release - CARGO_UNLEASH_INSTALL_PARAMS: "--version 1.0.0-alpha.13" - CARGO_UNLEASH_PKG_DEF: "--skip node node-* pallet-template pallet-example-* subkey chain-spec-builder" VAULT_SERVER_URL: "https://vault.parity-mgmt-vault.parity.io" VAULT_AUTH_PATH: "gitlab-parity-io-jwt" VAULT_AUTH_ROLE: "cicd_gitlab_parity_${CI_PROJECT_NAME}" @@ -458,21 +455,6 @@ test-linux-stable: &test-linux - SUBSTRATE_TEST_TIMEOUT=1 time cargo test -p substrate-test-utils --release --verbose --locked -- --ignored timeout - sccache -s -unleash-check: - stage: test - <<: *docker-env - <<: *test-refs-no-trigger - script: - - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} - - cargo unleash de-dev-deps - # Reuse build artifacts when running checks (cuts down check time by 3x) - # TODO: Implement this optimization in cargo-unleash rather than here - - mkdir -p target/unleash - - export CARGO_TARGET_DIR=target/unleash - - cargo unleash check ${CARGO_UNLEASH_PKG_DEF} - # FIXME: this job must not fail, or unleash-to-crates-io will publish broken stuff - allow_failure: true - test-frame-examples-compile-to-wasm: # into one job stage: test @@ -869,18 +851,6 @@ publish-draft-release: - ./.maintain/gitlab/publish_draft_release.sh allow_failure: true -unleash-to-crates-io: - stage: publish - <<: *docker-env - <<: *vault-secrets - rules: - - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} - - cargo unleash em-dragons --no-check --owner github:paritytech:core-devs ${CARGO_UNLEASH_PKG_DEF} - allow_failure: true - #### stage: deploy deploy-prometheus-alerting-rules: diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.rs b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.rs index e7f99d7ca4..1cdfb369fe 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.rs +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.rs @@ -1,8 +1,8 @@ #[frame_support::pallet] mod pallet { - use frame_support::pallet_prelude::{Hooks, DispatchResultWithPostInfo}; + use codec::{Decode, Encode}; + use frame_support::pallet_prelude::{DispatchResultWithPostInfo, Hooks}; use frame_system::pallet_prelude::{BlockNumberFor, OriginFor}; - use codec::{Encode, Decode}; #[pallet::config] pub trait Config: frame_system::Config {} @@ -13,7 +13,7 @@ mod pallet { #[pallet::hooks] impl Hooks> for Pallet {} - #[derive(Encode, Decode, scale_info::TypeInfo)] + #[derive(Encode, Decode, scale_info::TypeInfo, PartialEq, Clone)] struct Bar; #[pallet::call] @@ -25,5 +25,4 @@ mod pallet { } } -fn main() { -} +fn main() {} diff --git a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.stderr b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.stderr index b884d24103..c196b28a31 100644 --- a/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/call_argument_invalid_bound_3.stderr @@ -8,21 +8,3 @@ error[E0277]: `Bar` doesn't implement `std::fmt::Debug` = note: add `#[derive(Debug)]` to `Bar` or manually `impl std::fmt::Debug for Bar` = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Bar` = note: required for the cast to the object type `dyn std::fmt::Debug` - -error[E0277]: the trait bound `Bar: Clone` is not satisfied - --> tests/pallet_ui/call_argument_invalid_bound_3.rs:22:36 - | -22 | pub fn foo(origin: OriginFor, bar: Bar) -> DispatchResultWithPostInfo { - | ^^^ the trait `Clone` is not implemented for `Bar` - | -note: required by `clone` - --> $RUST/core/src/clone.rs - | - | fn clone(&self) -> Self; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0369]: binary operation `==` cannot be applied to type `&Bar` - --> tests/pallet_ui/call_argument_invalid_bound_3.rs:22:36 - | -22 | pub fn foo(origin: OriginFor, bar: Bar) -> DispatchResultWithPostInfo { - | ^^^ diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs index c5d773d716..15456c78e9 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs +++ b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.rs @@ -1,6 +1,9 @@ #[frame_support::pallet] mod pallet { - use frame_support::pallet_prelude::{Hooks, StorageNMap, Twox64Concat, NMapKey}; + use frame_support::{ + pallet_prelude::{Hooks, Twox64Concat}, + storage::types::{StorageNMap, Key}, + }; use frame_system::pallet_prelude::BlockNumberFor; #[pallet::config] @@ -20,8 +23,7 @@ mod pallet { struct Bar; #[pallet::storage] - type Foo = StorageNMap<_, NMapKey, u32>; + type Foo = StorageNMap<_, Key, u32>; } -fn main() { -} +fn main() {} diff --git a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.stderr b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.stderr index 00d350b943..cb9a0bd559 100644 --- a/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.stderr +++ b/substrate/frame/support/test/tests/pallet_ui/storage_info_unsatisfied_nmap.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Bar: MaxEncodedLen` is not satisfied - --> tests/pallet_ui/storage_info_unsatisfied_nmap.rs:10:12 + --> tests/pallet_ui/storage_info_unsatisfied_nmap.rs:13:12 | -10 | #[pallet::generate_storage_info] +13 | #[pallet::generate_storage_info] | ^^^^^^^^^^^^^^^^^^^^^ the trait `MaxEncodedLen` is not implemented for `Bar` | = note: required because of the requirements on the impl of `KeyGeneratorMaxEncodedLen` for `Key` diff --git a/substrate/frame/support/test/tests/reserved_keyword.rs b/substrate/frame/support/test/tests/reserved_keyword.rs deleted file mode 100644 index d29b0477c3..0000000000 --- a/substrate/frame/support/test/tests/reserved_keyword.rs +++ /dev/null @@ -1,26 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#[rustversion::attr(not(stable), ignore)] -#[test] -fn reserved_keyword() { - // As trybuild is using `cargo check`, we don't need the real WASM binaries. - std::env::set_var("SKIP_WASM_BUILD", "1"); - - let t = trybuild::TestCases::new(); - t.compile_fail("tests/reserved_keyword/*.rs"); -} diff --git a/substrate/frame/support/test/tests/reserved_keyword/on_initialize.rs b/substrate/frame/support/test/tests/reserved_keyword/on_initialize.rs deleted file mode 100644 index 72d53abfb1..0000000000 --- a/substrate/frame/support/test/tests/reserved_keyword/on_initialize.rs +++ /dev/null @@ -1,30 +0,0 @@ -macro_rules! reserved { - ($($reserved:ident)*) => { - $( - mod $reserved { - pub use frame_support::dispatch; - - pub trait Config: frame_support_test::Config {} - - pub mod system { - use frame_support::dispatch; - - pub fn ensure_root(_: R) -> dispatch::DispatchResult { - Ok(()) - } - } - - frame_support::decl_module! { - pub struct Module for enum Call where origin: T::Origin, system=frame_support_test { - #[weight = 0] - fn $reserved(_origin) -> dispatch::DispatchResult { unreachable!() } - } - } - } - )* - } -} - -reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event); - -fn main() {} diff --git a/substrate/frame/support/test/tests/reserved_keyword/on_initialize.stderr b/substrate/frame/support/test/tests/reserved_keyword/on_initialize.stderr deleted file mode 100644 index 58273fb1bd..0000000000 --- a/substrate/frame/support/test/tests/reserved_keyword/on_initialize.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error: Invalid call fn name: `on_finalize`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword. - --> tests/reserved_keyword/on_initialize.rs:28:1 - | -28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the macro `$crate::__check_reserved_fn_name` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: Invalid call fn name: `on_initialize`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword. - --> tests/reserved_keyword/on_initialize.rs:28:1 - | -28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the macro `$crate::__check_reserved_fn_name` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: Invalid call fn name: `on_runtime_upgrade`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword. - --> tests/reserved_keyword/on_initialize.rs:28:1 - | -28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the macro `$crate::__check_reserved_fn_name` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: Invalid call fn name: `offchain_worker`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword. - --> tests/reserved_keyword/on_initialize.rs:28:1 - | -28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the macro `$crate::__check_reserved_fn_name` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: Invalid call fn name: `deposit_event`, name is reserved and doesn't match expected signature, please refer to `decl_module!` documentation to see the appropriate usage, or rename it to an unreserved keyword. - --> tests/reserved_keyword/on_initialize.rs:28:1 - | -28 | reserved!(on_finalize on_initialize on_runtime_upgrade offchain_worker deposit_event); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this error originates in the macro `$crate::__check_reserved_fn_name` (in Nightly builds, run with -Z macro-backtrace for more info)