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

Update CDK for source-xero #27007

Merged
merged 12 commits into from
Jun 7, 2023
Merged

Update CDK for source-xero #27007

merged 12 commits into from
Jun 7, 2023

Conversation

flash1293
Copy link
Contributor

What

Update xero connector wrt the change in #26966

How

Pass in client id and client secret directly.

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues CDK Connector Development Kit connectors/source/xero labels Jun 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

Before Merging a Connector Pull Request

Wow! What a great pull request you have here! 🎉

To merge this PR, ensure the following has been done/considered for each connector added or updated:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan and you've followed all steps in the Breaking Changes Checklist
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • You, or an Airbyter, have run /test successfully on this PR - or on a non-forked branch
  • You've updated the connector's metadata.yaml file (new!)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@flash1293
Copy link
Contributor Author

flash1293 commented Jun 5, 2023

/test connector=connectors/source-xero local_cdk=1

🕑 connectors/source-xero https://github.com/airbytehq/airbyte/actions/runs/5175505003
❌ connectors/source-xero https://github.com/airbytehq/airbyte/actions/runs/5175505003
🐛 https://gradle.com/s/umxixaotgb4oi

Build Failed

Test summary info:

	 =========================== short test summary info ============================
	 FAILED unit_tests/test_source.py::test_check_connection - TypeError: __init__...
	 FAILED unit_tests/test_source.py::test_streams - TypeError: __init__() got an...
	 �[31m================== �[31m�[1m2 failed�[0m, �[32m18 passed�[0m, �[33m34 warnings�[0m�[31m in 0.79s�[0m�[31m ===================�[0m

@flash1293
Copy link
Contributor Author

Seems like local_cdk doesn't work for unit_tests, however I ran them locally and they worked fine:

unit_tests/test_incremental_streams.py::test_cursor_field PASSED
unit_tests/test_incremental_streams.py::test_get_updated_state PASSED
unit_tests/test_incremental_streams.py::test_stream_slices PASSED
unit_tests/test_incremental_streams.py::test_supports_incremental PASSED
unit_tests/test_incremental_streams.py::test_source_defined_cursor PASSED
unit_tests/test_incremental_streams.py::test_stream_checkpoint_interval PASSED
unit_tests/test_incremental_streams.py::test_read_incremental PASSED
unit_tests/test_source.py::test_check_connection PASSED
unit_tests/test_source.py::test_streams PASSED
unit_tests/test_streams.py::test_request_params PASSED
unit_tests/test_streams.py::test_next_page_token PASSED
unit_tests/test_streams.py::test_parse_response PASSED
unit_tests/test_streams.py::test_request_headers PASSED
unit_tests/test_streams.py::test_http_method PASSED
unit_tests/test_streams.py::test_should_retry[HTTPStatus.OK-False] PASSED
unit_tests/test_streams.py::test_should_retry[HTTPStatus.BAD_REQUEST-False] PASSED
unit_tests/test_streams.py::test_should_retry[HTTPStatus.TOO_MANY_REQUESTS-True] PASSED
unit_tests/test_streams.py::test_should_retry[HTTPStatus.INTERNAL_SERVER_ERROR-True] PASSED
unit_tests/test_streams.py::test_backoff_time PASSED
unit_tests/test_streams.py::test_parse_date PASSED

@octavia-squidington-iii octavia-squidington-iii removed the CDK Connector Development Kit label Jun 7, 2023
@flash1293
Copy link
Contributor Author

flash1293 commented Jun 7, 2023

/test connector=connectors/source-xero

🕑 connectors/source-xero https://github.com/airbytehq/airbyte/actions/runs/5198513507
✅ connectors/source-xero https://github.com/airbytehq/airbyte/actions/runs/5198513507
Python tests coverage:

Name                      Stmts   Miss  Cover
---------------------------------------------
source_xero/source.py        25      0   100%
source_xero/__init__.py       2      0   100%
source_xero/streams.py      159      8    95%
source_xero/oauth.py         28     15    46%
---------------------------------------------
TOTAL                       214     23    89%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:100: The previous and actual specifications are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:598: The previous and actual discovered catalogs are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
================== 38 passed, 3 skipped in 661.74s (0:11:01) ===================

@flash1293 flash1293 marked this pull request as ready for review June 7, 2023 10:07
@flash1293 flash1293 requested a review from maxi297 June 7, 2023 10:07
@@ -83,8 +83,8 @@ def get_authenticator(config: Mapping[str, Any]) -> Mapping[str, Any]:
return XeroSingleUseRefreshTokenOauth2Authenticator(
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems odd that we have a custom component for that. It seems to be related to HTTP requests we are performing. Eventually, it might be interesting to increase the capabilities of OAuth in the CDK to avoid having those custom things

Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

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

On comment that is outside of scope for this PR

@flash1293 flash1293 merged commit f41b3e1 into master Jun 7, 2023
@flash1293 flash1293 deleted the flash1293/update-xero2 branch June 7, 2023 13:14
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/xero
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants