Skip to content

Commit 76c6dfc

Browse files
authored
Migrate to edition 2024 and upgrade dependencies (#65)
This pull request includes several updates to the CI/CD workflows and dependencies to ensure compatibility with newer versions of Ubuntu and Rust. Additionally, there are updates to the `Cargo.toml` file and improvements to the `build.rs` script. ### CI/CD Workflow Updates: * Updated the GitHub Actions workflows to run on `ubuntu-24.04` instead of `ubuntu-20.04` in `.github/workflows/ci.yaml`, `.github/workflows/codecov.yaml`, and `.github/workflows/e2e.yml`. [[1]](diffhunk://#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddL40-L55) [[2]](diffhunk://#diff-d968391b3a7edaed2de53a8c60aa2a164c40c9bf62511aee0d95657672245637L28-R28) [[3]](diffhunk://#diff-3e103440521ada06efd263ae09b259e5507e4b8f7408308dc227621ad9efa31eL30-R49) * Updated the Rust toolchain to `nightly-2025-03-24` and modified the commands to use this version in `.github/workflows/ci.yaml`. [[1]](diffhunk://#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddL76-R80) [[2]](diffhunk://#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddL105-R101) [[3]](diffhunk://#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133ddL116-R120) * Replaced the usage of `actions-rs/tarpaulin` with a manual installation and execution of Tarpaulin in `.github/workflows/codecov.yaml`. * Improved the e2e testing setup by using `uv` for Python dependency management and added a step to list Kafka topics in `.github/workflows/e2e.yml`. ### Dependency Updates: * Updated various dependencies in `Cargo.toml` to their latest versions, including `base64`, `bytes`, `futures-core`, `futures-util`, `hostname`, `parking_lot`, `portable-atomic`, `prost`, `prost-derive`, `rdkafka`, `serde`, `systemstat`, `thiserror`, `tokio`, `tokio-stream`, `tonic`, `tracing`, and `uuid`. * Updated the Rust edition to `2024` and the `rust-version` to `1.85` in `Cargo.toml`. ### Build Script Improvements: * Added the `tonic_build::Config` to the `build.rs` script to configure the Protobuf compiler when the `vendored` feature is enabled. ### Other Changes: * Added licensing information to the `.python-version` file.
1 parent 359ad93 commit 76c6dfc

36 files changed

+2523
-342
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,18 @@ jobs:
3737
- fmt
3838
- check-and-test
3939
- doc
40-
runs-on: ubuntu-20.04
40+
runs-on: ubuntu-24.04
4141
steps:
4242
- uses: actions/checkout@v2
4343
with:
4444
submodules: 'recursive'
4545

4646
license-check:
47-
runs-on: ubuntu-20.04
47+
runs-on: ubuntu-24.04
4848
steps:
4949
- uses: actions/checkout@v2
5050
with:
5151
submodules: 'recursive'
52-
- name: Install Cargo nightly
53-
run: rustup toolchain install nightly-2023-05-19
54-
- name: Cargo minimal versions
55-
run: cargo +nightly-2023-05-19 -Z minimal-versions generate-lockfile
5652
- name: Check License Header
5753
uses: apache/skywalking-eyes/header/@d299844e334855087f18ae1fe3c81ae8d22bc282
5854
with:
@@ -73,15 +69,15 @@ jobs:
7369
7470
7571
fmt:
76-
runs-on: ubuntu-20.04
72+
runs-on: ubuntu-24.04
7773
steps:
7874
- uses: actions/checkout@v2
7975
with:
8076
submodules: 'recursive'
8177
- name: Install Rust toolchain
82-
run: rustup toolchain install nightly-2023-05-19 --component rustfmt
78+
run: rustup toolchain install nightly-2025-03-24 --component rustfmt
8379
- name: Run format
84-
run: cargo +nightly-2023-05-19 fmt --all -- --check
80+
run: cargo +nightly-2025-03-24 fmt --all -- --check
8581

8682
check-and-test:
8783
strategy:
@@ -93,7 +89,7 @@ jobs:
9389
- "--features vendored"
9490
- "--features kafka-reporter"
9591
- "--all-features"
96-
runs-on: ubuntu-20.04
92+
runs-on: ubuntu-24.04
9793
steps:
9894
- uses: actions/checkout@v2
9995
with:
@@ -102,9 +98,7 @@ jobs:
10298
run: sudo apt-get install -y protobuf-compiler
10399
if: ${{ matrix.features != '--features vendored' }}
104100
- name: Install Cargo nightly
105-
run: rustup toolchain install nightly-2023-05-19
106-
- name: Cargo minimal versions
107-
run: cargo +nightly-2023-05-19 -Z minimal-versions generate-lockfile
101+
run: rustup toolchain install nightly-2025-03-24
108102
- name: Run check
109103
run: cargo check --workspace --release ${{ matrix.features }}
110104
- name: Run clippy
@@ -113,14 +107,14 @@ jobs:
113107
run: cargo test --workspace --release ${{ matrix.features }}
114108

115109
doc:
116-
runs-on: ubuntu-20.04
110+
runs-on: ubuntu-24.04
117111
steps:
118112
- uses: actions/checkout@v2
119113
with:
120114
submodules: 'recursive'
121115
- name: Install protoc
122116
run: sudo apt-get install -y protobuf-compiler
123117
- name: Install Rust toolchain
124-
run: rustup toolchain install nightly-2023-05-19
118+
run: rustup toolchain install nightly-2025-03-24
125119
- name: Run docs
126-
run: cargo +nightly-2023-05-19 rustdoc --release --all-features -- --cfg docsrs
120+
run: cargo +nightly-2025-03-24 rustdoc --release --all-features -- --cfg docsrs

.github/workflows/codecov.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
- 'v*'
2626
jobs:
2727
test:
28-
runs-on: ubuntu-20.04
28+
runs-on: ubuntu-24.04
2929
steps:
3030
- uses: actions/checkout@v2
3131
with:
@@ -37,7 +37,8 @@ jobs:
3737
profile: minimal
3838
toolchain: stable
3939
override: true
40-
- uses: actions-rs/tarpaulin@v0.1
41-
with:
42-
version: 0.22.0
40+
- name: Install and Run Tarpaulin
41+
run: |
42+
cargo install cargo-tarpaulin
43+
cargo tarpaulin --out Xml
4344
- uses: codecov/codecov-action@v2.1.0

.github/workflows/e2e.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,23 @@ on:
2727

2828
jobs:
2929
e2e-rust:
30-
runs-on: ubuntu-20.04
30+
runs-on: ubuntu-24.04
3131
steps:
3232
- uses: actions/checkout@v2
3333
with:
3434
submodules: recursive
3535
- name: Prepare service container
36-
run: docker-compose -f docker-compose.e2e.yml up --build -d
36+
run: docker compose -f docker-compose.e2e.yml up --build -d --wait
3737
- name: Run e2e
3838
run: |
39-
pip3 install --upgrade pip
40-
pip3 install setuptools
41-
pip3 install -r requirements.txt
42-
python3 e2e/run_e2e.py --expected_file=e2e/data/expected_context.yaml --max_retry_times=3 --target_path=/ping
43-
docker-compose -f docker-compose.e2e.yml logs producer consumer
44-
docker-compose -f docker-compose.e2e.yml exec -T producer /build/target/release/e2e-kafka
39+
curl -LsSf https://astral.sh/uv/install.sh | sh
40+
uv python install 3.12
41+
uv sync
42+
uv run e2e/run_e2e.py --expected_file=e2e/data/expected_context.yaml --max_retry_times=3 --target_path=/ping
43+
sleep 10
44+
docker compose -f docker-compose.e2e.yml exec broker /opt/kafka/bin/kafka-topics.sh --list --bootstrap-server 127.0.0.1:9092
45+
docker compose -f docker-compose.e2e.yml exec -T producer /build/target/release/e2e-kafka
46+
- name: View logs
47+
if: always()
48+
run: |
49+
docker compose -f docker-compose.e2e.yml logs

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/tests/target
33
/e2e/target
44
.idea/
5-
/Cargo.lock
65
/.cargo/config.toml
76
/vendor
7+
/.venv
8+
/venv

.python-version

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
3.12

0 commit comments

Comments
 (0)