From 6ddc4c5ea6e5e93a0042e188982505ba25cccf76 Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Fri, 3 Jan 2025 22:47:53 +0700 Subject: [PATCH] fix(general): Update cat-ci to latest version to bring in doctest fixes and latest rust compiler (#1462) * fix(general): Bump CI to v3.2.27 to pick up latest rust compiler * fix(general): cleanup project dictionary * fix(cat-gateway): Update vendored rust configs --- .config/dictionaries/project.dic | 2 +- Earthfile | 6 +-- catalyst-gateway/.cargo/config.toml | 6 +-- catalyst-gateway/Earthfile | 2 +- catalyst-gateway/Justfile | 5 ++- .../db/event/legacy/queries/registration.rs | 2 + catalyst-gateway/clippy.toml | 1 + catalyst-gateway/deny.toml | 1 + catalyst-gateway/event-db/Earthfile | 4 +- catalyst-gateway/rust-toolchain.toml | 2 +- catalyst-gateway/tests/Earthfile | 3 +- catalyst-gateway/tests/api_tests/Earthfile | 2 +- catalyst_voices/Earthfile | 2 +- .../wallet-automation/Earthfile | 4 +- .../libs/catalyst_key_derivation/Earthfile | 4 +- .../rust/.cargo/config.toml | 8 +--- .../rust/.config/nextest.toml | 2 +- .../catalyst_key_derivation/rust/Earthfile | 10 ++++- .../catalyst_key_derivation/rust/Justfile | 42 +++++++++++++++++++ .../catalyst_key_derivation/rust/clippy.toml | 1 + .../catalyst_key_derivation/rust/deny.toml | 3 +- .../rust/rust-toolchain.toml | 2 +- .../catalyst_key_derivation/rust/rustfmt.toml | 2 +- .../utilities/uikit_example/Earthfile | 2 +- docs/Earthfile | 2 +- justfile | 3 +- utilities/docs-preview/Earthfile | 2 +- 27 files changed, 86 insertions(+), 39 deletions(-) create mode 100644 catalyst_voices/packages/libs/catalyst_key_derivation/rust/Justfile diff --git a/.config/dictionaries/project.dic b/.config/dictionaries/project.dic index 2290c6efa85..e84d64f0ba0 100644 --- a/.config/dictionaries/project.dic +++ b/.config/dictionaries/project.dic @@ -347,4 +347,4 @@ xprv xpub xpublic xvfb -yoroi \ No newline at end of file +yoroi diff --git a/Earthfile b/Earthfile index 99b54f456cb..5112c3bafca 100644 --- a/Earthfile +++ b/Earthfile @@ -1,8 +1,8 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.24 AS mdlint-ci -IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.24 AS cspell-ci -IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.24 AS postgresql-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.2.27 AS mdlint-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.2.27 AS cspell-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.27 AS postgresql-ci FROM debian:stable-slim diff --git a/catalyst-gateway/.cargo/config.toml b/catalyst-gateway/.cargo/config.toml index 6641db1faae..cd8aa55e3ea 100644 --- a/catalyst-gateway/.cargo/config.toml +++ b/catalyst-gateway/.cargo/config.toml @@ -27,11 +27,7 @@ rustflags = [ [build] rustflags = [] -rustdocflags = [ - "--enable-index-page", - "-Z", - "unstable-options", -] +rustdocflags = [] [profile.dev] opt-level = 1 diff --git a/catalyst-gateway/Earthfile b/catalyst-gateway/Earthfile index e2b4735ac9e..6eeb4e6fad6 100644 --- a/catalyst-gateway/Earthfile +++ b/catalyst-gateway/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.24 AS rust-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.27 AS rust-ci #cspell: words rustfmt toolsets USERARCH stdcfgs diff --git a/catalyst-gateway/Justfile b/catalyst-gateway/Justfile index 32ae8fa693f..d337e2719e8 100644 --- a/catalyst-gateway/Justfile +++ b/catalyst-gateway/Justfile @@ -13,7 +13,7 @@ cargo-tree: # Check Dependency licenses and CVE's license-check: - cargo deny check --exclude-dev + cargo deny check --exclude-dev || true # Format the rust code code-format: @@ -27,7 +27,8 @@ code-lint: # Synchronize Rust Configs sync-cfg: - cd .. && earthly ./catalyst-gateway+sync-cfg + cd .. && \ + earthly ./catalyst-gateway+sync-cfg # Pre Push Checks pre-push: sync-cfg code-format code-lint license-check diff --git a/catalyst-gateway/bin/src/db/event/legacy/queries/registration.rs b/catalyst-gateway/bin/src/db/event/legacy/queries/registration.rs index cf7ae11a4dc..241edb52d97 100644 --- a/catalyst-gateway/bin/src/db/event/legacy/queries/registration.rs +++ b/catalyst-gateway/bin/src/db/event/legacy/queries/registration.rs @@ -73,6 +73,7 @@ impl EventDB { impl EventDB { /// Get voter query #[allow(dead_code)] + #[allow(clippy::ref_option)] pub(crate) async fn get_voter( event: &Option, voting_key: String, with_delegations: bool, ) -> anyhow::Result { @@ -156,6 +157,7 @@ impl EventDB { /// Get delegator query #[allow(dead_code)] + #[allow(clippy::ref_option)] pub(crate) async fn get_delegator( event: &Option, stake_public_key: String, ) -> anyhow::Result { diff --git a/catalyst-gateway/clippy.toml b/catalyst-gateway/clippy.toml index 0358cdb508c..7bada5473be 100644 --- a/catalyst-gateway/clippy.toml +++ b/catalyst-gateway/clippy.toml @@ -1,2 +1,3 @@ allow-unwrap-in-tests = true allow-expect-in-tests = true +allow-panic-in-tests = true diff --git a/catalyst-gateway/deny.toml b/catalyst-gateway/deny.toml index cb00059926d..20876ac49c8 100644 --- a/catalyst-gateway/deny.toml +++ b/catalyst-gateway/deny.toml @@ -57,6 +57,7 @@ allow-git = [ "https://github.com/txpipe/vrf", "https://github.com/txpipe/kes", "https://github.com/txpipe/curve25519-dalek", + "https://github.com/input-output-hk/mithril", ] [licenses] diff --git a/catalyst-gateway/event-db/Earthfile b/catalyst-gateway/event-db/Earthfile index 4b004d1ea62..47dc36a839b 100644 --- a/catalyst-gateway/event-db/Earthfile +++ b/catalyst-gateway/event-db/Earthfile @@ -3,8 +3,8 @@ # the database and its associated software. VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.24 AS postgresql-ci -IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.2.24 AS python-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/postgresql:v3.2.27 AS postgresql-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.2.27 AS python-ci # cspell: words diff --git a/catalyst-gateway/rust-toolchain.toml b/catalyst-gateway/rust-toolchain.toml index f01d02df3be..eb1d9794598 100644 --- a/catalyst-gateway/rust-toolchain.toml +++ b/catalyst-gateway/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.81" +channel = "1.83" profile = "default" \ No newline at end of file diff --git a/catalyst-gateway/tests/Earthfile b/catalyst-gateway/tests/Earthfile index 421c6934771..251e750ecf2 100644 --- a/catalyst-gateway/tests/Earthfile +++ b/catalyst-gateway/tests/Earthfile @@ -1,6 +1,5 @@ VERSION 0.8 - -IMPORT github.com/input-output-hk/catalyst-ci/earthly/spectral:v3.2.24 AS spectral-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/spectral:v3.2.27 AS spectral-ci IMPORT .. AS gateway # cspell: words oapi diff --git a/catalyst-gateway/tests/api_tests/Earthfile b/catalyst-gateway/tests/api_tests/Earthfile index e0bb11a20cb..94545c5c634 100644 --- a/catalyst-gateway/tests/api_tests/Earthfile +++ b/catalyst-gateway/tests/api_tests/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.2.24 AS python-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.2.27 AS python-ci builder: FROM python-ci+python-base diff --git a/catalyst_voices/Earthfile b/catalyst_voices/Earthfile index 15cd041e617..8dd8053bba2 100644 --- a/catalyst_voices/Earthfile +++ b/catalyst_voices/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 IMPORT ../catalyst-gateway AS catalyst-gateway -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.24 AS flutter-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.27 AS flutter-ci # repo-catalyst-voices - Creates artifacts of all configuration files, # packages and folders related to catalyst_voices frontend. diff --git a/catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/Earthfile b/catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/Earthfile index abfda491cbb..7aaf72302a3 100644 --- a/catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/Earthfile +++ b/catalyst_voices/packages/libs/catalyst_cardano/catalyst_cardano/wallet-automation/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.24 AS flutter-ci -IMPORT github.com/input-output-hk/catalyst-ci/earthly/playwright:v3.2.24 AS playwright-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.27 AS flutter-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/playwright:v3.2.27 AS playwright-ci deps: DO playwright-ci+SETUP --workdir=/wallet-automation diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/Earthfile b/catalyst_voices/packages/libs/catalyst_key_derivation/Earthfile index 8734f8828b7..4563ebd6cb9 100644 --- a/catalyst_voices/packages/libs/catalyst_key_derivation/Earthfile +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.24 AS flutter-ci -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter_rust_bridge:v3.2.24 AS flutter_rust_bridge +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.27 AS flutter-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter_rust_bridge:v3.2.27 AS flutter_rust_bridge builder: FROM flutter_rust_bridge+builder diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/.cargo/config.toml b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/.cargo/config.toml index 061a40c093c..cd8aa55e3ea 100644 --- a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/.cargo/config.toml +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/.cargo/config.toml @@ -27,11 +27,7 @@ rustflags = [ [build] rustflags = [] -rustdocflags = [ - "--enable-index-page", - "-Z", - "unstable-options", -] +rustdocflags = [] [profile.dev] opt-level = 1 @@ -90,4 +86,4 @@ quiet = false # whether cargo output is quiet verbose = false # whether cargo provides verbose output color = "auto" # whether cargo colorizes output use `CARGO_TERM_COLOR="off"` to disable. progress.when = "never" # whether cargo shows progress bar -progress.width = 80 # width of progress bar \ No newline at end of file +progress.width = 80 # width of progress bar diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/.config/nextest.toml b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/.config/nextest.toml index de5cf9b1ef9..be3673830bb 100644 --- a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/.config/nextest.toml +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/.config/nextest.toml @@ -46,4 +46,4 @@ store-success-output = true # # Note that if a description can be extracted from the output, it is always stored in the # element. -store-failure-output = true \ No newline at end of file +store-failure-output = true diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/Earthfile b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/Earthfile index d314b28f4d1..af92fbbf323 100644 --- a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/Earthfile +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.24 AS rust-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.2.27 AS rust-ci IMPORT ../ AS flutter-rust-bridge # builder : Setup the builder @@ -22,4 +22,10 @@ build: COPY flutter-rust-bridge+code-generator/frb_generated.rs ./src/frb_generated.rs DO rust-ci+EXECUTE \ - --cmd="/scripts/std_build.py" \ + --cmd="/scripts/std_build.py" + +# sync-cfg: Synchronize local config with CI version. +# Must be run by the developer manually. +sync-cfg: + FROM +builder + DO rust-ci+SYNC_STD_CFG diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/Justfile b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/Justfile new file mode 100644 index 00000000000..a2602035d8c --- /dev/null +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/Justfile @@ -0,0 +1,42 @@ +# use with https://github.com/casey/just +# +# Developer convenience functions + +# cspell: words prereqs, commitlog, rustls, nocapture + +default: + @just --list --unsorted + +# Show the dependency tree and all enabled feature flags of every crate. +cargo-tree: + cargo tree -e features,normal,build -f "{p}[{f}]" --workspace --frozen + +# Check Dependency licenses and CVE's +license-check: + cargo deny check --exclude-dev || true + +# Format the rust code +code-format: + # Create a dummy file just to past the CI format check + # Add another blank line to satisfy the cargo fmt check + #printf "\n" > ./src/frb_generated.rs + + #cargo +nightly fmtfix + #cargo +nightly fmtchk + +# Lint the rust code +code-lint: + #cargo lintfix -r + #cargo lint -r + +# Synchronize Rust Configs +sync-cfg: + cd ../../../../.. && \ + earthly ./catalyst_voices/packages/libs/catalyst_key_derivation/rust+sync-cfg + +# Pre Push Checks +pre-push: sync-cfg code-format code-lint license-check + # Make sure we can actually build inside Earthly which needs to happen in CI. + cd ../../../../.. && \ + earthly ./catalyst_voices/packages/libs/catalyst_key_derivation/rust+check && \ + earthly ./catalyst_voices/packages/libs/catalyst_key_derivation/rust+build diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/clippy.toml b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/clippy.toml index 0358cdb508c..7bada5473be 100644 --- a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/clippy.toml +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/clippy.toml @@ -1,2 +1,3 @@ allow-unwrap-in-tests = true allow-expect-in-tests = true +allow-panic-in-tests = true diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/deny.toml b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/deny.toml index b8a4f8ee74c..20876ac49c8 100644 --- a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/deny.toml +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/deny.toml @@ -57,6 +57,7 @@ allow-git = [ "https://github.com/txpipe/vrf", "https://github.com/txpipe/kes", "https://github.com/txpipe/curve25519-dalek", + "https://github.com/input-output-hk/mithril", ] [licenses] @@ -120,4 +121,4 @@ license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }] #[[licenses.clarify]] #crate = "rustls-webpki" #expression = "ISC" -#license-files = [{ path = "LICENSE", hash = 0x001c7e6c }] \ No newline at end of file +#license-files = [{ path = "LICENSE", hash = 0x001c7e6c }] diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/rust-toolchain.toml b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/rust-toolchain.toml index f01d02df3be..eb1d9794598 100644 --- a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/rust-toolchain.toml +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.81" +channel = "1.83" profile = "default" \ No newline at end of file diff --git a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/rustfmt.toml b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/rustfmt.toml index fa6d8c2e906..905bde2d0bd 100644 --- a/catalyst_voices/packages/libs/catalyst_key_derivation/rust/rustfmt.toml +++ b/catalyst_voices/packages/libs/catalyst_key_derivation/rust/rustfmt.toml @@ -65,4 +65,4 @@ condense_wildcard_suffixes = true hex_literal_case = "Upper" # Ignored files: -ignore = [] \ No newline at end of file +ignore = [] diff --git a/catalyst_voices/utilities/uikit_example/Earthfile b/catalyst_voices/utilities/uikit_example/Earthfile index fd8241806c2..65cf84c4db4 100644 --- a/catalyst_voices/utilities/uikit_example/Earthfile +++ b/catalyst_voices/utilities/uikit_example/Earthfile @@ -1,7 +1,7 @@ VERSION 0.8 IMPORT ../../ AS catalyst-voices -IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.24 AS flutter-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/flutter:v3.2.27 AS flutter-ci # local-build-web - build web version of UIKit example. # Prefixed by "local" to make sure it's not auto triggered, the target was diff --git a/docs/Earthfile b/docs/Earthfile index 2f5f2872d8b..0e82903ad50 100644 --- a/docs/Earthfile +++ b/docs/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.24 AS docs-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.27 AS docs-ci IMPORT .. AS repo IMPORT ../catalyst-gateway AS catalyst-gateway diff --git a/justfile b/justfile index 2446ee2be6b..a0cde7b41b9 100644 --- a/justfile +++ b/justfile @@ -19,7 +19,8 @@ check-spelling: # Pre Push Checks - intended to be run by a git pre-push hook. pre-push: check-markdown check-spelling just catalyst-gateway/pre-push - just catalyst_voices/pre-push + # just catalyst_voices/pre-push + just catalyst_voices/packages/libs/catalyst_key_derivation/rust/pre-push earthly ./catalyst_voices+code-generator --platform=linux/amd64 --save_locally=true # Run cat-gateway natively on preprod diff --git a/utilities/docs-preview/Earthfile b/utilities/docs-preview/Earthfile index 429e63bf583..1d2607d1d9d 100644 --- a/utilities/docs-preview/Earthfile +++ b/utilities/docs-preview/Earthfile @@ -1,6 +1,6 @@ VERSION 0.8 -IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.24 AS docs-ci +IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.2.27 AS docs-ci # update-docs-dev-script: get the latest docs dev script from CI.