diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index d4c9fea11..1ff19faac 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -108,12 +108,12 @@ jobs: working-directory: common/jenkins-agents/rust/docker run: | docker build --tag agent-rust-test-ubi8 --file Dockerfile.ubi8 \ - --build-arg rustVersion=1.81.0 \ + --build-arg rustVersion=1.83.0 \ --build-arg rustToolchain=x86_64-unknown-linux-gnu \ - --build-arg cargoNextestVersion=0.9.78 \ - --build-arg cargoLlvmCovVersion=0.6.13 \ - --build-arg cargoGenerateVersion=0.22.0 \ - --build-arg cargoDenyVersion=0.16.1 \ + --build-arg cargoNextestVersion=0.9.87 \ + --build-arg cargoLlvmCovVersion=0.6.15 \ + --build-arg cargoGenerateVersion=0.22.1 \ + --build-arg cargoDenyVersion=0.16.3 \ . jenkins-agent-terraform-2306-ubi8: diff --git a/CHANGELOG.md b/CHANGELOG.md index b7544a554..a1d204967 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Change PDF report zip file name in Cypress Quickstarter ([#1082](https://github.com/opendevstack/ods-quickstarters/pull/1082)) - Included small fixes in e2e-cypress ([#1086](https://github.com/opendevstack/ods-quickstarters/pull/1086)) - Mobile testing enablement adding Appium & Sauce Labs in e2e-spock-geb quickstarter ([#1083](https://github.com/opendevstack/ods-quickstarters/pull/1083)) +- Rust Jenkins agent and Quickstarter updates of January 2025 ([#1087](https://github.com/opendevstack/ods-quickstarters/issues/1087)) ### Added diff --git a/be-rust-axum/Jenkinsfile.template b/be-rust-axum/Jenkinsfile.template index 8d76e6296..e56434569 100644 --- a/be-rust-axum/Jenkinsfile.template +++ b/be-rust-axum/Jenkinsfile.template @@ -65,17 +65,13 @@ def stageCI(def context) { mkdir -p build/test-results/test mkdir -p build/test-results/coverage - # Tests with JUnit XML report as defined in .config/nextest.toml - cargo nextest run --profile ci - - # Coverage with LLVM lcov report from tests - # generate the lcov.info report - cargo llvm-cov nextest --lcov --output-path ./build/test-results/coverage/lcov.info - # generate the html report - cargo llvm-cov nextest report --html - + # Tests with JUnit XML report, as defined in .config/nextest.toml, and coverage LLVM cov report + cargo llvm-cov nextest --profile ci --lcov --output-path ./build/test-results/coverage/lcov.info cp -r target/nextest/ci/results.xml build/test-results/test - cp -r target/llvm-cov/html/ build/test-results/coverage + + # (optional) generate the html report and store it in build/test-results/coverage + # cargo llvm-cov nextest report --html + # cp -r target/llvm-cov/html/ build/test-results/coverage """ } } diff --git a/be-rust-axum/rust-template/.pre-commit-config.yaml b/be-rust-axum/rust-template/.pre-commit-config.yaml index a46c2e369..1b31d29ca 100644 --- a/be-rust-axum/rust-template/.pre-commit-config.yaml +++ b/be-rust-axum/rust-template/.pre-commit-config.yaml @@ -1,10 +1,10 @@ repos: - repo: https://github.com/gitleaks/gitleaks - rev: v8.19.1 + rev: v8.22.1 hooks: - id: gitleaks - repo: https://github.com/EmbarkStudios/cargo-deny - rev: 0.16.1 + rev: 0.16.3 hooks: - id: cargo-deny args: ["--all-features", "check"] # optionally modify the arguments for cargo-deny (default arguments shown here) diff --git a/be-rust-axum/rust-template/Cargo.toml b/be-rust-axum/rust-template/Cargo.toml index cf9cb09b7..cd57a6b42 100644 --- a/be-rust-axum/rust-template/Cargo.toml +++ b/be-rust-axum/rust-template/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" [dependencies] # one can add more dependencies via cargo to Cargo.toml as shown next: cargo add axum -F axum/http2 -axum = { version = "0.7", features = ["http2"] } +axum = { version = "0.8", features = ["http2"] } tokio = { version = "1.40", features = ["rt-multi-thread", "macros", "signal"] } serde = { version = "1.0", features = ["derive"] } @@ -19,7 +19,7 @@ http = "1.1" http-body-util = "0.1" bytes = "1.7" -thiserror = "1.0" +thiserror = "2.0" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["tracing", "env-filter"] } @@ -31,7 +31,7 @@ dotenvy = "0.15" # Nice HTTP middlewares from Tower crate, to be added to router.rs. # Uncomment as per need, check official docs. -# tower-http = { version = "0.5", features = [ +# tower-http = { version = "0.6", features = [ # "trace", # "compression-br", # "propagate-header", diff --git a/be-rust-axum/rust-template/deny.toml b/be-rust-axum/rust-template/deny.toml index 1e608c880..286ba5e0a 100644 --- a/be-rust-axum/rust-template/deny.toml +++ b/be-rust-axum/rust-template/deny.toml @@ -92,7 +92,7 @@ allow = [ "MIT", "Apache-2.0", "Apache-2.0 WITH LLVM-exception", - "Unicode-DFS-2016", + "Unicode-3.0", "BSD-3-Clause", "BSL-1.0" ] diff --git a/be-rust-axum/rust-template/metadata.yml b/be-rust-axum/rust-template/metadata.yml index 35ac78615..7002f343e 100644 --- a/be-rust-axum/rust-template/metadata.yml +++ b/be-rust-axum/rust-template/metadata.yml @@ -1,6 +1,6 @@ --- name: Axum - Rust web framework -description: "Axum is an ergonomic and modular web framework built with Tokio, Tower, and Hyper; written in Rust. Technologies: Axum 0.7.x, Rust 1.81.x" +description: "Axum is an ergonomic and modular web framework built with Tokio, Tower, and Hyper; written in Rust. Technologies: Axum 0.8.x, Rust 1.83.x" supplier: https://github.com/tokio-rs/axum version: 4.x type: ods diff --git a/common/jenkins-agents/rust/ocp-config/bc.yml b/common/jenkins-agents/rust/ocp-config/bc.yml index 69835d5a7..93d04b085 100644 --- a/common/jenkins-agents/rust/ocp-config/bc.yml +++ b/common/jenkins-agents/rust/ocp-config/bc.yml @@ -19,7 +19,7 @@ parameters: - name: RUST_VERSION description: "The Rust version" required: true - value: "1.81.0" + value: "1.83.0" - name: RUST_TOOLCHAIN description: "The Rust target toolchain" required: true @@ -27,19 +27,19 @@ parameters: - name: CARGO_NEXTEST_VERSION description: "The Cargo Nextest testing framework version" required: true - value: "0.9.78" + value: "0.9.87" - name: CARGO_LLVM_COV_VERSION description: "The Cargo LLVM Coverage tool version" required: true - value: "0.6.13" + value: "0.6.15" - name: CARGO_GENERATE_VERSION description: "The Cargo Generate tool version" required: true - value: "0.22.0" + value: "0.22.1" - name: CARGO_DENY_VERSION description: "The Cargo Deny tool version" required: true - value: "0.16.1" + value: "0.16.3" objects: - apiVersion: build.openshift.io/v1 kind: BuildConfig diff --git a/docs/modules/jenkins-agents/pages/rust.adoc b/docs/modules/jenkins-agents/pages/rust.adoc index 9e0132fc3..2d5420dee 100644 --- a/docs/modules/jenkins-agents/pages/rust.adoc +++ b/docs/modules/jenkins-agents/pages/rust.adoc @@ -6,7 +6,7 @@ This agent is used to build / execute Rust code and tools. The image is built in the global `ods` project and is named `jenkins-agent-rust`. It can be referenced in a `Jenkinsfile` with `ods/jenkins-agent-rust`. -Minimum Supported Rust Version (MSRV) **1.79**. It can build **Rust** versions **1.79.x or higher**. +Minimum Supported Rust Version (MSRV) **1.83**. **NOTE**: Current Rust edition in use is **2021**. See https://doc.rust-lang.org/edition-guide/introduction.html[Rust Edition Guide] for further information. @@ -20,3 +20,4 @@ Minimum Supported Rust Version (MSRV) **1.79**. It can build **Rust** versions * == Known limitations No special HTTP Proxy configuration. +Fixed Rust compiler version (although dependending on specific project's dependencies, it can build on lower or higher Minor **Rust** versions from **1.83.x**). diff --git a/docs/modules/quickstarters/pages/be-rust-axum.adoc b/docs/modules/quickstarters/pages/be-rust-axum.adoc index 29c4401e0..b606f764b 100644 --- a/docs/modules/quickstarters/pages/be-rust-axum.adoc +++ b/docs/modules/quickstarters/pages/be-rust-axum.adoc @@ -68,9 +68,11 @@ It contains the basic setup for Docker, Jenkins, SonarQube and OpenShift. == Frameworks used -* https://www.rust-lang.org/[Rust 1.81.x] -* https://github.com/tokio-rs/axum[Axum 0.7.x] +* https://www.rust-lang.org/[Rust 1.83.x] +* https://github.com/tokio-rs/axum[Axum 0.8.x] * https://nexte.st/[Nextest 0.9.x] +* https://github.com/taiki-e/cargo-llvm-cov/[LLVM coverage 0.6.x] +* https://github.com/EmbarkStudios/cargo-deny/[Deny 0.16.x] == Usage - how do you start after you provisioned this quickstarter @@ -136,7 +138,7 @@ version: 1.0.1 type: ods role: backend runtime: rust -runtimeVersion: 1.81.0 +runtimeVersion: 1.83.0 ``` == How this quickstarter is built through Jenkins @@ -176,7 +178,7 @@ The Jenkinsfile is provisioned with this quick starter to ease CI/CD process. In [source,bash] ---- cargo nextest run --profile ci - cargo llvm-cov nextest --lcov + cargo llvm-cov nextest --profile ci --lcov ---- * *Build* - Builds the release target binary and moves it to the docker folder: @@ -192,7 +194,7 @@ include::partials$secret-scanning-with-gitleaks.adoc This quickstarter uses https://www.opendevstack.org/ods-documentation/opendevstack/latest/jenkins-agents/rust.html[Rust] Jenkins builder agent. -**NOTE**: The ODS Jenkins Rust Agent supports Rust versions 1.75.x and above. +**NOTE**: The ODS Jenkins Rust Agent supports Rust versions 1.83.x, and depending on project's dependencies it can also handle Minor Rust versions above and below the supported one. See the docker spec and openshift templates https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/rust[here].