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 Amazon Seller Partner: OAuth support #13119

Merged
merged 42 commits into from
May 30, 2022

Conversation

annalvova05
Copy link
Contributor

@annalvova05 annalvova05 commented May 24, 2022

What

Add OAuth2.0 authorization.
amazon-sp-2
asp-1

How

Implement OAuth java part and update spec.

Recommended reading order

  1. spec.py
  2. AmazonSellerPartnerOAuthFlow.java

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

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

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

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

…-sp-oauth

# Conflicts:
#	airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/__init__.py
#	airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/source.py
#	airbyte-integrations/connectors/source-amazon-seller-partner/source_amazon_seller_partner/spec.json
#	airbyte-integrations/connectors/source-amazon-seller-partner/unit_tests/test_source.py
#	airbyte-scheduler/persistence/src/test/java/io/airbyte/scheduler/persistence/DefaultJobPersistenceTest.java
@github-actions github-actions bot added the area/connectors Connector related issues label May 24, 2022
@annalvova05 annalvova05 temporarily deployed to more-secrets May 24, 2022 11:18 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets May 24, 2022 11:24 Inactive
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label May 24, 2022
@annalvova05 annalvova05 temporarily deployed to more-secrets May 24, 2022 15:04 Inactive
…-sp-docs

# Conflicts:
#	docs/integrations/sources/amazon-seller-partner.md
@annalvova05
Copy link
Contributor Author

annalvova05 commented May 24, 2022

/test connector=connectors/source-amazon-seller-partner

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2378868895
✅ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2378868895
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_amazon_seller_partner/spec.py           22      0   100%
source_amazon_seller_partner/__init__.py        2      0   100%
source_amazon_seller_partner/constants.py      37      1    97%
source_amazon_seller_partner/source.py         49     10    80%
source_amazon_seller_partner/streams.py       365    169    54%
source_amazon_seller_partner/auth.py           61     36    41%
---------------------------------------------------------------
TOTAL                                         536    216    60%

@annalvova05 annalvova05 marked this pull request as ready for review May 24, 2022 15:38
@annalvova05 annalvova05 requested a review from lazebnyi May 24, 2022 15:38
Copy link
Contributor

@midavadim midavadim left a comment

Choose a reason for hiding this comment

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

This update can be merged without airbyte review

@annalvova05
Copy link
Contributor Author

annalvova05 commented May 30, 2022

/test connector=connectors/source-amazon-seller-partner

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2409114288
✅ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2409114288
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_amazon_seller_partner/spec.py           22      0   100%
source_amazon_seller_partner/__init__.py        2      0   100%
source_amazon_seller_partner/constants.py      37      1    97%
source_amazon_seller_partner/source.py         49     10    80%
source_amazon_seller_partner/streams.py       365    169    54%
source_amazon_seller_partner/auth.py           61     36    41%
---------------------------------------------------------------
TOTAL                                         536    216    60%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestBasicRead.test_read because not found in the config
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/plugin.py:56: Skipping TestFullRefresh.test_sequential_reads because not found in the config
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
======================== 17 passed, 3 skipped in 5.94s =========================

@annalvova05 annalvova05 temporarily deployed to more-secrets May 30, 2022 12:43 Inactive
@codecov
Copy link

codecov bot commented May 30, 2022

Codecov Report

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

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

@@            Coverage Diff            @@
##             master   #13119   +/-   ##
=========================================
  Coverage          ?   59.70%           
=========================================
  Files             ?        6           
  Lines             ?      536           
  Branches          ?        0           
=========================================
  Hits              ?      320           
  Misses            ?      216           
  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 9d1cd42...6eb06fa. Read the comment docs.

@annalvova05
Copy link
Contributor Author

annalvova05 commented May 30, 2022

/publish connector=connectors/source-amazon-seller-partner

🕑 connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2409214205
🚀 Successfully published connectors/source-amazon-seller-partner
🚀 Auto-bumped version for connectors/source-amazon-seller-partner
✅ connectors/source-amazon-seller-partner https://github.com/airbytehq/airbyte/actions/runs/2409214205

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets May 30, 2022 13:19 Inactive
@annalvova05 annalvova05 merged commit 1dbd7ab into master May 30, 2022
@annalvova05 annalvova05 deleted the alvova/11963-amazon-sp-oauth branch May 30, 2022 13:24
@annalvova05 annalvova05 temporarily deployed to more-secrets May 30, 2022 13:25 Inactive
jscottpolevault pushed a commit to jscottpolevault/airbyte that referenced this pull request Jun 1, 2022
* Update docs

* add oauth

* add spec.py

* test

* fix

* fix

* add lwa_app_id

* test

* test

* fix

* add beta version

* fix

* test

* test

* test

* merge

* fix

* fix

* fix

* test

* test

* test

* test

* sort AWSRegion

* up

* add import

* up

* up

* up

* fix

* fix tests

* bump version

* upd

* auto-bump connector version

* format

Co-authored-by: Octavia Squidington III <[email protected]>
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
Development

Successfully merging this pull request may close these issues.

🎉 Source Amazon Seller Partner: Implement OAuth2.0
4 participants