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 Instagram: Migrate Instagram sources Media, User, UserLiftimelnsights and Stories to low-code #39504

Merged

Conversation

aldogonzalez8
Copy link
Contributor

@aldogonzalez8 aldogonzalez8 commented Jun 14, 2024

What

We want to migrate certified connectors to low-code; in this case, it is Instagram Connector. We are initially migrating the following streams:

  • Media
  • Stories
  • Users
  • UserLifetimeInsights

Follow up in the next PR:

  • StortInsights
  • MediaInsights

Important: The original implementation used an api object to slice by user business accounts on all the Streams. To achieve this functionality I have created a new Api source that gets this information as pass it to other streams as a parent so they will slice by each account

How

I have followed this guide.

TLDR is the following

  • Fill this template with information about the connector.
  • Model the streams through connector builder.
  • If some feature is missing, add a custom component.
  • Update base code:
    1. Put the manifest
    2. update source file
    3. add testing around custom components.
    4. Run CAT

Review guide

  1. Manifest.yml: The manifest now includes the streams and schemas, so schemas for the scope of this PR were deleted.
  2. Source.py: Source was updated to YamlDeclarativeSource, and there is an override on streams to include non-migrated streams
  3. components.py: custom components created to handle:
    a. Fetch data for children field of Media; children are an array of media IDs that require their own data, so we go through the list to update the original children's object.
    b. Clear URL params "_nc_rid" and "ccb"
    c. convert breakdown list to an object
  4. tests_components.py: test for the new components
  5. streams.py: removed the old Python streams in the scope of this PR and updated parent classes of left streams.

User Impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Copy link

vercel bot commented Jun 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Jun 24, 2024 6:03am

@aldogonzalez8
Copy link
Contributor Author

Acceptance tests results

image

@aldogonzalez8 aldogonzalez8 changed the title Source Instagram: Migrate Instagram sources Media, User, UserLiftimelnsights and Stories to low-code ✨ Source Instagram: Migrate Instagram sources Media, User, UserLiftimelnsights and Stories to low-code Jun 14, 2024
@aldogonzalez8 aldogonzalez8 force-pushed the aldogonzalez8/migrate_instagram_low_code_simple_streams branch from 70303c3 to 47ea8a4 Compare June 14, 2024 19:12
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Jun 14, 2024
@@ -7,7 +7,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: 6acf6b55-4f1e-4fca-944e-1a3caef8aba8
dockerImageTag: 3.0.10
dockerImageTag: 3.0.11
Copy link
Contributor

Choose a reason for hiding this comment

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

@maxi297 @bazarnov what's your take on version bump when we're completely rewriting the connector? Should this be 4.0.0? I get that it's compatible, buuuuut.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've run live tests on a few connections without a problem. I don't know if this implies that my changes wouldn't need to be breaking changes. The new thing is the Api parent Stream (description), which passes the buz accounts to (now) child Streams. Anyway, I will hear experience call on this matter.

image

Copy link
Contributor

Choose a reason for hiding this comment

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

If the state, config and record outputs all have the same format and it does not add relatively big features, I would consider this a patch

Copy link
Collaborator

Choose a reason for hiding this comment

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

Once there are no regressions in terms of a breaking change, there is no need to make a major update, but the patch. @aldogonzalez8 FYI

@@ -0,0 +1,732 @@
version: 1.3.1
Copy link
Contributor

Choose a reason for hiding this comment

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

@btkcodedev see? When you make a connector in Builder, it's supposed to use the new CDK ;)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sure! Will prune Docker volumes and fetch new for next one

@aldogonzalez8
Copy link
Contributor Author

aldogonzalez8 commented Jun 16, 2024

For live tests, here you can find an analysis I did of the failing test test_catalog_are_the_same

image

https://www.loom.com/share/3d994c40315c4dc78cfb6f2f904da1d1
catalog_diff_iterable_item_added.json
catalog_diff_iterable_item_removed.json

Cc @maxi297 in case you are reviewing and saw those results

@aldogonzalez8
Copy link
Contributor Author

aldogonzalez8 commented Jun 18, 2024

Today's run from live tests looks good, sharing some screenshots.

image
image
image
image
image

There are a few diff of data related to the cdn servers which change on every request and live data like impressions; this is expected.

image

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.

LGTM! Nice!

@aldogonzalez8
Copy link
Contributor Author

This will be merged on June 24th, early in the Morning.

@aldogonzalez8 aldogonzalez8 merged commit 2921f22 into master Jun 24, 2024
30 checks passed
@aldogonzalez8 aldogonzalez8 deleted the aldogonzalez8/migrate_instagram_low_code_simple_streams branch June 24, 2024 18:27
xiaohansong pushed a commit that referenced this pull request Jul 9, 2024
…elnsights and Stories to low-code (#39504)

Co-authored-by: Natik Gadzhi <[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 connectors/source/instagram
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants