Skip to content

fix(ci): batch of 3 CI fixes (live test, rust toolchain, cargo profile) - #52

Merged
mmacedoeu merged 3 commits into
mainfrom
fix/ci-fixes-batch
Jun 19, 2026
Merged

fix(ci): batch of 3 CI fixes (live test, rust toolchain, cargo profile)#52
mmacedoeu merged 3 commits into
mainfrom
fix/ci-fixes-batch

Conversation

@mmacedoeu

@mmacedoeu mmacedoeu commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Three independent CI fixes, batched into one PR because they are all
small workflow / workspace-config changes and have been verified
together on the next branch (commit range
e201d48..a8754e8). All 5 CI jobs (Lint, Rust CI, Coverage,
Security Scan, Quota Router Python SDK) are green.

# Commit Scope
1 e201d48 chore(ci): move telegram live_session_test to standalone crate outside main workspace
2 ca9709a fix(ci): install rust toolchain in quota-router-python type-check job
3 a8754e8 fix(ci): install cargo via profile: default in quota-router-python build job

Details

1. e201d48 — move live_session_test out of the main workspace

crates/octo-adapter-telegram/tests/live_session_test.rs was being
built by cargo test --workspace because of feature unification
(octo-telegram-onboard-core depends on
octo-adapter-telegram with features = ["real-tdlib"], which
cargo's resolver propagates workspace-wide). The test requires
libc++.so.1 (TDLib is linked against LLVM's libc++), which is
not installed on the default ubuntu-latest CI runner, so every
push failed with error while loading shared libraries: libc++.so.1.

Feature gates / required-features / autotests = false could
not isolate the test — cargo's resolver unifies "free" features
across the workspace. The only robust solution is to physically
move the test to a sibling crate that is NOT a workspace member.

New crate: live-tests/octo-telegram-live-tests/ (standalone,
has empty [workspace] table, members = ["crates/*"] in root
does not match live-tests/). CI can never build or run the
live test from cargo test --workspace. ci.yml no longer
needs the Install C++ runtime step.

Run manually:

cd live-tests/octo-telegram-live-tests
cargo test -- --ignored --nocapture --test-threads=1

2. ca9709aInstall Rust in quota-router-python type-check

The type-check job was missing the dtolnay/rust-toolchain@stable
step that the test job already had. Without it, maturin develop
tried to bootstrap its own rustc on fresh runners and failed with:

💥 maturin failed
  error: failed to install component: 'clippy-preview-x86_64-unknown-linux-gnu',
         detected conflict: 'bin/cargo-clippy'

Adding the Install Rust step mirrors the test job exactly and
gives maturin a clean system rustc.

3. a8754e8profile: default in quota-router-python build

The build job was also failing on fresh runners with:

error: 'cargo' is not installed for the toolchain '1.96.0-x86_64-unknown-linux-gnu'.
💥 maturin failed
  Caused by: Cargo metadata failed.

Root cause: dtolnay/rust-toolchain@stable defaults to
--profile minimal, which installs only rustc (no cargo, no
clippy, no rustfmt). The test and type-check jobs happened
to work because their runners had cargo pre-installed; the build
job hit a fresh runner without that. Switching to
profile: default installs cargo (and clippy, rustfmt,
rust-docs) explicitly via rustup.

Test plan

  • All 3 commits already landed on next and have been running
    in CI for several hours
  • All 5 CI jobs green: Lint, Rust CI, Coverage, Security Scan,
    Quota Router Python SDK
  • Re-run CI on this PR to confirm the cherry-picks produce the
    same green result
  • Reviewer spot-check: cargo test --workspace --exclude quota-router-pyo3
    no longer builds the telegram live test (only the whatsapp one,
    which is correctly feature-gated and unrelated)

Notes for reviewer

  • Cherry-picks were clean (no conflicts, no manual resolution) —
    the 3 commits were authored on top of 7fc7486 and the PR base
    is also 7fc7486.
  • New SHAs on this branch: f66aea0, 7e3583b, 2f99780
    (vs the originals e201d48, ca9709a, a8754e8 on
    next) — only the parent changes; commits are byte-identical.
  • No new dependencies, no version bumps, no breaking changes.

…e main workspace

The live integration test for octo-adapter-telegram against a real TDLib
session was previously located at crates/octo-adapter-telegram/tests/
live_session_test.rs. Because octo-telegram-onboard-core depends on
octo-adapter-telegram with features = ["real-tdlib"], cargo's workspace
feature unification enabled the real-tdlib feature across the workspace,
which in turn caused 'cargo test --workspace' to auto-discover and build
the live_session_test target. At test-execution time the test binary
failed to load with 'error while loading shared libraries: libc++.so.1'
because the prebuilt TDLib shared library is linked against LLVM's libc++,
which is not installed on the default ubuntu-latest CI runner. This
broke CI for every push.

Feature gates and explicit [[test]] entries could not isolate the test:
cargo's feature resolver unifies 'free' features across the workspace,
so the test was always built.

Move the live test to a new standalone crate at
live-tests/octo-telegram-live-tests/ that is intentionally NOT a member
of the main workspace (root Cargo.toml uses members = ["crates/*"]; the
new crate lives in live-tests/, which the root glob does not match). The
new crate declares an empty [workspace] table so it is a complete
workspace of its own, and is therefore physically unreachable from
'cargo test --workspace' at the repo root.

This guarantees CI can never build or run the live test, regardless of
feature flags, resolver behavior, or transitive feature unification.

To run the live test manually:

    cd live-tests/octo-telegram-live-tests
    cargo test -- --ignored --nocapture --test-threads=1

Changes:
- Move crates/octo-adapter-telegram/tests/live_session_test.rs
  -> live-tests/octo-telegram-live-tests/tests/live_session_test.rs
- New crate: live-tests/octo-telegram-live-tests/ (standalone, with
  empty [workspace] table) containing Cargo.toml, src/lib.rs (marker),
  tests/live_session_test.rs, and .gitignore (target/, Cargo.lock)
- Move tracing-subscriber dev-dependency from octo-adapter-telegram
  to the new crate (where the test now lives)
- ci.yml: no change needed; the 'Install C++ runtime' step is no longer
  required because CI cannot reach the live test
The type-check job was failing on fresh runners with:

  💥 maturin failed
    Caused by: Failed to run rustc to get the host target
    error: failed to install component: 'clippy-preview-x86_64-unknown-linux-gnu',
           detected conflict: 'bin/cargo-clippy'

Root cause: the type-check job ran 'maturin develop' without first
installing a Rust toolchain via rustup. Maturin then tried to bootstrap
its own rustc and hit a toolchain conflict on runners with a partially
installed or stale rustup state.

The test job in the same workflow already has
  - name: Install Rust
    uses: dtolnay/rust-toolchain@stable
and works. The type-check job was missing this step. Adding it
mirrors the test job exactly, gives maturin a clean system rustc to
use, and resolves the conflict on fresh runners.
…ild job

The build job was failing on fresh runners with:

  info: syncing channel updates for 1.96.0-x86_64-unknown-linux-gnu
  info: downloading component clippy
  error: 'cargo' is not installed for the toolchain '1.96.0-x86_64-unknown-linux-gnu'
  💥 maturin failed
    Caused by: Cargo metadata failed.
    Caused by: `cargo metadata` exited with an error

Root cause: dtolnay/rust-toolchain@stable defaults to --profile
minimal, which installs only rustc (no cargo, no clippy, no
rustfmt). The test and type-check jobs in this workflow happen to
work because their runners have cargo pre-installed in the Ubuntu
image. The build job hit a fresh runner without that, and maturin
could not find cargo for the stable toolchain.

Switch the build job's Install Rust step to profile: default, which
installs cargo (and clippy, rustfmt, rust-docs) explicitly via
rustup. The build job is now self-sufficient regardless of the
runner image.

The test and type-check jobs are left at the default (minimal)
profile since they currently work; they can be flipped to default
later if they start hitting the same issue.
@mmacedoeu
mmacedoeu merged commit 9736536 into main Jun 19, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant