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 Bing Ads: implement OAuth2.0 support, remove redirect_uri, change Account ID to User ID in spec #12937

Merged
merged 21 commits into from
May 23, 2022

Conversation

bazarnov
Copy link
Collaborator

@bazarnov bazarnov commented May 17, 2022

What

Resolving:
#9972
#6294
#12488
#12939
#12490
#12925

How

  • edited spec.json to reflect oauth support
  • added support of old input configuration for easy connector update transition for Customers
  • edited client.py to support oauth config
  • added MicrosoftBingAdsOAuthFlow.java class - oauth implementation
  • edited spec.json to get rid of accounts, user_id, customer_id from input configuration, get these values from authenticated user instead.
  • increased unit_tests coverage up to 92%

🚨 User Impact 🚨

No impact expected.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

  • 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
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here

@bazarnov bazarnov self-assigned this May 17, 2022
@github-actions github-actions bot added the area/connectors Connector related issues label May 17, 2022
@bazarnov bazarnov requested a review from lazebnyi May 17, 2022 20:02
@bazarnov
Copy link
Collaborator Author

bazarnov commented May 17, 2022

/test connector=connectors/source-bing-ads

🕑 connectors/source-bing-ads https://github.com/airbytehq/airbyte/actions/runs/2341104891
✅ connectors/source-bing-ads https://github.com/airbytehq/airbyte/actions/runs/2341104891
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        75      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py        85     25    71%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  913    246    73%
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_bing_ads/__init__.py       2      0   100%
source_bing_ads/cache.py         18      3    83%
source_bing_ads/source.py       252     83    67%
source_bing_ads/client.py        92     37    60%
source_bing_ads/reports.py      115     53    54%
-------------------------------------------------
TOTAL                           479    176    63%

Python short test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config
================== 21 passed, 1 skipped in 147.48s (0:02:27) ===================

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label May 17, 2022
@bazarnov bazarnov temporarily deployed to more-secrets May 17, 2022 20:09 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets May 17, 2022 20:09 Inactive
@bazarnov bazarnov linked an issue May 17, 2022 that may be closed by this pull request
@bazarnov bazarnov temporarily deployed to more-secrets May 17, 2022 20:15 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets May 17, 2022 20:15 Inactive
@bazarnov bazarnov mentioned this pull request May 17, 2022
1 task
@bazarnov bazarnov linked an issue May 18, 2022 that may be closed by this pull request
@bazarnov
Copy link
Collaborator Author

bazarnov commented May 18, 2022

/test connector=connectors/source-bing-ads

🕑 connectors/source-bing-ads https://github.com/airbytehq/airbyte/actions/runs/2345528837
✅ connectors/source-bing-ads https://github.com/airbytehq/airbyte/actions/runs/2345528837
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        75      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_incremental.py        85     25    71%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/tests/test_core.py              285    106    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  913    246    73%
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_bing_ads/__init__.py       2      0   100%
source_bing_ads/cache.py         18      3    83%
source_bing_ads/source.py       252     83    67%
source_bing_ads/client.py        92     37    60%
source_bing_ads/reports.py      115     53    54%
-------------------------------------------------
TOTAL                           479    176    63%

Python short test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config
================== 21 passed, 1 skipped in 154.24s (0:02:34) ===================

@bazarnov bazarnov temporarily deployed to more-secrets May 18, 2022 12:36 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets May 18, 2022 12:36 Inactive
@bazarnov bazarnov changed the title 🎉 Source Bing Ads: implement OAuth2.0 support 🎉 Source Bing Ads: implement OAuth2.0 support, remove redirect_uri, change Account ID to User ID in spec May 18, 2022
@airbytehq airbytehq deleted a comment from codecov bot May 18, 2022
@bazarnov bazarnov linked an issue May 19, 2022 that may be closed by this pull request
@airbytehq airbytehq deleted a comment from codecov bot May 19, 2022
@bazarnov bazarnov temporarily deployed to more-secrets May 19, 2022 08:57 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets May 19, 2022 08:57 Inactive
@bazarnov bazarnov temporarily deployed to more-secrets May 20, 2022 14:30 Inactive
@airbytehq airbytehq deleted a comment from codecov bot May 20, 2022
Copy link
Contributor

@evantahler evantahler left a comment

Choose a reason for hiding this comment

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

This is my first time reviewing an oAuth addition, so I'll add @girarda as a reviewer as well

@evantahler evantahler requested a review from girarda May 20, 2022 16:54
@airbytehq airbytehq deleted a comment from codecov bot May 21, 2022
@bazarnov bazarnov temporarily deployed to more-secrets May 21, 2022 21:51 Inactive
@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

❗ No coverage uploaded for pull request base (master@bb139ec). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head f53386b differs from pull request most recent head f82494c. Consider uploading reports for the commit f82494c to get more accurate results

@@            Coverage Diff            @@
##             master   #12937   +/-   ##
=========================================
  Coverage          ?   63.76%           
=========================================
  Files             ?        5           
  Lines             ?      483           
  Branches          ?        0           
=========================================
  Hits              ?      308           
  Misses            ?      175           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb139ec...f82494c. Read the comment docs.

@bazarnov bazarnov temporarily deployed to more-secrets May 23, 2022 15:36 Inactive
@midavadim midavadim temporarily deployed to more-secrets May 23, 2022 17:03 Inactive
@midavadim
Copy link
Contributor

midavadim commented May 23, 2022

/test connector=connectors/source-bing-ads

🕑 connectors/source-bing-ads https://github.com/airbytehq/airbyte/actions/runs/2372944213
✅ connectors/source-bing-ads https://github.com/airbytehq/airbyte/actions/runs/2372944213
Python tests coverage:

Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
source_acceptance_test/utils/__init__.py                 6      0   100%
source_acceptance_test/tests/__init__.py                 4      0   100%
source_acceptance_test/__init__.py                       2      0   100%
source_acceptance_test/tests/test_full_refresh.py       52      2    96%
source_acceptance_test/utils/asserts.py                 37      2    95%
source_acceptance_test/config.py                        77      6    92%
source_acceptance_test/utils/json_schema_helper.py     105     13    88%
source_acceptance_test/tests/test_incremental.py       121     25    79%
source_acceptance_test/utils/common.py                  80     17    79%
source_acceptance_test/tests/test_core.py              294    106    64%
source_acceptance_test/utils/compare.py                 62     23    63%
source_acceptance_test/base.py                          10      4    60%
source_acceptance_test/utils/connector_runner.py       110     48    56%
------------------------------------------------------------------------
TOTAL                                                  960    246    74%
Name                          Stmts   Miss  Cover
-------------------------------------------------
source_bing_ads/__init__.py       2      0   100%
source_bing_ads/source.py       252      9    96%
source_bing_ads/cache.py         18      1    94%
source_bing_ads/client.py        93     12    87%
source_bing_ads/reports.py      115     17    85%
-------------------------------------------------
TOTAL                           480     39    92%

Python short test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestIncremental.test_two_sequential_reads because not found in the config
================== 22 passed, 1 skipped in 278.17s (0:04:38) ===================

@midavadim
Copy link
Contributor

midavadim commented May 23, 2022

/publish connector=connectors/source-bing-ads

🕑 connectors/source-bing-ads https://github.com/airbytehq/airbyte/actions/runs/2373028262
🚀 Successfully published connectors/source-bing-ads
🚀 Auto-bumped version for connectors/source-bing-ads
✅ connectors/source-bing-ads https://github.com/airbytehq/airbyte/actions/runs/2373028262

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
Projects
None yet
7 participants