Skip to content

ci: fix cloud-mcp preview auto-deploy (GitHub App auth + released version) - #1092

Draft
Aaron ("AJ") Steers (aaronsteers) wants to merge 2 commits into
mainfrom
devin/1784938016-cloud-mcp-preview-app-token
Draft

ci: fix cloud-mcp preview auto-deploy (GitHub App auth + released version)#1092
Aaron ("AJ") Steers (aaronsteers) wants to merge 2 commits into
mainfrom
devin/1784938016-cloud-mcp-preview-app-token

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

The PyAirbyte release-triggered cloud-mcp preview auto-deploy has never worked: deploy_cloud_mcp_preview authenticated the cross-repo repository_dispatch with secrets.GITHUB_CI_WORKFLOW_TRIGGER_PAT, a secret that doesn't exist in this repo (it lives in airbyte-ops-mcp). At runtime it resolved empty and peter-evans/repository-dispatch failed with Parameter token or opts.auth is required, so no dispatch ever reached airbyte-ops-mcp (confirmed on the v0.53.1 release run).

Two fixes here:

  1. Auth via the Octavia GitHub App (the pattern already used by prerelease-command.yml) instead of the phantom PAT — an installation token scoped to the target repo:
- uses: actions/create-github-app-token@v2.1.4    # scoped to airbyte-ops-mcp
  id: get-app-token
  with:
    owner: airbytehq
    repositories: airbyte-ops-mcp
    app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
    private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- uses: peter-evans/repository-dispatch@v4.0.1
  with:
    token: ${{ steps.get-app-token.outputs.token }}   # was: secrets.GITHUB_CI_WORKFLOW_TRIGGER_PAT
    ...
  1. Carry the released version in the dispatch payload so the preview actually reflects the new library. Previously the payload had no version, so even a successful dispatch would have rebuilt cloud-mcp off whatever requirements.txt was already pinned to:
client-payload: {"mcp-server":"cloud-mcp","preview":"true","airbyte-version":"<version>"}

<version> is resolved from release.tag_name (minus a leading v) for release events, or inputs.version_override for workflow_dispatch prereleases.

The consuming side lives in airbytehq/airbyte-ops-mcp#1175: on a deploy-cloud-mcp dispatch carrying airbyte-version, that workflow opens/refreshes a deterministic airbyte==<version> bump PR and deploys the cloud-mcp preview off it.

Prerequisite (ops/admin): the Octavia GitHub App must be installed on airbyte-ops-mcp with contents: write (required for the /dispatches endpoint and for the bump-branch push on the consuming side). AJ confirmed it's scoped for this.

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

Summary by CodeRabbit

  • Chores
    • Improved post-release automation for Cloud MCP preview deployments.
    • Preview deployments now use the exact published package version.
    • Added availability checks to ensure the published package is ready before deployment.
    • Improved release handling for both tagged releases and manually triggered publishing workflows.

…eased version

Co-Authored-By: AJ Steers <aj@airbyte.io>
Copilot AI review requested due to automatic review settings July 25, 2026 00:10
@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/1784938016-cloud-mcp-preview-app-token' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1784938016-cloud-mcp-preview-app-token'

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.

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

Fixes the release-triggered Cloud MCP preview auto-deploy by switching cross-repo repository_dispatch authentication to an Octavia GitHub App installation token (scoped to airbyte-ops-mcp) and by including the released airbyte version in the dispatch payload so the preview deploy reflects the newly published library.

Changes:

  • Resolve the published version (from release.tag_name or workflow_dispatch version_override) and expose it as a step output.
  • Authenticate dispatch to airbytehq/airbyte-ops-mcp via actions/create-github-app-token instead of a non-existent PAT.
  • Include airbyte-version in the repository_dispatch payload and update inline workflow documentation.

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

Comment thread .github/workflows/pypi_publish.yml Outdated
Comment on lines +84 to +86
# A PyPI publish dispatches the just-released version to airbyte-ops-mcp, which
# opens/refreshes a deterministic `airbyte==<version>` bump PR and deploys the
# cloud-mcp preview off it (see `deploy-mcp-command.yml`).

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.

☑️ Resolved in f645196. Reworded the comment to make the cross-repo location explicit: "dispatches the just-released version to airbyte-ops-mcp, whose deploy-mcp-command.yml opens/refreshes a deterministic airbyte==<version> bump PR and deploys the cloud-mcp preview off it." That consuming workflow lives in airbytehq/airbyte-ops-mcp#1175.

repository: airbytehq/airbyte-ops-mcp
event-type: deploy-cloud-mcp
client-payload: '{"mcp-server": "cloud-mcp", "preview": "true"}'
client-payload: '{"mcp-server": "cloud-mcp", "preview": "true", "airbyte-version": "${{ steps.version.outputs.value }}"}'

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.

