ci(mcp): trigger cloud-mcp deploy after PyPI publish#1050
ci(mcp): trigger cloud-mcp deploy after PyPI publish#1050Aaron ("AJ") Steers (aaronsteers) wants to merge 4 commits into
Conversation
After publishing to PyPI, wait 2 minutes for package availability then dispatch the cloud-mcp deploy workflow on airbyte-ops-mcp via repository_dispatch. This keeps the hosted Cloud MCP server in sync with each PyAirbyte release. Co-Authored-By: AJ Steers <aj@airbyte.io>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1782532058-cloud-mcp-deploy-trigger' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1782532058-cloud-mcp-deploy-trigger'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
📝 WalkthroughWalkthroughThe workflow adds two post-publish jobs that wait 120 seconds after ChangesCloud MCP deployment dispatch
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: AJ Steers <aj@airbyte.io>
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-fastThe overall coverage in the branch is 67%. The coverage in the branch is 65%. Show a code coverage summary of the most impacted files.
Python / code-coverage/pytest-no-credsThe overall coverage in the branch is 67%. The coverage in the branch is 65%. Show a code coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall coverage in the branch is 72%. The coverage in the branch is 71%. Show a code coverage summary of the most impacted files.
Updated |
There was a problem hiding this comment.
Pull request overview
Adds an automated post-PyPI-publish step to trigger a rebuild/deploy of the hosted Cloud MCP server, ensuring mcp.internal.airbyte.ai/cloud-mcp picks up the newly released airbyte package from PyPI.
Changes:
- Introduces a new
deploy_cloud_mcpjob that runs afterpublish_to_pypi. - Waits briefly for PyPI availability, then triggers an
airbytehq/airbyte-ops-mcprepository_dispatchevent (deploy-cloud-mcp) with payload{"mcp-server":"cloud-mcp"}.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: AJ Steers <aj@airbyte.io>
| deploy_cloud_mcp: | ||
| name: Deploy Cloud MCP | ||
| needs: publish_to_pypi | ||
| if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') |
There was a problem hiding this comment.
🚩 Cloud MCP deployment triggers on prerelease builds, not just stable releases
The deploy_cloud_mcp job's if condition (pypi_publish.yml:86) matches the publish step's condition exactly, meaning it fires on both release events and workflow_dispatch with publish == 'true'. The prerelease flow in prerelease-command.yml:90 dispatches to this workflow with publish: "true", so every PR prerelease build (e.g. 0.34.0.dev825...) will also trigger a cloud-mcp deployment via repository-dispatch. Since the client-payload at pypi_publish.yml:99 carries no version info, the downstream workflow likely just redeploys latest stable — but this still causes an unnecessary deployment cycle on every prerelease. If the intent is to deploy only on stable releases, consider gating on github.event_name == 'release' alone.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
🙋 Human Input Needed: Valid observation. The deploy_cloud_mcp job fires on both stable releases and prerelease workflow_dispatch builds.
In practice this is harmless — Dockerfile.cloud-mcp runs uv pip install airbyte (no version pin), so prerelease deploys would just rebuild with the latest stable PyPI version. But it's an unnecessary deploy cycle.
Aaron ("AJ") Steers (@aaronsteers) — should we gate this on github.event_name == 'release' only, or is deploying on prereleases also intentional (e.g., to test the cloud-mcp build pipeline)?
Split deploy_cloud_mcp into two jobs: - deploy_cloud_mcp: fires on release events, deploys to production - deploy_cloud_mcp_preview: fires on workflow_dispatch prereleases, sends preview=true in client_payload to deploy to cloud-mcp-preview Co-Authored-By: AJ Steers <aj@airbyte.io>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/pypi_publish.yml:
- Around line 90-99: Replace the fixed sleep in the PyPI publish workflow with a
check that waits until the newly published airbyte version is actually available
on PyPI before triggering the repository dispatch. Update the logic around the
“Wait for PyPI availability” step and the subsequent `repository-dispatch`
action so deployment only proceeds once the exact version can be resolved, and
apply the same gating to the preview path referenced by the shared deploy steps.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0843f5b1-fe91-488d-bf34-ad3837a10867
📒 Files selected for processing (1)
.github/workflows/pypi_publish.yml
| - name: Wait for PyPI availability | ||
| run: sleep 120 | ||
|
|
||
| - name: Trigger cloud-mcp production deploy | ||
| uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3 | ||
| with: | ||
| token: ${{ secrets.GITHUB_CI_WORKFLOW_TRIGGER_PAT }} | ||
| repository: airbytehq/airbyte-ops-mcp | ||
| event-type: deploy-cloud-mcp | ||
| client-payload: '{"mcp-server": "cloud-mcp"}' |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Could we gate the dispatch on actual PyPI availability instead of a fixed 120s sleep, wdyt?
This still races PyPI propagation. If the new airbyte version takes longer than two minutes to appear, the downstream build can fail or rebuild cloud-mcp against the previous package version. Polling for the exact published version before sending deploy-cloud-mcp would make both release and preview deploys deterministic.
Also applies to: 108-117
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/pypi_publish.yml around lines 90 - 99, Replace the fixed
sleep in the PyPI publish workflow with a check that waits until the newly
published airbyte version is actually available on PyPI before triggering the
repository dispatch. Update the logic around the “Wait for PyPI availability”
step and the subsequent `repository-dispatch` action so deployment only proceeds
once the exact version can be resolved, and apply the same gating to the preview
path referenced by the shared deploy steps.
There was a problem hiding this comment.
The 2-minute fixed wait was an explicit design choice by the maintainer. A polling loop would add complexity (need to extract the version, handle PyPI API rate limits, determine timeout/retry logic) for marginal benefit — PyPI propagation almost always completes well within 2 minutes, and even if it doesn't, the downstream Dockerfile.cloud-mcp runs uv pip install airbyte without a version pin, so it would pick up the latest available version regardless.
If we want to tighten this in the future, it could be a follow-up improvement.
Summary
Auto-deploys the Cloud MCP Cloud Run service after PyAirbyte publishes to PyPI, with different targets based on release type:
releaseevent) → deploy to productioncloud-mcpserviceworkflow_dispatchwithpublish: true) → deploy tocloud-mcp-previewserviceBoth jobs wait 2 minutes for PyPI propagation, then send a
repository_dispatchtoairbytehq/airbyte-ops-mcpwithevent-type: deploy-cloud-mcp. The prerelease job includes"preview": "true"in the client payload to route to the preview service.Companion to airbyte-ops-mcp#1001 which adds
client_payload.previewsupport to the deploy workflow.Link to Devin session: https://app.devin.ai/sessions/9274bd4f3e0a4b0880795fc1ef9c806b
Requested by: Aaron ("AJ") Steers (@aaronsteers)