ci: run Python tests on every PR (closes #22)#45
Open
iliassjabali wants to merge 5 commits intomainfrom
Open
Conversation
Adds python-changes detector + python-tests matrix job to ci.yml so the 282 Python tests across control-plane, operator, sdk-langgraph, and sdk-python run on every PR that touches them and on every push to main. - dorny/paths-filter scopes runs to changed packages on PRs - push: main always runs all 4 packages as a safety net - actions/setup-python pip cache keyed per package - ci-success gate depends on both jobs and treats skipped as ok Closes #22
…ting bug
The previous version inlined ${{ steps.filter.outputs.changes }} directly
inside a double-quoted echo, so the JSON array's double quotes broke shell
parsing and the python-tests matrix failed to materialize. Pass the value
through an env var instead.
test_sidecar_client.py imports the real httpx (not mocked), which lives in the 'opa' extra. Switch to a per-package case so each package gets exactly the deps its tests need.
The rate-limit window used 0.0 as the 'never seen' sentinel, so on a host where time.monotonic() is small (freshly-booted CI runner, or under a monkeypatched RATE_LIMIT_SECONDS=1000 in tests), the first heartbeat for a brand-new agent could be incorrectly rate-limited. Switch to a None sentinel so the absence of a prior timestamp always allows the request. Discovered when wiring tests/test_heartbeat.py::test_heartbeat_rate_limit_returns_429 into CI (issue #22).
Sets FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true at the workflow level so the 13 'Node.js 20 actions are deprecated' warnings disappear ahead of the June 2026 default switch, without bumping any action versions. https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #22
Re-opens #42 from a properly named branch (
ci/add-python-testsinstead of the auto-generatedtender-ritchie).Summary
python-changesdetector job usingdorny/paths-filter@v3that emits a JSON array of Python packages touched in the PR. Onpush: mainit always emits all four as a safety net.python-testsmatrix job that runspytestfor each changed package. Usesactions/setup-python@v5withcache: pipkeyed per package, picks per-package install commands via a smallcasestatement, and runs withfail-fast: falseso each package reports independently.ci-successto depend on both new jobs via afail_if_not_okhelper that treatsskippedas acceptable, so TS-only PRs still pass the gate.packages/control-plane/api/heartbeat.py: the rate limiter used0.0as the never-seen sentinel, which causes false 429s on hosts wheretime.monotonic()is small (freshly-booted CI runners, or when tests monkeypatchRATE_LIMIT_SECONDS=1000). Switched to aNonesentinel. This was a latent bug exposed by enabling the previously-unrun heartbeat tests in CI.This wires the existing 282 Python tests (control-plane 109, operator 178, sdk-langgraph 123, sdk-python 7) into CI without adding weight to PRs that don't touch Python.
CI weight
python-changesjob runs (~7s),python-testsis skipped.push: main: all 4 legs run unconditionally.Test plan
python-changesand the matchingpython-testslegs (this PR touches.github/workflows/ci.yml, so all 4 run).CIgate is green and listspython-testsas a required dependency.push: mainruns all 4 legs and stays green.