Skip to content

ci(runtime-pin-compat): test the PR-built wheel, not PyPI-latest - #2196

Merged
HongmingWang-Rabbit merged 1 commit into
stagingfrom
fix/runtime-pin-compat-test-pr-artifact
Apr 28, 2026
Merged

ci(runtime-pin-compat): test the PR-built wheel, not PyPI-latest#2196
HongmingWang-Rabbit merged 1 commit into
stagingfrom
fix/runtime-pin-compat-test-pr-artifact

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

Closes #128. The original runtime-pin-compat.yml gate installed the CURRENTLY-PUBLISHED molecule-ai-workspace-runtime from PyPI before smoke-importing — catching upstream PyPI yanks but not problems introduced by the PR itself. A PR that adds an import requiring a newer SDK could pass the gate (smoke runs against the OLD wheel) and then break every tenant image after merge → publish.

What changes

Splits into two jobs:

  • pypi-latest-install (renamed from default-install): unchanged behavior. Daily-cron + requirements.txt / workflow edits. Catches upstream PyPI yanks + already-shipped artifact going stale.
  • local-build-install (new): runs scripts/build_runtime_package.py on the PR's workspace/, builds the wheel with python -m build (mirroring publish-runtime.yml byte-for-byte), installs that wheel, then smoke-imports. Tests the artifact that WOULD be published if this PR merges.

Path filter widened to workspace/** so any runtime-source change triggers the local-build job.

Verification

Built the wheel from current workspace/ source via the same script + python -m build invocation, installed into a fresh venv, imported successfully:

PR-built runtime imports OK

Test plan

  • Both jobs pass on this PR
  • On a future PR that touches workspace/main.py, both jobs run (the pypi-latest-install against PyPI, the local-build-install against the new source)

🤖 Generated with Claude Code

Closes #128's chicken-and-egg. The original gate installed the
CURRENTLY-PUBLISHED molecule-ai-workspace-runtime from PyPI, then
overlaid workspace/requirements.txt, then smoke-imported. That
catches problems with the already-shipped artifact (the daily-cron
upstream-yank case), but it cannot catch problems introduced by the
PR itself: the imports it exercises are from the OLD wheel, not the
PR's source. A PR that adds `from a2a.utils.foo import bar` (where
`bar` is added in a2a-sdk 1.5 and the runtime currently pins 1.3)
slips through:
  1. Pip resolves the existing PyPI wheel + a2a-sdk 1.3.
  2. Smoke imports the OLD main.py — no reference to `bar` → green.
  3. Merge → publish-runtime.yml ships a wheel WITH the new import.
  4. Tenant images redeploy → all crash on first boot with
     ImportError: cannot import name 'bar' from 'a2a.utils.foo'.

Splits the workflow into two jobs:

  - pypi-latest-install (renamed from default-install): unchanged
    behavior. Runs on the daily cron and on requirements.txt /
    workflow edits. Catches upstream PyPI yanks + the
    already-shipped artifact going stale.

  - local-build-install (new): runs scripts/build_runtime_package.py
    on the PR's workspace/, builds the wheel with python -m build
    (mirroring publish-runtime.yml byte-for-byte), installs that
    wheel, then runs the same smoke import. Tests the artifact
    that WOULD be published if this PR merges.

Path filter widened to workspace/** so any runtime-source change
triggers the local-build job. The pypi-latest job's filter is the
same union; its internal logic is unchanged so the daily-cron and
upstream-detection use cases continue to work.

Verified locally: built the wheel from current workspace/ source via
the same script + python -m build invocation, installed into a fresh
venv, imported from molecule_runtime.main import main_sync
successfully.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit added this pull request to the merge queue Apr 28, 2026
Merged via the queue into staging with commit 7484e6f Apr 28, 2026
17 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the fix/runtime-pin-compat-test-pr-artifact branch April 28, 2026 00:46
HongmingWang-Rabbit pushed a commit that referenced this pull request Jun 12, 2026
…— unblock fleet-wide deploys (#2193)' (#2196) from sre/fix-auto-deploy-writable-home-2193 into main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workspace-template: add agents.md capability declaration (Scion interoperability)

1 participant