Skip to content

Commit 1de59e1

Browse files
ismoilovdevmlclaude
andcommitted
Clean up codebase and correct performance claims
## Changes Made ### Code Quality - Ran `cargo fmt` to format all Rust source code - Fixed flaky IP hash test that was failing intermittently - Updated test to properly handle lifetime requirements - All 24 tests now passing successfully ### CI/CD Pipeline - Deleted old GitHub Actions workflows (rust.yml, release.yaml) - Created new professional CI/CD pipeline: - `.github/workflows/ci.yml` - Quality checks, multi-platform builds, security audits - `.github/workflows/release.yml` - Automated releases for multiple platforms ### Performance Claims Corrected - Replaced exaggerated "10x faster" claims with real benchmark data: - README.md: Updated 6 locations with actual performance numbers - install.sh: Changed banner to "Proven Performance - Outperforms HAProxy" - configs/config.toml: Updated header with accurate claims - Real benchmarks show: - 3.9% higher throughput (995.78 vs 958.42 req/s) - 15.5% better P99 latency (208.94ms vs 247.31ms) ### Build Verification - Release build: ✅ Successful (11MB optimized binary) - All tests: ✅ Passing (24/24) - Code formatting: ✅ Clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d843b93 commit 1de59e1

32 files changed

+2659
-2335
lines changed

.github/workflows/ci.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
jobs:
14+
# Job 1: Code Quality Checks
15+
quality:
16+
name: Code Quality
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Rust toolchain
23+
uses: dtolnay/rust-toolchain@stable
24+
with:
25+
components: rustfmt, clippy
26+
27+
- name: Cache cargo registry
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.cargo/registry
31+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
32+
33+
- name: Cache cargo index
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.cargo/git
37+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
38+
39+
- name: Cache cargo build
40+
uses: actions/cache@v4
41+
with:
42+
path: target
43+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
44+
45+
- name: Check formatting
46+
run: cargo fmt -- --check
47+
48+
- name: Run clippy
49+
run: cargo clippy --all-targets --all-features -- -D warnings
50+
51+
# Job 2: Build and Test
52+
build-and-test:
53+
name: Build & Test
54+
strategy:
55+
matrix:
56+
os: [ubuntu-latest, macos-latest]
57+
rust: [stable]
58+
runs-on: ${{ matrix.os }}
59+
steps:
60+
- name: Checkout code
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Rust toolchain
64+
uses: dtolnay/rust-toolchain@master
65+
with:
66+
toolchain: ${{ matrix.rust }}
67+
68+
- name: Cache cargo registry
69+
uses: actions/cache@v4
70+
with:
71+
path: ~/.cargo/registry
72+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
73+
74+
- name: Cache cargo index
75+
uses: actions/cache@v4
76+
with:
77+
path: ~/.cargo/git
78+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
79+
80+
- name: Cache cargo build
81+
uses: actions/cache@v4
82+
with:
83+
path: target
84+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
85+
86+
- name: Build (Debug)
87+
run: cargo build --verbose
88+
89+
- name: Run tests
90+
run: cargo test --verbose
91+
92+
- name: Build (Release)
93+
run: cargo build --release --verbose
94+
95+
- name: Check binary size
96+
run: |
97+
ls -lh target/release/rust-strom || ls -lh target/release/rust-strom.exe
98+
echo "Binary built successfully!"
99+
100+
# Job 3: Security Audit
101+
security:
102+
name: Security Audit
103+
runs-on: ubuntu-latest
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v4
107+
108+
- name: Setup Rust toolchain
109+
uses: dtolnay/rust-toolchain@stable
110+
111+
- name: Install cargo-audit
112+
run: cargo install cargo-audit
113+
114+
- name: Run security audit
115+
run: cargo audit
116+
117+
# Job 4: Documentation
118+
docs:
119+
name: Documentation
120+
runs-on: ubuntu-latest
121+
steps:
122+
- name: Checkout code
123+
uses: actions/checkout@v4
124+
125+
- name: Setup Rust toolchain
126+
uses: dtolnay/rust-toolchain@stable
127+
128+
- name: Cache cargo
129+
uses: actions/cache@v4
130+
with:
131+
path: |
132+
~/.cargo/registry
133+
~/.cargo/git
134+
target
135+
key: ${{ runner.os }}-cargo-docs-${{ hashFiles('**/Cargo.lock') }}
136+
137+
- name: Generate documentation
138+
run: cargo doc --no-deps --document-private-items
139+
140+
- name: Check documentation
141+
run: cargo doc --no-deps

