Skip to content

Commit 4b838cd

Browse files
committed
ci(branch-checks): freeze the Python SDK sources in core
ai-openshell/sdk-python imported the Python SDK at v0.1.7, and nothing under the moved paths has changed in core since. A Python SDK Freeze job, like the Go SDK Freeze job, fails PRs that add or change those files, so SDK changes go to sdk-python instead of being lost here. The pathspecs match exactly the files the import moved: the package under python/openshell, the SDK tests at the python/ root, and the proto and wheel scripts. Core-only tests under python/ and the shared root pyproject.toml and uv.lock stay editable. Deletions are allowed for the removal PR. Refs #5287 Signed-off-by: Piotr Mlocek <[email protected]>
1 parent 7004281 commit 4b838cd

3 files changed

Lines changed: 52 additions & 2 deletions

File tree

‎.github/workflows/branch-checks.yml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,51 @@ jobs:
638638
echo "$changed"
639639
exit 1
640640
641+
python-sdk-freeze:
642+
# The Python SDK moved to ai-openshell/sdk-python (#5287), which imported it
643+
# at v0.1.7. Its files stay only until core removes them, so PRs must not
644+
# add or change them. Deleting files is allowed (the removal PR). The paths
645+
# are the ones the import moved; core-only tests under python/ and the
646+
# shared root pyproject.toml and uv.lock stay editable.
647+
# Merge queue runs skip this job; the PR already passed it on its mirror.
648+
name: Python SDK Freeze
649+
needs: pr_metadata
650+
if: needs.pr_metadata.outputs.should_run == 'true' && github.event_name == 'push'
651+
runs-on: ubuntu-latest
652+
timeout-minutes: 5
653+
steps:
654+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
655+
with:
656+
fetch-depth: 0
657+
persist-credentials: false
658+
659+
- name: Reject changes to the Python SDK
660+
env:
661+
BASE_SHA: ${{ needs.pr_metadata.outputs.base_sha }}
662+
run: |
663+
set -euo pipefail
664+
changed=$(git diff --name-only --diff-filter=d "${BASE_SHA}...HEAD" -- \
665+
python/openshell \
666+
':!python/openshell/release_formula_test.py' \
667+
':!python/openshell/rpm_gateway_config_migration_test.py' \
668+
':!python/openshell/gateway_config_fixture_test.py' \
669+
':!python/openshell/gateway_schema_v2_*_test.py' \
670+
python/credential_driver_proto_test.py \
671+
python/generate_python_proto_test.py \
672+
python/grpc_transport_test.py \
673+
python/grpc_typing_test.py \
674+
python/wheel_verifier_test.py \
675+
tasks/scripts/generate_python_proto.py \
676+
tasks/scripts/verify-python-wheel.py)
677+
if [ -z "$changed" ]; then
678+
echo "No added or changed Python SDK files."
679+
exit 0
680+
fi
681+
echo "::error title=Python SDK moved::The Python SDK moved to https://github.com/ai-openshell/sdk-python. Drop the Python SDK changes from this PR and open SDK changes there. Regenerated bindings are not needed here; sdk-python regenerates them from core releases."
682+
echo "Changed Python SDK files:"
683+
echo "$changed"
684+
exit 1
685+
641686
markdown:
642687
name: Markdown
643688
needs: pr_metadata

‎AGENTS.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Do not rely on this file for a full inventory. The detailed public and contribut
6161
| `crates/openshell-supervisor-network/` | Network supervisor | Proxying, L7 enforcement, policy evaluation, and provider credential injection |
6262
| `crates/openshell-supervisor-process/` | Process supervisor | Process lifecycle, namespace, and bypass monitoring |
6363
| `crates/openshell-vfio/` | VFIO support | PCI and GPU passthrough preparation and lifecycle |
64-
| `python/openshell/` | Python SDK | Python bindings and CLI packaging |
64+
| `python/openshell/` | Python SDK (frozen) | Moved to ai-openshell/sdk-python; kept until removal |
6565
| `sdk/typescript/` | TypeScript SDK | Native Connect client, curated sandbox API, and generated protobuf types |
6666
| `proto/` | Protobuf definitions | gRPC service contracts |
6767
| `tests/testkit/` | E2E testkit | Support library and `#[testkit::test]` attribute for SDK-driven E2E suites |
@@ -197,6 +197,11 @@ Follow `CONTRIBUTING.md` and `create-github-pr`. Authors without target-reposito
197197
- The Go SDK moved to [ai-openshell/sdk-go](https://github.com/ai-openshell/sdk-go) (module `github.com/ai-openshell/sdk-go`). Open SDK changes there.
198198
- `sdk/go/` is frozen until it is removed; Branch Checks fails PRs that change it. Proto changes do not need regenerated Go bindings.
199199

200+
## Python SDK (`python/openshell/`)
201+
202+
- The Python SDK moved to [ai-openshell/sdk-python](https://github.com/ai-openshell/sdk-python), which publishes `openshell` to PyPI. Open SDK changes there.
203+
- The SDK files are frozen until core removes them; Branch Checks fails PRs that change them. Core-only tests under `python/` stay editable.
204+
200205
## TypeScript SDK (`sdk/typescript/`)
201206

202207
- Run `mise run sdk:ts:ci` for codegen, proto lint, Biome lint, type checking, unit tests, coverage, and build validation.

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ These are the primary `mise` tasks for day-to-day development:
382382
| `crates/` | Rust crates |
383383
| `crates/openshell-policy-schema/` | Canonical authored policy DTOs and bounded YAML/JSON parser |
384384
| `crates/openshell-prover-cli/` | Standalone local policy boundary checker |
385-
| `python/` | Python SDK and bindings |
385+
| `python/` | Python SDK (frozen, moved to ai-openshell/sdk-python) |
386386
| `sdk/go/` | Go SDK (types, gRPC clients, converters) |
387387
| `sdk/typescript/` | TypeScript SDK (Connect client and generated protobuf bindings) |
388388
| `proto/` | Protocol buffer definitions and [public API conventions](proto/README.md) |

0 commit comments

Comments
 (0)