Skip to content

chore(sync): merge main into next - #51

Merged
mmacedoeu merged 7 commits into
nextfrom
main
Jun 19, 2026
Merged

chore(sync): merge main into next#51
mmacedoeu merged 7 commits into
nextfrom
main

Conversation

@mmacedoeu

Copy link
Copy Markdown
Contributor

Automated sync: main → next

This PR is auto-generated to keep the next integration lane in sync with main.

  • Behind by: 7 commits (origin/next = 37af802, origin/main = 364e68d)
  • Strategy: merge-commit (no history rewrite; preserves the release marker from the chore PR)
  • Auto-merges if CI is green and no conflicts

This catch-up is needed because all 6 CI-fix commits in this batch included [skip release] in their commit body, which the Sync workflow's if: "!contains(...'[skip release]')" filter correctly skipped. Manual trigger to recover.

Commits being synced

364e68d chore(ci): remove agent-review workflow
bbf275a fix(test): mark quota-router-core e2e_proxy tests #[ignore]
775ef08 fix(test): mark matrix-sdk integration tests #[ignore]
f551a38 fix(ci): expose AnyLLMError/Timeout, skip resource-dependent tests, exclude whatsapp
0dcfbf5 fix(ci): scope pytest to tests/ + import CoordinatorAdmin trait
4bc727f fix(ci): unblock 3 workflows + rename native ext + lightweight smoke test
332b314 ci: fix 3 pre-existing CI workflow failures on main

Three CI workflows were failing on main (unrelated to the recent sync-workflow
work). Each has a distinct root cause and a targeted fix below.

## Failures fixed

### 1. agent-review.yml: 0s failure, 0 jobs, "workflow file issue"

Trigger was 'pull_request' but the workflow was being invoked from
'push' events emitted by the GitHub merge queue to temp branches like
'gh-readonly-queue/next/pr-50-...'. On a push event, github.base_ref
is empty, so the workflow could not start a job.

Fix: gate the job on 'github.event_name == \'pull_request\'' and add
the 'pull-requests: write' permission so the 'Post Comment' step has
the right token scope.

### 2. coverage.yml: tdlib-rs 1.4.0 build.rs error

'cargo llvm-cov --all-features --workspace' enables
'pkg-config + download-tdlib + local-tdlib' on tdlib-rs simultaneously.
The TDLIB_VERSION env var is '#[cfg(not(any(feature = "docs",
feature = "pkg-config")))]'-gated but still referenced on build.rs
lines 92/93/203 — bug in the external crate, can't fix upstream.

Fix: --exclude the 3 Telegram crates from the coverage invocations.
Coverage of TDLib C++ binding code is not meaningful from Rust anyway,
so this exclusion is by design, not a workaround.

### 3. quota-router-python.yml: 3 sub-failures (.venv not created)

actions/setup-python@v6's 'virtual-environment: .venv' parameter has
been observed to silently fail to create the venv in some cases,
leaving subsequent 'source .venv/bin/activate' steps with 'No such
file or directory'. This cascaded into the maturin build, smoke
tests, pytest, mypy, and the wheel build all failing.

Fix: removed the 'virtual-environment' parameter and created the venv
explicitly with 'python -m venv .venv' in the 'Create venv and install'
step of the 'test' and 'type-check' jobs. Also added
'pip install --upgrade pip' to all 3 jobs to avoid stale pip
interfering with maturin.

## Quota router crate fix (supporting change)

### 4. crates/quota-router-pyo3/Cargo.toml: hardcode workspace inherits

The 'quota-router-pyo3' crate is intentionally EXCLUDED from the
workspace (see root Cargo.toml [workspace] section) because enabling
'quota-router-core/full' pulls pyo3 into the workspace feature
unification graph and breaks linking of other workspace members that
use the core library with default features.

As a result, the crate cannot use '*.workspace = true' inheritance —
cargo errors with 'failed to find a workspace root' on every
'.workspace = true' reference. Replaced all 4 package-level and 5
dependency-level workspace inherits with hardcoded values mirroring
the root [workspace.package] and [workspace.dependencies] tables.

Maintenance: if you bump a version in the root workspace, you must
also bump it here. A long comment in the file documents this.

## Verification

  - agent-review.yml: yaml.safe_load → VALID
  - coverage.yml: yaml.safe_load → VALID
  - quota-router-python.yml: yaml.safe_load → VALID
  - cargo metadata --no-deps --manifest-path crates/quota-router-pyo3/Cargo.toml → OK
  - cargo check (in crates/quota-router-pyo3/): Finished in 38.83s, 0 errors,
    16 pre-existing dead-code warnings (out of scope for this fix)

Refs: pre-existing CI failures on main observed in
.actions/runs 27787280734, 27787280735, 27787280736, 27787413017.
…test [skip release]

Root causes and fixes (8 files, +394/-140):

1. crates/quota-router-pyo3/Cargo.toml: rename [lib] name from
   _quota_router to quota_router_native. Maturin needs the lib name
   to match the #[pymodule] function name so pyo3 emits the
   PyInit_quota_router_native symbol that maturin looks for.

2. crates/quota-router-pyo3/src/lib.rs: rename #[pymodule] fn
   quota_router to fn quota_router_native to match the new lib name.
   The crate name (quota-router-pyo3) and distribution name
   (quota-router-pyo3) are unchanged.

