Skip to content

fix: add protocol override sync-check test and clarifying comment#950

Closed
Aldo Gonzalez (aldogonzalez8) wants to merge 1 commit intoaldo/scopes-array-schemafrom
devin/1773187863-protocol-override-safeguards
Closed

fix: add protocol override sync-check test and clarifying comment#950
Aldo Gonzalez (aldogonzalez8) wants to merge 1 commit intoaldo/scopes-array-schemafrom
devin/1773187863-protocol-override-safeguards

Conversation

@aldogonzalez8
Copy link
Copy Markdown
Contributor

This PR targets the following PR:


Summary

Adds two small safeguards for the protocol dataclass overrides introduced in #934:

  1. Sync-check test — A parametrized test (test_protocol_override_fields_in_sync) that introspects the 4 overridden dataclasses in airbyte_protocol.py and asserts every field from the upstream airbyte_protocol_dataclasses package is present in the local override. This will fail on CI if the upstream package adds fields that the override doesn't include, preventing silent field loss at runtime.

  2. Clarifying comment — An inline comment on scopes_join_strategy: Optional[str] explaining why this field is typed as str in the protocol layer (not ScopesJoinStrategy enum) — because spec.py converts the enum to its .value before serialization reaches this layer.

Review & Testing Checklist for Human

  • Inline imports in test function — The test uses import airbyte_protocol_dataclasses.models and import airbyte_cdk.models.airbyte_protocol inside the test body to make the upstream-vs-override distinction explicit. Repo coding standards discourage inline imports; decide if this is acceptable for test clarity or if they should be moved to the top of the file.
  • Field-name-only check — The test verifies upstream field names are present in the override but does not check type compatibility. Confirm this level of coverage is sufficient.
  • Run poetry run pytest unit_tests/sources/declarative/spec/test_spec.py -v and verify all 11 tests pass (4 new parametrized cases + 7 existing).

Notes

… scopes_join_strategy

Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@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 and CI 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 CDK Version

You can test this version of the CDK using the following:

# Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@devin/1773187863-protocol-override-safeguards#egg=airbyte-python-cdk[dev]' --help

# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch devin/1773187863-protocol-override-safeguards

PR Slash Commands

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

  • /autofix - Fixes most formatting and linting issues
  • /poetry-lock - Updates poetry.lock file
  • /test - Runs connector tests with the updated CDK
  • /prerelease - Triggers a prerelease publish with default arguments
  • /poe build - Regenerate git-committed build artifacts, such as the pydantic models which are generated from the manifest JSON schema in YAML.
  • /poe <command> - Runs any poe command in the CDK environment
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

@github-actions
Copy link
Copy Markdown

PyTest Results (Fast)

3 896 tests  +4   3 884 ✅ +4   6m 44s ⏱️ -9s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 65263fd. ± Comparison against base commit 6aa5377.

@github-actions
Copy link
Copy Markdown

PyTest Results (Full)

3 899 tests  +4   3 887 ✅ +4   10m 28s ⏱️ -45s
    1 suites ±0      12 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 65263fd. ± Comparison against base commit 6aa5377.

@devin-ai-integration devin-ai-integration bot deleted the devin/1773187863-protocol-override-safeguards branch March 11, 2026 14:41
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.

1 participant