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 Freshdesk: migrate to CDK #8682

Merged
merged 9 commits into from
Dec 14, 2021

Conversation

vitaliizazmic
Copy link
Contributor

What

Refactoring Source Freshdesk to use the CDK

Closes #7764

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 added the area/connectors Connector related issues label Dec 9, 2021
@vitaliizazmic vitaliizazmic added this to the Connectors Dec 10 2021 milestone Dec 9, 2021
@vitaliizazmic vitaliizazmic self-assigned this Dec 9, 2021
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Dec 9, 2021

/test connector=source-freshdesk

🕑 source-freshdesk https://github.com/airbytehq/airbyte/actions/runs/1561023685
✅ source-freshdesk https://github.com/airbytehq/airbyte/actions/runs/1561023685
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                        76      8    89%
	 source_acceptance_test/conftest.py                     109    109     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              235     95    60%
	 source_acceptance_test/tests/test_full_refresh.py       38     27    29%
	 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                  54     24    56%
	 source_acceptance_test/utils/compare.py                 62     25    60%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  946    442    53%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                           Stmts   Miss  Cover
	 --------------------------------------------------
	 source_freshdesk/__init__.py       2      0   100%
	 source_freshdesk/api.py          190     86    55%
	 source_freshdesk/client.py        38     10    74%
	 source_freshdesk/errors.py         8      0   100%
	 source_freshdesk/source.py         4      0   100%
	 source_freshdesk/utils.py         42     23    45%
	 --------------------------------------------------
	 TOTAL                            284    119    58%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                           Stmts   Miss  Cover
	 --------------------------------------------------
	 source_freshdesk/__init__.py       2      0   100%
	 source_freshdesk/api.py          190     75    61%
	 source_freshdesk/client.py        38     18    53%
	 source_freshdesk/errors.py         8      0   100%
	 source_freshdesk/source.py         4      0   100%
	 source_freshdesk/utils.py         42      2    95%
	 --------------------------------------------------
	 TOTAL                            284     95    67%

@jrhizor jrhizor temporarily deployed to more-secrets December 9, 2021 22:48 Inactive
{
"streams": [
{
"name": "agents",
Copy link
Contributor

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? Haven't seen it used anywhere

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like someone someone by mistake added it here instead of at secrets

"stream": {
"name": "agents",
"json_schema": {},
"supported_sync_modes": ["incremental"],
Copy link
Contributor

Choose a reason for hiding this comment

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

A very strange catalog. Why is supported_sync_modes a incremental, can't it be the same as full_refresh?

"json_schema": {},
"supported_sync_modes": ["incremental"],
"source_defined_cursor": true,
"default_cursor_field": null
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this stream can be Incremental, why default_cursor_field is null?

"default_cursor_field": null
},
"sync_mode": "incremental",
"cursor_field": null,
Copy link
Contributor

Choose a reason for hiding this comment

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

same

- config_path: "secrets/config.json"
basic_read:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need configured catalog if test all streams

Suggested change
configured_catalog_path: "integration_tests/configured_catalog.json"

empty_streams: ["satisfaction_ratings", "tickets", "time_entries", "conversations"]
incremental:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
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
configured_catalog_path: "integration_tests/configured_catalog.json"

future_state_path: "integration_tests/abnormal_state.json"
full_refresh:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
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
configured_catalog_path: "integration_tests/configured_catalog.json"

@@ -2,28 +2,10 @@ plugins {
id 'airbyte-python'
id 'airbyte-docker'
id 'airbyte-integration-test-java'
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
id 'airbyte-integration-test-java'

@@ -5,8 +5,8 @@

from typing import Any, Iterable, Mapping, Tuple

from airbyte_protocol import AirbyteStream
from base_python import BaseClient
from airbyte_cdk.models.airbyte_protocol import AirbyteStream
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
from airbyte_cdk.models.airbyte_protocol import AirbyteStream
from airbyte_cdk.models import AirbyteStream

Copy link
Contributor

@keu keu left a comment

Choose a reason for hiding this comment

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

see comments

@VasylLazebnyk VasylLazebnyk removed this from the Connectors Dec 10 2021 milestone Dec 13, 2021
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Dec 13, 2021

/test connector=source-freshdesk

🕑 source-freshdesk https://github.com/airbytehq/airbyte/actions/runs/1572584430
✅ source-freshdesk https://github.com/airbytehq/airbyte/actions/runs/1572584430
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                        76      8    89%
	 source_acceptance_test/conftest.py                     109    109     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              235     95    60%
	 source_acceptance_test/tests/test_full_refresh.py       38     27    29%
	 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                  54     24    56%
	 source_acceptance_test/utils/compare.py                 62     25    60%
	 source_acceptance_test/utils/connector_runner.py        82     49    40%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  946    442    53%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                           Stmts   Miss  Cover
	 --------------------------------------------------
	 source_freshdesk/__init__.py       2      0   100%
	 source_freshdesk/api.py          190     86    55%
	 source_freshdesk/client.py        38     10    74%
	 source_freshdesk/errors.py         8      0   100%
	 source_freshdesk/source.py         4      0   100%
	 source_freshdesk/utils.py         42     23    45%
	 --------------------------------------------------
	 TOTAL                            284    119    58%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                           Stmts   Miss  Cover
	 --------------------------------------------------
	 source_freshdesk/__init__.py       2      0   100%
	 source_freshdesk/api.py          190     75    61%
	 source_freshdesk/client.py        38     18    53%
	 source_freshdesk/errors.py         8      0   100%
	 source_freshdesk/source.py         4      0   100%
	 source_freshdesk/utils.py         42      2    95%
	 --------------------------------------------------
	 TOTAL                            284     95    67%

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets December 13, 2021 11:15 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets December 13, 2021 11:16 Inactive
@vitaliizazmic vitaliizazmic requested a review from keu December 13, 2021 11:44
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets December 13, 2021 11:49 Inactive
Copy link
Contributor

@keu keu left a comment

Choose a reason for hiding this comment

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

lgtm

@keu keu changed the title 🎉 Source Freshdesk: migrate to the CDK 🎉 Source Freshdesk: migrate to CDK Dec 13, 2021
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets December 14, 2021 13:38 Inactive
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Dec 14, 2021
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Dec 14, 2021

/publish connector=connectors/source-freshdesk

🕑 connectors/source-freshdesk https://github.com/airbytehq/airbyte/actions/runs/1578247444
✅ connectors/source-freshdesk https://github.com/airbytehq/airbyte/actions/runs/1578247444

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets December 14, 2021 14:16 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets December 14, 2021 14:17 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets December 14, 2021 14:36 Inactive
@vitaliizazmic vitaliizazmic merged commit ad44895 into master Dec 14, 2021
@vitaliizazmic vitaliizazmic deleted the vitalii/7764_freshdesk_refactor_to_use_the_cdk branch December 14, 2021 15:05
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/freshdesk connectors/sources-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source Freshdesk: refactor to use the CDK
7 participants