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 TikTok Marketing: support oauth flow #7636

Merged
merged 24 commits into from
Jan 21, 2022

Conversation

annalvova05
Copy link
Contributor

@annalvova05 annalvova05 commented Nov 4, 2021

What

Add TikTok Marketing OAuth support.
tiktok_1
tiktok_2

How

Change spec.py and source.py. Add java part.

Recommended reading order

  1. spec.py
  2. source.py
  3. TikTokMarketingOAuthFlow.java

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
  • Connector version bumped like described here

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
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here


This change is Reviewable

@annalvova05 annalvova05 self-assigned this Nov 4, 2021
@github-actions github-actions bot added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Nov 4, 2021
@annalvova05 annalvova05 linked an issue Nov 4, 2021 that may be closed by this pull request
@annalvova05 annalvova05 temporarily deployed to more-secrets November 4, 2021 14:45 Inactive
…oauth

# Conflicts:
#	.github/workflows/publish-command.yml
#	.github/workflows/test-command.yml
#	airbyte-integrations/connectors/source-tiktok-marketing/source_tiktok_marketing/source.py
#	airbyte-integrations/connectors/source-tiktok-marketing/source_tiktok_marketing/spec.py
#	docs/integrations/sources/tiktok-marketing.md
#	tools/bin/ci_credentials.sh
@annalvova05 annalvova05 marked this pull request as draft December 30, 2021 09:29
@annalvova05 annalvova05 temporarily deployed to more-secrets December 30, 2021 09:30 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 4, 2022 18:28 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 4, 2022 20:55 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 10, 2022 09:10 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 18, 2022 10:37 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 18, 2022 11:36 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 18, 2022 12:13 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 18, 2022 12:18 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 18, 2022 12:34 Inactive
…oauth

# Conflicts:
#	airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java
@annalvova05 annalvova05 temporarily deployed to more-secrets January 19, 2022 14:55 Inactive
@annalvova05
Copy link
Contributor Author

annalvova05 commented Jan 19, 2022

/test connector=connectors/source-tiktok-marketing

🕑 connectors/source-tiktok-marketing https://github.com/airbytehq/airbyte/actions/runs/1718643150
✅ connectors/source-tiktok-marketing https://github.com/airbytehq/airbyte/actions/runs/1718643150
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      6    92%
	 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              242     96    60%
	 source_acceptance_test/tests/test_full_refresh.py       38      0   100%
	 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     17    69%
	 source_acceptance_test/utils/compare.py                 62     23    63%
	 source_acceptance_test/utils/connector_runner.py       110     48    56%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  979    404    59%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                  Stmts   Miss  Cover
	 ---------------------------------------------------------
	 source_tiktok_marketing/__init__.py       2      0   100%
	 source_tiktok_marketing/source.py        40     12    70%
	 source_tiktok_marketing/spec.py          65     19    71%
	 source_tiktok_marketing/streams.py      294     88    70%
	 ---------------------------------------------------------
	 TOTAL                                   401    119    70%

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 19, 2022 15:01 Inactive
@annalvova05 annalvova05 marked this pull request as ready for review January 19, 2022 15:14
@annalvova05 annalvova05 changed the title 🎉 Source TikTok Ads: support oauth flow 🎉 Source TikTok Marketing: support oauth flow Jan 19, 2022
Copy link
Contributor

@antixar antixar left a comment

Choose a reason for hiding this comment

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

Some minor comments

Comment on lines +53 to +56
final URIBuilder builder = new URIBuilder()
.setScheme("https")
.setHost("ads.tiktok.com")
.setPath("marketing_api/auth")
Copy link
Contributor

Choose a reason for hiding this comment

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

why does this logic use "ads.tiktok.com" here but for loading of access tokens another one (business-api.tiktok.com)?
I remember that ads.tiktok.com is the old API domain. Please check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I can see in the documentation, TikTok changed its hostname only for API (ads.tiktok.com/open_api -> business-api.tiktok.com/open_api). Also, there is an Advertiser authorization URL in TikTok Apps Basic information, it starts from ads.tiktok.com.

…oauth

# Conflicts:
#	airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java
@annalvova05 annalvova05 requested a review from antixar January 20, 2022 10:41
@annalvova05 annalvova05 temporarily deployed to more-secrets January 20, 2022 10:42 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 21, 2022 09:36 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 21, 2022 12:51 Inactive
@annalvova05 annalvova05 temporarily deployed to more-secrets January 21, 2022 14:37 Inactive
Copy link
Contributor

@antixar antixar left a comment

Choose a reason for hiding this comment

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

LGTM
Please publish your changes

@annalvova05
Copy link
Contributor Author

annalvova05 commented Jan 21, 2022

/test connector=connectors/source-tiktok-marketing

🕑 connectors/source-tiktok-marketing https://github.com/airbytehq/airbyte/actions/runs/1730632705
✅ connectors/source-tiktok-marketing https://github.com/airbytehq/airbyte/actions/runs/1730632705
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      6    92%
	 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              242     96    60%
	 source_acceptance_test/tests/test_full_refresh.py       38      0   100%
	 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     17    69%
	 source_acceptance_test/utils/compare.py                 62     23    63%
	 source_acceptance_test/utils/connector_runner.py       110     48    56%
	 source_acceptance_test/utils/json_schema_helper.py     115     14    88%
	 ------------------------------------------------------------------------
	 TOTAL                                                  979    404    59%
	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                  Stmts   Miss  Cover
	 ---------------------------------------------------------
	 source_tiktok_marketing/__init__.py       2      0   100%
	 source_tiktok_marketing/source.py        45     16    64%
	 source_tiktok_marketing/spec.py          65     19    71%
	 source_tiktok_marketing/streams.py      294     88    70%
	 ---------------------------------------------------------
	 TOTAL                                   406    123    70%

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 21, 2022 20:25 Inactive
@annalvova05
Copy link
Contributor Author

annalvova05 commented Jan 21, 2022

/publish connector=connectors/source-tiktok-marketing

🕑 connectors/source-tiktok-marketing https://github.com/airbytehq/airbyte/actions/runs/1730687870
✅ connectors/source-tiktok-marketing https://github.com/airbytehq/airbyte/actions/runs/1730687870

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 21, 2022 20:39 Inactive
@annalvova05 annalvova05 merged commit 8529928 into master Jan 21, 2022
@annalvova05 annalvova05 deleted the alvova/7098-tiktok-oauth branch January 21, 2022 21:01
@annalvova05 annalvova05 temporarily deployed to more-secrets January 21, 2022 21:03 Inactive
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 TikTok Marketing: support oauth
4 participants