-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add options for returning record data and raw responses/requests in execute_stream_test_read #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add optional records field to StreamTestResult model - Add summary_only parameter (default True) to maintain backward compatibility - Extract and return actual record data when summary_only=False - Add comprehensive error handling for record data extraction - Add tests for both summary_only modes and error scenarios Co-Authored-By: AJ Steers <[email protected]>
Original prompt from AJ Steers
|
🤖 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. Testing This Branch via MCPTo test the changes in this specific branch with an MCP client like Claude Desktop, use the following configuration: {
"mcpServers": {
"connector-builder-mcp-dev": {
"command": "uvx",
"args": ["--from", "git+https://github.com/airbytehq/connector-builder-mcp.git@devin/1754099079-add-summary-only-option", "connector-builder-mcp"]
}
}
} Testing This Branch via CLIYou can test this version of the MCP Server using the following CLI snippet: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/connector-builder-mcp.git@devin/1754099079-add-summary-only-option#egg=airbyte-connector-builder-mcp' --help PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds functionality to optionally return actual record data from the execute_stream_test_read
MCP tool. Previously, the tool only returned summary metadata. With the new summary_only
parameter, users can now choose to receive the actual record data when summary_only=False
, while maintaining backward compatibility with the default behavior.
- Added optional
records
field toStreamTestResult
model to hold actual record data - Added
summary_only
parameter toexecute_stream_test_read
function with defaultTrue
for backward compatibility - Implemented record extraction logic with fallback handling for different data structures
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
connector_builder_mcp/_connector_builder.py | Added records field to StreamTestResult model and summary_only parameter with record extraction logic |
tests/init.py | Added comprehensive test cases for the new functionality including fallback scenarios |
- Change summary_only parameter default from True to False as requested - Update test to use new default behavior (no explicit parameter) - Rename test function to reflect it's testing the default behavior - All tests pass with new default behavior Addresses GitHub comments from @aaronsteers on PR #12 Co-Authored-By: AJ Steers <[email protected]>
…, include_raw_responses - Replace single summary_only parameter with three separate parameters - include_records: bool (defaults to False) - include_raw_requests, include_raw_responses: bool | None (defaults to None) - On success: None behaves like False - On failure: None behaves like True for debugging - Extract raw HTTP request/response data from CDK slices structure - Apply filter_config_secrets() to sanitize sensitive data in raw requests/responses - Update all tests to use new parameter structure - Add comprehensive tests for new functionality including nullable behavior Co-Authored-By: AJ Steers <[email protected]>
- Fix airbyte_cdk.models.airbyte_protocol imports to use airbyte_cdk.models - Add explicit type annotations for raw_requests_data and raw_responses_data - All local checks now pass: MyPy, pytest, and ruff Co-Authored-By: AJ Steers <[email protected]>
…onse_data - Replace include_raw_requests and include_raw_responses with single include_raw_response_data parameter - Update StreamTestResult model to use slices field instead of separate raw_requests/raw_responses - Attach entire slices array directly from CDK result - Update all tests to use new parameter structure - Maintain secret sanitization and hierarchical data structure Co-Authored-By: AJ Steers <[email protected]>
…ucture - Replace complex nested loops with single filter_config_secrets() calls - Update filter_config_secrets() to recursively handle lists and dictionaries - Eliminate 84 lines of complex iteration code - Maintain same level of secret sanitization security - All 49 tests continue to pass Co-Authored-By: AJ Steers <[email protected]>
- Change remaining 'if include_raw_response_data:' to 'if include_raw_response_data is not False:' - Ensures consistent nullable boolean behavior throughout the function - Completes implementation of GitHub comment suggestion Co-Authored-By: AJ Steers <[email protected]>
…le boolean behavior - Add comments explaining CDK TestReader can return data in two formats - Update parameter description to document None behavior on success vs failure - Address GitHub comment about conditional logic rationale Co-Authored-By: AJ Steers <[email protected]>
Co-Authored-By: AJ Steers <[email protected]>
…ring Co-Authored-By: AJ Steers <[email protected]>
Co-Authored-By: AJ Steers <[email protected]>
…ub feedback Co-Authored-By: AJ Steers <[email protected]>
… feedback Co-Authored-By: AJ Steers <[email protected]>
…slices directly - Add _without_records() helper to remove records from slices structure - Add _without_raw_requests_and_responses() helper to remove raw HTTP data - Modify execute_stream_test_read to use helpers and return slices directly - Replace problematic conditional logic with proper record extraction from nested structure - Fix whitespace formatting issues for ruff compliance - All 49 tests passing Co-Authored-By: AJ Steers <[email protected]>
- Remove helper functions _without_records and _without_raw_requests_and_responses - Remove include_records and include_raw_response_data parameters - Always return both records and slices data with secrets filtered - Reduce implementation from 172 lines to ~60 lines - Remove mocked unit tests, keep integration tests - Verified functionality with Rick and Morty API test Co-Authored-By: AJ Steers <[email protected]>
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. Testing This Branch via MCPTo test the changes in this specific branch with an MCP client like Claude Desktop, use the following configuration: {
"mcpServers": {
"connector-builder-mcp-dev": {
"command": "uvx",
"args": ["--from", "git+https://github.com/airbytehq/connector-builder-mcp.git@devin/1754099079-add-summary-only-option", "connector-builder-mcp"]
}
}
} Testing This Branch via CLIYou can test this version of the MCP Server using the following CLI snippet: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/connector-builder-mcp.git@devin/1754099079-add-summary-only-option#egg=airbyte-connector-builder-mcp' --help PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Simplify execute_stream_test_read to minimal implementation
Summary
This PR dramatically simplifies the
execute_stream_test_read
function from 172 lines to ~60 lines (66% reduction) by removing complex conditional logic and helper functions. The function now always returns both record data and raw request/response metadata with secrets filtered, eliminating the need forinclude_records
andinclude_raw_response_data
parameters.Key Changes:
include_records
andinclude_raw_response_data
_without_records
and_without_raw_requests_and_responses
filter_config_secrets
to slicesReview & Testing Checklist for Human
execute_stream_test_read
with the removed parameters (include_records
,include_raw_response_data
)filter_config_secrets
properly sanitizes all sensitive data in the slices outputRecommended Test Plan:
max_records=1000
)Diagram
Notes
The main risk is that this is a breaking change disguised as a simplification. While the code is cleaner and the integration test passes, we need to verify no existing code depends on the removed functionality.