Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8d50059
feat(rust): differ poc (#542)
bzp2010 Aug 1, 2026
6573d00
test: rust differ (#543)
bzp2010 Aug 1, 2026
c8153f8
feat: rust resource type (#544)
bzp2010 Aug 1, 2026
e62ba61
feat: rust diff event type (#547)
bzp2010 Aug 1, 2026
949e88b
feat: rust backend type (#548)
bzp2010 Aug 1, 2026
bf48d78
feat: rust backend core (#549)
bzp2010 Aug 1, 2026
690bba8
feat: rust backend apisix (#550)
bzp2010 Aug 2, 2026
d3bf181
feat: rust cli (#551)
bzp2010 Aug 4, 2026
b110bfa
feat: rust backend api7 (#555)
bzp2010 Aug 5, 2026
4302449
feat: rust backend apisix standalone (#559)
bzp2010 Aug 6, 2026
a789222
feat: oas converter (#562)
bzp2010 Aug 16, 2026
775ba63
chore: clean benchmark crates (#563)
bzp2010 Aug 16, 2026
689faa5
fix comments
bzp2010 Aug 16, 2026
385ff90
clean code comments
bzp2010 Aug 16, 2026
b8c6163
fix comments
bzp2010 Aug 18, 2026
569d322
feat: rust lint (#564)
bzp2010 Aug 18, 2026
bd24d73
feat: rust ingress server (#565)
bzp2010 Aug 19, 2026
ae03053
fix: api7 format fp numbers for timeout correctly (#566)
bzp2010 Aug 20, 2026
baf5e24
test: rust add api7 timeout real float point number (#567)
bzp2010 Aug 22, 2026
500d63b
fix: rust clippy result err size lint (#568)
bzp2010 Aug 22, 2026
d38baad
fix: review 260822-1 (#569)
bzp2010 Aug 22, 2026
987ee15
fix: rust standalone race conditon between dump and sync (#570)
bzp2010 Aug 22, 2026
2b330cd
fix: rust standalone dump race condition (#572)
bzp2010 Aug 23, 2026
ef1603c
feat: rust internalize only sub event type (#573)
bzp2010 Aug 23, 2026
d60f5b2
feat: rust manually review 260823 (#574)
bzp2010 Aug 23, 2026
f9ccab2
fix comments
bzp2010 Aug 23, 2026
40b5d78
fix: rust revert api7 multiple certs support
bzp2010 Aug 23, 2026
75bb727
fix e2e
bzp2010 Aug 24, 2026
10a4e97
ci: add release jobs
bzp2010 Aug 24, 2026
4749d44
fix comments
bzp2010 Aug 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 123 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
apisix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- 3.2.2
Expand Down Expand Up @@ -79,10 +80,22 @@ jobs:
# Run E2E tests
- name: Run E2E tests
run: npx nx run backend-apisix:test

# Run the Rust port's E2E tests against the same live apisix instance
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target
- name: Run Rust E2E tests
working-directory: ./rust
run: |
rustup update stable
rustup default stable
cargo test -p adc-backend-apisix -- --ignored --test-threads=1
apisix-standalone:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'test/apisix-standalone') || github.event_name == 'push'
strategy:
fail-fast: false
matrix:
version:
- 3.13.0
Expand Down Expand Up @@ -120,6 +133,28 @@ jobs:
# Run E2E tests
- name: Run E2E tests
run: npx nx run backend-apisix-standalone:test

# Run the Rust port's E2E tests against the same live cluster. Each
# test function restarts every instance itself before it starts
# (see adc-backend-apisix-standalone's tests/common/mod.rs), so
# running after the TS suite here is safe — nothing from the TS
# suite's own state survives into the Rust tests.
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target
- name: Run Rust E2E tests
working-directory: ./rust
run: |
rustup update stable
rustup default stable
cargo test -p adc-backend-apisix-standalone -- --ignored --test-threads=1
# Only useful when the step above fails: a bare 404 from an admin API
# request gives no clue why on its own — the container's own error
# log does.
- name: Dump APISIX standalone container logs
if: failure()
working-directory: ./libs/backend-apisix-standalone/e2e/assets
run: docker compose logs --no-color
api7:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'test/api7') || github.event_name == 'push'
Expand Down Expand Up @@ -174,3 +209,91 @@ jobs:
# Run API7 E2E tests
- name: Run E2E tests
run: npx nx run backend-api7:test
api7-rust:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'test/api7') || github.event_name == 'push'
permissions:
contents: read
packages: read
strategy:
fail-fast: false
matrix:
version: [3.5.5, 3.6.1, 3.7.8, 3.8.23, 3.9.14, 3.10.1, dev]
steps:
- name: Determine API7 image and license
run: |
if [ "${{ matrix.version }}" = "dev" ]; then
echo "BACKEND_API7_VERSION=999.999.999" >> $GITHUB_ENV
echo "API7_DASHBOARD_IMAGE=ghcr.io/api7/api7-ee-3-integrated" >> $GITHUB_ENV
echo "API7_IMAGE_TAG=dev" >> $GITHUB_ENV
{
echo "BACKEND_API7_LICENSE<<EOLICENSE"
echo "${{ secrets.BACKEND_API7_DEV_LICENSE }}"
echo "EOLICENSE"
} >> $GITHUB_ENV
else
echo "BACKEND_API7_VERSION=${{ matrix.version }}" >> $GITHUB_ENV
echo "API7_DASHBOARD_IMAGE=api7/api7-ee-3-integrated" >> $GITHUB_ENV
echo "API7_IMAGE_TAG=v${{ matrix.version }}" >> $GITHUB_ENV
{
echo "BACKEND_API7_LICENSE<<EOLICENSE"
echo "${{ secrets.BACKEND_API7_LICENSE }}"
echo "EOLICENSE"
} >> $GITHUB_ENV
fi

- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: Login to GHCR
if: matrix.version == 'dev'
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Runs on its own dashboard instance, independent of the `api7` job's
# (rather than reusing that job's live instance after the TS suite runs)
# — the Rust e2e suite's `common::client()` performs its own admin
# login / password rotation / license activation / token minting on
# first use (see adc-backend-api7's tests/common/mod.rs), which would
# collide with the TS suite doing the same dance against a shared
# instance.
- name: Setup API7 Instance via Docker Compose
working-directory: ./libs/backend-api7/e2e/assets
run: |
if [ "${{ matrix.version }}" = "dev" ]; then docker compose pull; fi
docker compose up -d

# Run the Rust port's E2E tests
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target
# Each test file below is its own process with no state shared
# between them, but they all talk to the one dashboard instance
# started above — so the admin login / password rotation / license
# activation / token minting dance runs here exactly once, and its
# result is shared with every other test file as `TOKEN` (see
# tests/e2e_init.rs), instead of each independently repeating it
# against a dashboard the first one to run already mutated.
- name: Bootstrap a shared API7 token
working-directory: ./rust
run: |
rustup update stable
rustup default stable
cargo test -p adc-backend-api7 --test e2e_init -- --ignored
- name: Run Rust E2E tests
working-directory: ./rust
run: |
rustup update stable
rustup default stable
cargo test -p adc-backend-api7 -- --ignored --test-threads=1
# Only useful when the step above fails: `BackendError::Api`'s
# message is empty for a 500 with no response body, which the
# dashboard's own logs can actually explain.
- name: Dump API7 dashboard logs
if: failure()
working-directory: ./libs/backend-api7/e2e/assets
run: docker compose logs --no-color
176 changes: 176 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,179 @@ jobs:
files: |
release/adc_${{ env.RELEASE_VERSION }}_darwin_arm64.tar.gz
release/adc_${{ env.RELEASE_VERSION }}_darwin_amd64.tar.gz

# --- Rust CLI (adc_rust_*) below. Same release, same tag trigger, built
# and packaged independently of the Node-SEA jobs above — see
# impl/rust-release.md for why the release profile produces a large
# binary and how the debug-info split works.
# Both legs build natively on a runner of their own target architecture
# (Linux/Windows arm64 hosted runners are GA and free for public repos) —
# no cross-toolchain, no `--target`, no `rustup target add`: the default
# host toolchain already *is* the target, so `cargo build --release`
# alone produces it straight into `target/release/`.
adc-rust-linux:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
arch: amd64
- os: ubuntu-24.04-arm
arch: arm64
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false
- name: Setup release flow
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV

- name: Setup Rust toolchain
run: |
rustup update stable
rustup default stable
# `runner.os` alone doesn't distinguish amd64 from arm64 (both report
# "Linux"), so the cache key needs `matrix.arch` too — otherwise the
# two architectures' incompatible `target/` dirs would collide.
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target
key: ${{ matrix.arch }}
- name: Build adc-cli
working-directory: ./rust
run: cargo build --release -p adc-cli

# Splits the release-profile binary (debug=true, strip=false — see
# impl/rust-release.md) into a small stripped executable plus a
# separate debug-info file a debugger can load alongside it via the
# shared Build ID objcopy embeds with --add-gnu-debuglink.
- name: Split debug info
run: |
BIN_DIR=rust/target/release
objcopy --only-keep-debug "$BIN_DIR/adc" "$BIN_DIR/adc.debug"
objcopy --strip-debug --strip-unneeded "$BIN_DIR/adc"
objcopy --add-gnu-debuglink="$BIN_DIR/adc.debug" "$BIN_DIR/adc"

- name: Compress adc
run: |
mkdir -p release
BIN_DIR=rust/target/release
tar -czf release/adc_rust_${{ env.RELEASE_VERSION }}_linux_${{ matrix.arch }}.tar.gz -C "$BIN_DIR" adc
tar -czf release/adc_rust_${{ env.RELEASE_VERSION }}_linux_${{ matrix.arch }}_debuginfo.tar.gz -C "$BIN_DIR" adc.debug

- name: Upload adc to GitHub release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release/adc_rust_${{ env.RELEASE_VERSION }}_linux_${{ matrix.arch }}.tar.gz
release/adc_rust_${{ env.RELEASE_VERSION }}_linux_${{ matrix.arch }}_debuginfo.tar.gz

adc-rust-windows:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
arch: amd64
- os: windows-11-arm
arch: arm64
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup release flow
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV

- name: Setup Rust toolchain
shell: bash
run: |
rustup update stable
rustup default stable
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target
key: ${{ matrix.arch }}
- name: Build adc-cli
working-directory: ./rust
run: cargo build --release -p adc-cli

# MSVC targets emit debug info as a standalone .pdb next to the .exe
# rather than embedding it (unlike DWARF-in-ELF/Mach-O) — nothing to
# split here, just collect the two files that are already separate.
- name: Compress adc
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path release | Out-Null
$binDir = "rust/target/release"
Compress-Archive -Path "$binDir/adc.exe" -DestinationPath "release/adc_rust_${{ env.RELEASE_VERSION }}_windows_${{ matrix.arch }}.zip"
Compress-Archive -Path "$binDir/adc.pdb" -DestinationPath "release/adc_rust_${{ env.RELEASE_VERSION }}_windows_${{ matrix.arch }}_debuginfo.zip"

- name: Upload adc to GitHub release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release/adc_rust_${{ env.RELEASE_VERSION }}_windows_${{ matrix.arch }}.zip
release/adc_rust_${{ env.RELEASE_VERSION }}_windows_${{ matrix.arch }}_debuginfo.zip

adc-rust-macos:
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
arch: arm64
- target: x86_64-apple-darwin
arch: amd64
runs-on: macos-26
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup release flow
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV

- name: Setup Rust toolchain
run: |
rustup update stable
rustup default stable
rustup target add ${{ matrix.target }}
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target
- name: Build adc-cli
working-directory: ./rust
run: cargo build --release -p adc-cli --target ${{ matrix.target }}

# macOS equivalent of the Linux objcopy split: dsymutil pulls the
# DWARF out into a .dSYM bundle, then strip removes it from the
# binary itself — the two stay pairable via the binary's UUID.
- name: Split debug info
run: |
BIN_DIR=rust/target/${{ matrix.target }}/release
dsymutil "$BIN_DIR/adc" -o "$BIN_DIR/adc.dSYM"
strip -S "$BIN_DIR/adc"

- name: Compress adc
run: |
mkdir -p release
BIN_DIR=rust/target/${{ matrix.target }}/release
tar -czf release/adc_rust_${{ env.RELEASE_VERSION }}_darwin_${{ matrix.arch }}.tar.gz -C "$BIN_DIR" adc
tar -czf release/adc_rust_${{ env.RELEASE_VERSION }}_darwin_${{ matrix.arch }}_debuginfo.tar.gz -C "$BIN_DIR" adc.dSYM

- name: Upload adc to GitHub release
uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3.0.1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release/adc_rust_${{ env.RELEASE_VERSION }}_darwin_${{ matrix.arch }}.tar.gz
release/adc_rust_${{ env.RELEASE_VERSION }}_darwin_${{ matrix.arch }}_debuginfo.tar.gz
60 changes: 60 additions & 0 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,63 @@ jobs:
run: npx nx run backend-api7:test
- name: Run OpenAPI Converter unit tests
run: npx nx run converter-openapi:test
rust:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Rust toolchain
run: |
rustup update stable
rustup default stable
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target

- name: Build
working-directory: ./rust
run: cargo build --workspace
- name: Clippy
working-directory: ./rust
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Run unit tests
working-directory: ./rust
run: cargo test --workspace
rust-build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact: adc-linux-x64
- os: macos-latest
target: aarch64-apple-darwin
artifact: adc-macos-arm64
runs-on: ${{ matrix.os }}
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Rust toolchain
run: |
rustup update stable
rustup default stable
rustup target add ${{ matrix.target }}
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target
- name: Build adc-cli
working-directory: ./rust
run: cargo build --release -p adc-cli --target ${{ matrix.target }}
- name: Stage binary
run: cp rust/target/${{ matrix.target }}/release/adc adc-${{ matrix.target }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.artifact }}
path: adc-${{ matrix.target }}
Loading
Loading