Skip to content
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

🎉 Source Drift: migrate to the CDK #7247

Merged
merged 4 commits into from
Oct 27, 2021

Conversation

vitaliizazmic
Copy link
Contributor

What

Refactoring Source Drift to use the CDK

Closes #7041

How

This task is part of issue #6164. The Source significantly relies on dead CDK code. So import BaseClient and BaseSource from base_python were replaced by import from deprecated package of the CDK. Gradle file, setup.py, Dockerfile, requirements.txt were updated. main_dev.py was renamed to main.py, updated, and added to .dockerignore. Also SAT was enabled to Source.

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions
  • Connector version bumped like described here

@vitaliizazmic vitaliizazmic self-assigned this Oct 21, 2021
@github-actions github-actions bot added the area/connectors Connector related issues label Oct 21, 2021
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Oct 21, 2021

/test connector=source-drift

🕑 source-drift https://github.com/airbytehq/airbyte/actions/runs/1368838088
✅ source-drift https://github.com/airbytehq/airbyte/actions/runs/1368838088
Python tests coverage:

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                 Stmts   Miss  Cover
	 ------------------------------------------------------------------------
	 source_acceptance_test/__init__.py                       2      0   100%
	 source_acceptance_test/base.py                          10      4    60%
	 source_acceptance_test/config.py                        74      8    89%
	 source_acceptance_test/conftest.py                     108    108     0%
	 source_acceptance_test/plugin.py                        47     47     0%
	 source_acceptance_test/tests/__init__.py                 4      0   100%
	 source_acceptance_test/tests/test_core.py              200     94    53%
	 source_acceptance_test/tests/test_full_refresh.py       18     11    39%
	 source_acceptance_test/tests/test_incremental.py        69     38    45%
	 source_acceptance_test/utils/__init__.py                 6      0   100%
	 source_acceptance_test/utils/asserts.py                 37      2    95%
	 source_acceptance_test/utils/common.py                  41     24    41%
	 source_acceptance_test/utils/compare.py                 47     20    57%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  860    419    51%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                              Stmts   Miss  Cover
	 -----------------------------------------------------
	 source_drift/__init__.py              3      0   100%
	 source_drift/client/__init__.py       3      0   100%
	 source_drift/client/api.py           97     28    71%
	 source_drift/client/client.py        25      3    88%
	 source_drift/client/common.py        56     27    52%
	 source_drift/client/fixture.py       24     24     0%
	 source_drift/source.py                4      0   100%
	 -----------------------------------------------------
	 TOTAL                               212     82    61%

@jrhizor jrhizor temporarily deployed to more-secrets October 21, 2021 16:48 Inactive
{
"streams": [
{
"stream": {
Copy link
Contributor

@yevhenii-ldv yevhenii-ldv Oct 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this file?

@@ -5,12 +5,23 @@

from setuptools import find_packages, setup

MAIN_REQUIREMENTS = ["airbyte-cdk", "requests~=2.22"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MAIN_REQUIREMENTS = ["airbyte-cdk", "requests~=2.22"]
MAIN_REQUIREMENTS = ["airbyte-cdk~=0.1", "requests~=2.22"]

Comment on lines 2 to 4
!Dockerfile
!Dockerfile.test
!main.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!Dockerfile
!Dockerfile.test
!main.py
!Dockerfile
!main.py

Copy link
Contributor

@yevhenii-ldv yevhenii-ldv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just small comments, don`t forget update Changelogs


ENV AIRBYTE_ENTRYPOINT "/airbyte/base.sh"
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.2.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LABEL io.airbyte.version=0.2.2
LABEL io.airbyte.version=0.2.3

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets October 22, 2021 14:35 Inactive
@sherifnada sherifnada removed the request for review from davinchia October 25, 2021 00:28
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪🏼

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Oct 27, 2021
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Oct 27, 2021

/publish connector=connectors/source-drift

🕑 connectors/source-drift https://github.com/airbytehq/airbyte/actions/runs/1390429290
✅ connectors/source-drift https://github.com/airbytehq/airbyte/actions/runs/1390429290

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets October 27, 2021 13:54 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 27, 2021 13:55 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets October 27, 2021 14:04 Inactive
@vitaliizazmic vitaliizazmic merged commit 7592bca into master Oct 27, 2021
@vitaliizazmic vitaliizazmic deleted the vitalii/7041_drift_refactor_to_use_the_cdk branch October 27, 2021 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/drift connectors/sources-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Drift to use the CDK
7 participants