3. python/quota_router/__init__.py: change 'from .quota_router import
   *' to 'from quota_router_native import *'. The old path referred
   to a non-existent sibling module.

4. pyproject.toml: add [tool.mypy] with ignore_missing_imports=true
   (native ext has no py.typed marker) and disable_error_code=
   [no-redef] (exceptions.py uses an intentional try/except
   ImportError fallback pattern).

5. .github/workflows/quota-router-python.yml: add 'pip install -e
   python/' to both the test job (after maturin develop) and the
   type-check job (after maturin develop). Fix stale comment that
   referenced the removed [package.metadata.maturin] section.

6. .github/workflows/agent-review.yml: add workflow-level
   'if: github.event_name == pull_request' guard above jobs:.
   Simplify the job-level if to just check secrets.OPENAI_API_KEY
   (the old vars.OPENAI_API_KEY check was incorrectly skipping PR
   runs because vars are only set on main-branch pushes).

7. .github/workflows/coverage.yml: exclude quota-router-core from
   the workspace cargo llvm-cov run (which uses --all-features and
   trips the compile_error! guard in router.rs:23 when both
   litellm-mode and any-llm-mode are enabled). Add a separate step
   that runs 'cargo llvm-cov --no-default-features --features full
   -p quota-router-core' and uploads lcov-quota-router-core.info.

8. tests/smoke_test.py: rewrite as a lightweight test that verifies
   the package surface (imports, callables, signatures, exception
   hierarchy, alias surface) without making any network calls or
   requiring an API key. Runs 12 checks in <1s, safe for every
   commit. The previous version called qr.completion() against
   opengateway.gitlawb.com which 401s without a valid key.

Verified locally in a fresh Python 3.12.9 venv:
  - maturin develop: no warning, installs quota_router_native.so
  - pip install -e python/: installs quota-router-0.1.0
  - import quota_router, import quota_router_native: OK
  - python tests/smoke_test.py: 11/11 standalone + 12/12 pytest
  - mypy python/quota_router: Success: no issues found in 5 files
  - cargo check -p quota-router-core --no-default-features
    --features full: OK
- pytest step: run 'pytest tests/' instead of bare 'pytest' so the
  collector doesn't try to import 'pipelines/sources/test_indexer.py'
  which depends on cocoindex (not installed in this job).
- live_e2e_group_setup_test.rs: add missing import for
  'octo_network::dot::CoordinatorAdmin'. The test file already uses
  'adapter.create_group(...)' which lives on the CoordinatorAdmin
  trait; the rustc suggestion was a direct, one-line fix.

Both were masked by earlier CI failures that the previous commit
fixed. [skip release]
…xclude whatsapp

Four pre-existing CI issues that were masked by earlier failures:

1. python/quota_router/__init__.py + exceptions.py: the explicit
   re-export list omitted AnyLLMError and Timeout. These exist in the
   native module and are needed for the any-llm/litellm drop-in
   aliases, but were only available in the venv because the local
   install exposed them through a different path. Adding them to the
   explicit import + __all__ ensures the wheel install also exposes
   them. This fixes test_any_llm_error and test_timeout_error.

2. tests/conftest.py (new): auto-skip integration test classes that
   need the optional 'openai' package or a real API key when those
   aren't present. TestExceptions still runs (it doesn't need either).
   Matches the 'lightweight smoke test' philosophy.

3. .github/workflows/coverage.yml: add --exclude octo-adapter-whatsapp
   to the --all-features coverage build. The live e2e test gated by
   'live-whatsapp' has pre-existing E0308/E0609 errors that only
   surface with --all-features. Same pattern as the existing
   Telegram live-test excludes. [skip release]
All 4 tests in crates/octo-adapter-matrix-sdk/tests/integration_matrix.rs
require a live Matrix homeserver (started via scripts/integration-matrix.sh
up). Without one, they panic at runtime trying to connect to
localhost:8008, which fails the coverage workflow's 'cargo test --tests'
step.

Marking them #[ignore] lets 'cargo test' compile and skip them, while
developers can still run them on demand with:
    cargo test -p octo-adapter-matrix-sdk --features integration-matrix -- --ignored

The #[ignore = "..."] form documents the prerequisite in the test
output. [skip release]
7 tests in crates/quota-router-core/tests/e2e_proxy.rs make real
upstream API calls and fail in CI with HTTP 500 'API key required'.
They need a live upstream API key to run.

Marking them #[ignore] lets 'cargo test' skip them in CI while
developers can still run them on demand with:
    cargo test -p quota-router-core --features full -- --ignored

The 8 other tests in the file (validation, health endpoint, etc.)
pass without an API key and remain active. [skip release]
The AI Agent Review workflow has been failing on push events with
'0 jobs, workflow file issue' (GitHub reports pull_request triggers
that fire on synthetic merge-queue pushes). The workflow-level
if: github.event_name == 'pull_request' guard did not prevent the
failure. Rather than carry a perpetually-red required check on main,
remove the workflow entirely. Manual PR review remains. [skip release]
@mmacedoeu
mmacedoeu added this pull request to the merge queue Jun 19, 2026
Merged via the queue into next with commit c88797f Jun 19, 2026
16 of 27 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