☑️ Resolved in f645196. The version is now validated against a PEP 440-ish regex (^[0-9]+\.[0-9]+\.[0-9]+([.a-zA-Z0-9-]*)?$) in the Resolve released version step and the run fails if it doesn't match, so by the time it's interpolated into the client-payload JSON it can only contain [0-9A-Za-z.-] — no quotes/backslashes to break the JSON. I kept the plain interpolation rather than toJson(...) since the validated value is guaranteed safe.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f98f362-c529-4a83-a166-1e2365470844

📥 Commits

Reviewing files that changed from the base of the PR and between 2173ea1 and f645196.

📒 Files selected for processing (1)
  • .github/workflows/pypi_publish.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/pypi_publish.yml

📝 Walkthrough

Walkthrough

The PyPI publish workflow resolves and validates the exact package version, waits for its PyPI endpoint, authenticates with a GitHub App token, and dispatches a versioned cloud-mcp preview deployment.

Changes

Cloud MCP preview deployment

Layer / File(s) Summary
Released version resolution and PyPI availability
.github/workflows/pypi_publish.yml
The workflow derives the version from the release tag or version_override, validates it, and polls PyPI for that specific release.
Versioned downstream deployment dispatch
.github/workflows/pypi_publish.yml
The workflow uses an Octavia GitHub App token and sends airbyte-version with the existing preview dispatch payload.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PublishWorkflow
  participant PyPI
  participant AirbyteOpsMCP
  PublishWorkflow->>PublishWorkflow: Resolve and validate release version
  PublishWorkflow->>PyPI: Poll version-specific package endpoint
  PublishWorkflow->>AirbyteOpsMCP: Dispatch deploy-cloud-mcp with airbyte-version
Loading

Possibly related PRs

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the workflow change and highlights the main updates: GitHub App auth and using the released version.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch devin/1784938016-cloud-mcp-preview-app-token

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 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: 3

🤖 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 94-102: Update the “Resolve released version” step to receive the
release tag and version override through the step environment rather than
interpolating event metadata into shell source. Select the appropriate
environment value, normalize its leading “v”, and validate the result against
the expected version format before writing the `value` output. Ensure the
validated value is emitted safely so malicious quotes cannot corrupt the output
consumed by the later JSON payload.
- Around line 104-105: Replace the fixed sleep in the “Wait for PyPI
availability” step with a bounded retry loop that polls the version-specific
PyPI endpoint and proceeds only when the published version is available; fail
clearly after the retry limit is exhausted.
- Around line 110-117: Update the “Authenticate as GitHub App” step using the
get-app-token action to explicitly request only the contents: write permission
via its permission-contents input, while preserving the existing repository and
credential configuration.
🪄 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 Plus

Run ID: 94db0807-2d50-49be-95f3-c2b68f90ee09

📥 Commits

Reviewing files that changed from the base of the PR and between 6f539a8 and 2173ea1.

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

Comment thread .github/workflows/pypi_publish.yml Outdated
Comment thread .github/workflows/pypi_publish.yml Outdated
Comment thread .github/workflows/pypi_publish.yml
…ken to contents:write

Co-Authored-By: AJ Steers <aj@airbyte.io>
Copilot AI review requested due to automatic review settings July 25, 2026 00:14

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@github-code-quality

github-code-quality Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest-fast

The overall coverage in commit f645196 in the devin/1784938016-clo... branch is 68%. The coverage in commit d9f652f in the main branch is 65%.

Show a code coverage summary of the most impacted files.
File main d9f652f devin/1784938016-clo... f645196 +/-
airbyte/mcp/_tool_utils.py 72% 84% +12%
airbyte/mcp/registry.py 53% 70% +17%
airbyte/mcp/server.py 69% 88% +19%
airbyte/mcp/_arg_resolvers.py 13% 44% +31%
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/_guards.py 0% 100% +100%

Python / code-coverage/pytest-no-creds

The overall coverage in commit f645196 in the devin/1784938016-clo... branch is 68%. The coverage in commit d9f652f in the main branch is 65%.

Show a code coverage summary of the most impacted files.
File main d9f652f devin/1784938016-clo... f645196 +/-
airbyte/mcp/_tool_utils.py 72% 84% +12%
airbyte/mcp/registry.py 53% 70% +17%
airbyte/mcp/server.py 69% 88% +19%
airbyte/mcp/_arg_resolvers.py 13% 44% +31%
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/_guards.py 0% 100% +100%

Python / code-coverage/pytest

The overall coverage in commit f645196 in the devin/1784938016-clo... branch is 73%. The coverage in commit d9f652f in the main branch is 71%.

Show a code coverage summary of the most impacted files.
File main d9f652f devin/1784938016-clo... f645196 +/-
airbyte/mcp/_tool_utils.py 72% 84% +12%
airbyte/mcp/registry.py 53% 70% +17%
airbyte/mcp/server.py 69% 88% +19%
airbyte/mcp/_arg_resolvers.py 13% 44% +31%
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/_guards.py 0% 100% +100%

Updated July 25, 2026 00:39 UTC

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.

2 participants