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 linkedin ads: Migrate to May 2023 #26372

Merged
merged 30 commits into from
May 30, 2023

Conversation

artem1205
Copy link
Collaborator

@artem1205 artem1205 commented May 22, 2023

What

Resolve #23609
Migrate to LinkedIn API version: May 2023

How

Migrate to LinkedIn API version: May 2023

Change Release Playbook: https://docs.google.com/document/d/1I8-4emBqKF8JiS3f3yET91MLNZSMZg_yLapaEGU927c/edit#

Recommended reading order

  1. y.python

🚨 User Impact 🚨

Removed Streams:

  • Ad Direct Sponsored Contents (no longer supported)

Schema changed in streams:

  • Accounts
  • Ad Campaign Analytics
  • Ad Creative Analytics
  • Campaign Groups
  • Campaigns
  • Creatives

State changed in stream:

  • creatives (cursor field changed lastModified -> lastModifiedAt

Pre-merge Actions

Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Unit & integration tests added

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.

@github-actions
Copy link
Contributor

github-actions bot commented May 22, 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.

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label May 22, 2023
@airbytehq airbytehq deleted a comment from sonarcloud bot May 23, 2023
@artem1205
Copy link
Collaborator Author

artem1205 commented May 23, 2023

/test connector=connectors/source-linkedin-ads

🕑 connectors/source-linkedin-ads https://github.com/airbytehq/airbyte/actions/runs/5063072876
❌ connectors/source-linkedin-ads https://github.com/airbytehq/airbyte/actions/runs/5063072876
🐛 https://gradle.com/s/qtt6we46mvyfa

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - Failed: Stream ad_ca...
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:587: Backward compatibility tests are disabled for version 0.1.15.
============= 1 failed, 37 passed, 2 skipped in 2389.21s (0:39:49) =============

@artem1205
Copy link
Collaborator Author

artem1205 commented May 24, 2023

/test connector=connectors/source-linkedin-ads

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

Name                               Stmts   Miss  Cover
------------------------------------------------------
source_linkedin_ads/analytics.py      46      0   100%
source_linkedin_ads/__init__.py        2      0   100%
source_linkedin_ads/source.py         47      3    94%
source_linkedin_ads/utils.py         108      8    93%
source_linkedin_ads/streams.py       180     29    84%
------------------------------------------------------
TOTAL                                383     40    90%

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:587: Backward compatibility tests are disabled for version 0.1.15.
================== 38 passed, 2 skipped in 2464.95s (0:41:04) ==================

@artem1205 artem1205 added the breaking-change Don't merge me unless you are ready. label May 24, 2023
@artem1205 artem1205 requested review from a team May 24, 2023 14:34
Copy link
Collaborator

@bazarnov bazarnov left a comment

Choose a reason for hiding this comment

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

Huge change! Looks good!

@sherifnada
Copy link
Contributor

@artem1205 could you share the link to the breaking changes checklist for this change?

@artem1205
Copy link
Collaborator Author

@artem1205 could you share the link to the breaking changes checklist for this change?

description updated

@@ -6,8 +6,7 @@
from setuptools import find_packages, setup

MAIN_REQUIREMENTS = [
"airbyte-cdk~=0.1",
"pendulum~=2.1",
"airbyte-cdk",
Copy link
Contributor

Choose a reason for hiding this comment

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

could you pin to a minor version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

GA connector should always use latest CDK version, isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

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

latest minor version. Since major version changes are breaking we shouldn't "automatically" update this connector if we release a major CDK version

@@ -336,3 +338,34 @@ def transform_data(records: List) -> Iterable[Mapping]:
record = transform_col_names(record, DESTINATION_RESERVED_KEYWORDS)

yield record


def _encode_params(data):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you clarify in the docstring a few things:

  1. why this is here instead of using the implementation in requests
  2. this is being used to override a private method in RequestEncodingMixin -- this is a smell and could break if we upgrade the requests library. Is there any way around doing it that way?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

refactored; will pass already encoded request params from now

@artem1205
Copy link
Collaborator Author

artem1205 commented May 24, 2023

/test connector=connectors/source-linkedin-ads

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

Name                               Stmts   Miss  Cover
------------------------------------------------------
source_linkedin_ads/analytics.py      46      0   100%
source_linkedin_ads/__init__.py        2      0   100%
source_linkedin_ads/utils.py          91      5    95%
source_linkedin_ads/source.py         47      3    94%
source_linkedin_ads/streams.py       178     28    84%
------------------------------------------------------
TOTAL                                364     36    90%

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:587: Backward compatibility tests are disabled for version 0.1.15.
================== 38 passed, 2 skipped in 2136.99s (0:35:36) ==================

@artem1205 artem1205 requested a review from sherifnada May 24, 2023 18:30
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

In the rollout announcement is there a link we can point users to so they can know exactly which streams were changed/fields were added or removed? ideally it's a link to Linkedin's docs about the change

@artem1205
Copy link
Collaborator Author

the only link we have is a migration guide and short video about versioning.
I had to check the streams and schemes empirically to accurately determine all changes (LinkedIn documentation is not complete)

# Conflicts:
#	airbyte-integrations/connectors/source-linkedin-ads/Dockerfile
#	airbyte-integrations/connectors/source-linkedin-ads/metadata.yaml
#	docs/integrations/sources/linkedin-ads.md
@artem1205 artem1205 merged commit e3076e6 into master May 30, 2023
18 checks passed
@artem1205 artem1205 deleted the artem1205/source-linkedin-ads-migration-23609 branch May 30, 2023 10:58
marcosmarxm pushed a commit to natalia-miinto/airbyte that referenced this pull request Jun 8, 2023
* Source LinkedIn Ads: update CDK version

* Source LinkedIn Ads: update schemas

* Source LinkedIn Ads: refactor source

* Source LinkedIn Ads: Migrate to May 2023

* Source LinkedIn Ads: monkeypatch url encoding to bypass encode :,%()

* Source LinkedIn Ads: fix test

* Source LinkedIn Ads: fix unittest

* Source Pinterest: refactor

* Source LinkedIn Ads: update docstrings; Refactor

* Source LinkedIn Ads: bump version

* Source LinkedIn Ads: update docs

* Source LinkedIn Ads: update schemas

* Automated Change

* Source LinkedIn Ads: update schemas; refactor

* Source LinkedIn Ads: update expected records

* Source LinkedIn Ads: refactor

* Source LinkedIn Ads: fix unit test

* Source LinkedIn Ads: fix acceptance test config

* Source LinkedIn Ads: update source

* Source LinkedIn Ads: update abnormal state

* Source LinkedIn Ads: add TypeTransformer + fix schema

* Source LinkedIn Ads: Format code

* Source LinkedIn Ads: update expected records

* Source LinkedIn Ads: update expected records

* Source LinkedIn Ads: update doc links

* Source LinkedIn Ads: pin CDK version

* Source LinkedIn Ads: refactor;
pass already encoded request params

* Source LinkedIn Ads: fix acceptance test versioning

---------

Co-authored-by: artem1205 <artem1205@users.noreply.github.com>
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 breaking-change Don't merge me unless you are ready. connectors/source/linkedin-ads
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source LinkedIn: Migrate to new versioned APIs and Content APIs by June 30, 2023
5 participants