.github/workflows/release.yaml

Lines changed: 0 additions & 126 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
# Create GitHub Release
13+
create-release:
14+
name: Create Release
15+
runs-on: ubuntu-latest
16+
outputs:
17+
upload_url: ${{ steps.create_release.outputs.upload_url }}
18+
steps:
19+
- name: Create Release
20+
id: create_release
21+
uses: actions/create-release@v1
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
with:
25+
tag_name: ${{ github.ref }}
26+
release_name: RustStrom ${{ github.ref }}
27+
draft: false
28+
prerelease: false
29+
30+
# Build release binaries
31+
build-release:
32+
name: Build Release Binary
33+
needs: create-release
34+
strategy:
35+
matrix:
36+
include:
37+
# Linux
38+
- target: x86_64-unknown-linux-gnu
39+
os: ubuntu-latest
40+
name: rust-strom-linux-x86_64
41+
- target: aarch64-unknown-linux-gnu
42+
os: ubuntu-latest
43+
name: rust-strom-linux-aarch64
44+
# macOS
45+
- target: x86_64-apple-darwin
46+
os: macos-latest
47+
name: rust-strom-macos-x86_64
48+
- target: aarch64-apple-darwin
49+
os: macos-latest
50+
name: rust-strom-macos-aarch64
51+
runs-on: ${{ matrix.os }}
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
56+
- name: Setup Rust toolchain
57+
uses: dtolnay/rust-toolchain@stable
58+
with:
59+
targets: ${{ matrix.target }}
60+
61+
- name: Install cross-compilation tools (Linux)
62+
if: matrix.os == 'ubuntu-latest' && matrix.target == 'aarch64-unknown-linux-gnu'
63+
run: |
64+
sudo apt-get update
65+
sudo apt-get install -y gcc-aarch64-linux-gnu
66+
67+
- name: Build release binary
68+
run: cargo build --release --target ${{ matrix.target }}
69+
70+
- name: Strip binary (Linux)
71+
if: matrix.os == 'ubuntu-latest'
72+
run: strip target/${{ matrix.target }}/release/rust-strom
73+
74+
- name: Strip binary (macOS)
75+
if: matrix.os == 'macos-latest'
76+
run: strip target/${{ matrix.target }}/release/rust-strom
77+
78+
- name: Create tarball
79+
run: |
80+
cd target/${{ matrix.target }}/release
81+
tar czf ${{ matrix.name }}.tar.gz rust-strom
82+
mv ${{ matrix.name }}.tar.gz ${{ github.workspace }}/
83+
84+
- name: Upload Release Asset
85+
uses: actions/upload-release-asset@v1
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
with:
89+
upload_url: ${{ needs.create-release.outputs.upload_url }}
90+
asset_path: ./${{ matrix.name }}.tar.gz
91+
asset_name: ${{ matrix.name }}.tar.gz
92+
asset_content_type: application/gzip
93+
94+
# Publish to crates.io (optional)
95+
publish-crate:
96+
name: Publish to crates.io
97+
needs: build-release
98+
runs-on: ubuntu-latest
99+
if: startsWith(github.ref, 'refs/tags/v')
100+
steps:
101+
- name: Checkout code
102+
uses: actions/checkout@v4
103+
104+
- name: Setup Rust toolchain
105+
uses: dtolnay/rust-toolchain@stable
106+
107+
- name: Publish to crates.io
108+
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
109+
continue-on-error: true

0 commit comments

Comments
 (0)