Skip to content

fix(cloud): Preserve the stored draft envelope when renaming builder definitions - #1391

Merged
Aaron ("AJ") Steers (aaronsteers) merged 2 commits into
release-candidate/v1from
devin/1792116932-builder-rename-preserve-draft
Oct 16, 2026
Merged

Aaron ("AJ") Steers (aaronsteers) merged 2 commits into
release-candidate/v1from
devin/1792116932-builder-rename-preserve-draft

Conversation

@aaronsteers

Copy link
Copy Markdown
Member

Overview

👉 TL;DR: Renaming a custom YAML source definition could drop parts of its saved draft. The rename now writes the draft back exactly as it was stored.

Specifically, CustomCloudSourceDefinition.rename sends the stored declarativeManifest.manifest unchanged to update_connector_builder_project. Only the read-only draft_manifest property unwraps the {"manifest": ...} envelope.

Follows up on #1381:

Changes

  • rename() no longer calls _unwrap_builder_manifest. The update endpoint replaces the stored draft with whatever is sent, so unwrapping on write lost envelope fields such as spec and version.
  • Test: a new preserves-envelope-draft case in test_custom_cloud_source_definition_rename_preserves_builder_data asserts that the full envelope reaches the update call.

Review Spotlight

Reviewers with limited time, please review first:

Test plan

  • uv run pytest tests/unit_tests/test_cloud_credentials.py: 155 passed

Link to Devin session: https://app.devin.ai/sessions/a51d808f26c9402fafc93e7640648187
Open in Devin Desktop: https://app.devin.ai/desktop/session/a51d808f26c9402fafc93e7640648187?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)

…definitions

Co-Authored-By: AJ Steers <aj@airbyte.io>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • 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/1792116932-builder-rename-preserve-draft' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1792116932-builder-rename-preserve-draft'

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.

🟢 Approval recommended

The focused fix prevents envelope-field loss and includes targeted regression coverage, with no unresolved findings.

0 open findings

What changed in this PR

Fixes draft-data loss when renaming custom Cloud source definitions, following up on #1381.

Changes:

  • Writes the stored draft envelope back unchanged, retaining read-only unwrapping.
  • Adds regression coverage for preserving envelope fields during rename.
File Description
tests/​unit_tests/​test_cloud_credentials.py Adds an envelope-preservation rename test case.
airbyte/​cloud/​connectors.py Preserves the stored draft unchanged during rename.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-code-quality

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Python

Python / code-coverage/pytest-unit

release-candidate/v1 devin/1792116932-bui... 073a02e +/-
— 76% —

Line coverage data for the release-candidate/v1 branch is not yet available.

View coverage of the 10 most covered files.
File release-candidate/v1 devin/1792116932-bui... 073a02e +/-
airbyte/cloud/models.py — 97% —
airbyte/mcp/_sso_auth.py — 96% —
airbyte/_direct...ctors/models.py — 95% —
airbyte/cloud/client.py — 90% —
airbyte/exceptions.py — 89% —
airbyte/mcp/cloud.py — 85% —
airbyte/progress.py — 80% —
airbyte/cloud/connectors.py — 79% —
airbyte/_util/api_util.py — 68% —
airbyte/shared/...ql_processor.py — 68% —

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

Co-Authored-By: AJ Steers <aj@airbyte.io>
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) marked this pull request as ready for review October 16, 2026 02:27
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) merged commit 463153a into release-candidate/v1 Oct 16, 2026
23 of 24 checks passed
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) deleted the devin/1792116932-builder-rename-preserve-draft branch October 16, 2026 02:27

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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