feat(cli): add source-smoke-test CLI#996
feat(cli): add source-smoke-test CLI#996Aaron ("AJ") Steers (aaronsteers) merged 9 commits intomainfrom
source-smoke-test CLI#996Conversation
Co-Authored-By: AJ Steers <aj@airbyte.io>
🤖 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. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou 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/1773820262-smoke-test-source-extraction' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1773820262-smoke-test-source-extraction'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a Smoke Test source to the PyAirbyte CLI: package headers, predefined and runtime-configurable scenarios with helpers, a SourceSmokeTest implementation (spec/check/discover/read), a CLI entrypoint, and a pyproject script entry. Changes
Sequence DiagramsequenceDiagram
participant User as User/CLI
participant Launcher as Launcher (entrypoint)
participant Source as SourceSmokeTest
participant Scenarios as Scenarios Module
participant Catalog as AirbyteCatalog
participant Records as Record Stream
User->>Launcher: invoke `source-smoke-test`
Launcher->>Source: instantiate & invoke lifecycle (spec/check/discover/read)
User->>Source: spec()
Source-->>User: ConnectorSpecification
User->>Source: check(config)
Source->>Scenarios: _get_all_scenarios(config)
Scenarios-->>Source: combined scenarios
Source-->>User: AirbyteConnectionStatus
User->>Source: discover(config)
Source->>Scenarios: _build_streams_from_scenarios(scenarios)
Scenarios-->>Source: AirbyteStream objects
Source-->>User: AirbyteCatalog
User->>Source: read(config, catalog, state)
Source->>Scenarios: get_scenario_records(scenario)
Scenarios-->>Source: test records (or generated batches)
Source->>Records: emit AirbyteMessage records
Records-->>User: streaming records
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Want me to flag specific functions for deeper review (e.g., large-batch generation or read() emission), wdyt? 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
source-smoke-test as cli submodule
source-smoke-test as cli submodulesource-smoke-test CLI
…config type validation Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
…rns) Co-Authored-By: AJ Steers <aj@airbyte.io>
resolved feedback
Summary
Extracts the smoke-test source from PR #969 into its own dedicated submodule at
airbyte/cli/smoke_test_source/, so it can be reviewed and merged independently from the broader universal connector work.The new
source-smoke-testCLI entrypoint is registered inpyproject.toml.Related: #995 (ops repo test harness delivery), #969 (parent universal connector PR)
Structure:
airbyte/cli/smoke_test_source/_scenarios.py— 15 predefined test scenarios (basic types, nulls, naming edge cases, wide tables, unicode, large batches, etc.)airbyte/cli/smoke_test_source/source.py—SourceSmokeTestclass (extends CDKSource)airbyte/cli/smoke_test_source/run.py— thin CLI entry pointStructural change —
cli.py→cli/package:Adding the
smoke_test_source/submodule required convertingairbyte/cli.py(a module) intoairbyte/cli/(a package), which would shadow the original module. To resolve this:airbyte/cli.py→airbyte/cli/pyab.py(preserves git history viagit mv)airbyte/cli/__init__.pyre-exportsclifor backwards compatibilityairbyte.cli.pyab:clidocs/generate.pyupdated to reference the new pathOther fixes included:
scenario_filterandcustom_scenariosconfig fields (guards againstNone/wrong types)_get_connector_name()fix: usesmaxsplit=1andrsplit()for correct Docker image name parsingReview & Testing Checklist for Human
pyairbyte --helpandpyab --helpstill work — the CLI module was converted fromairbyte/cli.pyto a package atairbyte/cli/. Entry points now resolve viaairbyte.cli.pyab:cli. Confirm both commands work afterpip install -e .source-smoke-test specruns — install in dev mode and runsource-smoke-test specto confirm the entrypoint resolves and outputs a valid connector spec JSONdocs/generate.py— the pdoc path changed fromairbyte/cli.pytoairbyte/cli/pyab.py. Runpoe docs-generateto confirm docs still build correctlynull_handling,column_naming_edge_cases,large_batch_stream) to confirm the JSON schemas match the inline recordsNotes
check,discover,read,_get_all_scenarios) are untested. Determine if tests should be added before merge or tracked as follow-up.dict[str, Any]throughout (carried over from PR feat(connectors): add universal source and destination using PyAirbyte #969). A future improvement could type these with Pydantic models or dataclasses.cli/per explicit request, though the project convention prefers CLI modules as thin wrappers. This is an intentional placement decision.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Link to Devin session: https://app.devin.ai/sessions/9c72389579884c06bf18cef11c4550e8
Requested by: Aaron ("AJ") Steers (@aaronsteers)
Note
Auto-merge may have been disabled. Please check the PR status to confirm.