Skip to content

ci(mcp): trigger cloud-mcp deploy after PyPI publish#1050

Open
Aaron ("AJ") Steers (aaronsteers) wants to merge 4 commits into
mainfrom
devin/1782532058-cloud-mcp-deploy-trigger
Open

ci(mcp): trigger cloud-mcp deploy after PyPI publish#1050
Aaron ("AJ") Steers (aaronsteers) wants to merge 4 commits into
mainfrom
devin/1782532058-cloud-mcp-deploy-trigger

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

Auto-deploys the Cloud MCP Cloud Run service after PyAirbyte publishes to PyPI, with different targets based on release type:

  • Stable releases (release event) → deploy to production cloud-mcp service
  • Prereleases (workflow_dispatch with publish: true) → deploy to cloud-mcp-preview service

Both jobs wait 2 minutes for PyPI propagation, then send a repository_dispatch to airbytehq/airbyte-ops-mcp with event-type: deploy-cloud-mcp. The prerelease job includes "preview": "true" in the client payload to route to the preview service.

deploy_cloud_mcp:          # stable → production
  if: github.event_name == 'release'
  client-payload: '{"mcp-server": "cloud-mcp"}'

deploy_cloud_mcp_preview:  # prerelease → preview
  if: github.event_name == 'workflow_dispatch' && ...publish == 'true'
  client-payload: '{"mcp-server": "cloud-mcp", "preview": "true"}'

Companion to airbyte-ops-mcp#1001 which adds client_payload.preview support to the deploy workflow.

Link to Devin session: https://app.devin.ai/sessions/9274bd4f3e0a4b0880795fc1ef9c806b
Requested by: Aaron ("AJ") Steers (@aaronsteers)

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-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You 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 Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

github-advanced-security[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The workflow adds two post-publish jobs that wait 120 seconds after publish_to_pypi and dispatch deploy-cloud-mcp events to airbytehq/airbyte-ops-mcp for release publishes and manual publish runs.

Changes

Cloud MCP deployment dispatch

Layer / File(s) Summary
Post-publish dispatch
.github/workflows/pypi_publish.yml
A new deploy_cloud_mcp job runs after publish_to_pypi, reuses the release publish gating, waits 120 seconds, and sends a repository_dispatch event to airbytehq/airbyte-ops-mcp with deploy-cloud-mcp and mcp-server: cloud-mcp.
Preview publish dispatch
.github/workflows/pypi_publish.yml
A new deploy_cloud_mcp_preview job runs after publish_to_pypi, requires workflow_dispatch with inputs.publish == true, waits 120 seconds, and sends the same dispatch with preview: true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: triggering cloud-mcp deployment after PyPI publish.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/1782532058-cloud-mcp-deploy-trigger

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

Co-Authored-By: AJ Steers <aj@airbyte.io>
@github-code-quality

github-code-quality Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest-fast

The overall coverage in the branch is 67%. The coverage in the branch is 65%.

Show a code coverage summary of the most impacted files.
File d9f652f bb0a5fb +/-
airbyte/_util/api_util.py 36% 37% +1%
airbyte/registry.py 70% 72% +2%
airbyte/mcp/_tool_utils.py 72% 77% +5%
airbyte/mcp/int...c_history_ui.py 0% 36% +36%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/cloud/models.py 0% 91% +91%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%
airbyte/mcp/int...ive/__init__.py 0% 100% +100%
airbyte/mcp/int...tive/_prefab.py 0% 100% +100%

Python / code-coverage/pytest-no-creds

The overall coverage in the branch is 67%. The coverage in the branch is 65%.

Show a code coverage summary of the most impacted files.
File d9f652f bb0a5fb +/-
airbyte/_util/api_util.py 36% 37% +1%
airbyte/registry.py 70% 72% +2%
airbyte/mcp/_tool_utils.py 72% 77% +5%
airbyte/mcp/int...c_history_ui.py 0% 36% +36%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/cloud/models.py 0% 91% +91%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%
airbyte/mcp/int...ive/__init__.py 0% 100% +100%
airbyte/mcp/int...tive/_prefab.py 0% 100% +100%

Python / code-coverage/pytest

The overall coverage in the branch is 72%. The coverage in the branch is 71%.

Show a code coverage summary of the most impacted files.
File d9f652f bb0a5fb +/-
airbyte/registry.py 70% 72% +2%
airbyte/mcp/_tool_utils.py 72% 77% +5%
airbyte/mcp/server.py 69% 76% +7%
airbyte/mcp/int...c_history_ui.py 0% 36% +36%
airbyte/mcp/int...hared_models.py 0% 81% +81%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/cloud/models.py 0% 93% +93%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%
airbyte/mcp/int...ive/__init__.py 0% 100% +100%
airbyte/mcp/int...tive/_prefab.py 0% 100% +100%

Updated June 29, 2026 16:41 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@aaronsteers Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review June 27, 2026 04:11
Copilot AI review requested due to automatic review settings June 27, 2026 04:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_mcp job that runs after publish_to_pypi.
  • Waits briefly for PyPI availability, then triggers an airbytehq/airbyte-ops-mcp repository_dispatch event (deploy-cloud-mcp) with payload {"mcp-server":"cloud-mcp"}.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/pypi_publish.yml
Comment thread .github/workflows/pypi_publish.yml Outdated
Co-Authored-By: AJ Steers <aj@airbyte.io>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread .github/workflows/pypi_publish.yml Outdated
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')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙋 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)?


Devin session

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>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2fabc84 and bb0a5fb.

📒 Files selected for processing (1)
  • .github/workflows/pypi_publish.yml

Comment on lines +90 to +99
- 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"}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

3 participants