airbyte icon indicating copy to clipboard operation
airbyte copied to clipboard

🚨🚨 Source Facebook Marketing: Add statuses filters

Open iSINUS opened this issue 1 year ago • 6 comments

What

Add statuses filters to source connector Facebook Marketing for streams Campaigns, AdSets, Ads and AdCreatives (#32421). Remove option "include_deleted" as it from older versions of Marketing API and operates with not actual fields and values.

New config UI looks like: image

How

Update specification and stream filtering.

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

If user are interested in getting "deleted" stream data it is required to update configuration and set desired statuses ("ARCHIVED", "DELETED") per stream. But seems previous version of code worked not really correctly (there is no field delivery_info by which it was filtered and statuses used in code were in lower case and not correct for current Marketing API version). Incorrect current version call: /adsets?filtering=[ { "field": "adset.delivery_info", "operator": "IN", "value": [ "paused" ] }] New version call: /adsets?filtering=[ { "field": "adset.effective_status", "operator": "IN", "value": [ "PAUSED" ] }]

For connector PRs, use this section to explain which type of semantic versioning bump occurs as a result of the changes. Refer to our Semantic Versioning for Connectors guidelines for more information. Breaking changes to connectors must be documented by an Airbyte engineer (PR author, or reviewer for community PRs) by using the Breaking Change Release Playbook.

Pre-merge Actions

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • 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.
  • Connector version is set to 0.0.1
    • Dockerfile has version 0.0.1
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog with an entry for the initial version. See changelog example
    • docs/integrations/README.md

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.
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.
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:generateScaffolds then checking in your changes
  • Documentation which references the generator is updated as needed
Updating the Python CDK

Airbyter

Before merging:

  • Pull Request description explains what problem it is solving
  • Code change is unit tested
  • Build and my-py check pass
  • Smoke test the change on at least one affected connector
    • On Github: Run this workflow, passing --use-local-cdk --name=source-<connector> as options
    • Locally: airbyte-ci connectors --use-local-cdk --name=source-<connector> test
  • PR is reviewed and approved

After merging:

  • Publish the CDK
    • The CDK does not follow proper semantic versioning. Choose minor if this the change has significant user impact or is a breaking change. Choose patch otherwise.
    • Write a thoughtful changelog message so we know what was updated.
  • Merge the platform PR that was auto-created for updating the Connector Builder's CDK version
    • This step is optional if the change does not affect the connector builder or declarative connectors.

iSINUS avatar Nov 11 '23 07:11 iSINUS

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 Feb 20, 2024 6:23pm

vercel[bot] avatar Nov 11 '23 07:11 vercel[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 11 '23 07:11 CLAassistant

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.
  • [ ] Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • [ ] You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • [ ] 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
  • [ ] Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • [ ] If set, you've ensured the icon is present in the platform-internal repo. (Docs)

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.

github-actions[bot] avatar Nov 11 '23 07:11 github-actions[bot]

Hi, @marcosmarxm! Is there any update?

iSINUS avatar Nov 27 '23 10:11 iSINUS

Hi, @marcosmarxm! Is there any update?

iSINUS avatar Dec 14 '23 12:12 iSINUS

I asked to the team make the final review. I'll ask again, sorry the delay @iSINUS !

marcosmarxm avatar Dec 18 '23 13:12 marcosmarxm

@lazebnyi Added ALL statuses as default. Please, review. Thank you in advance.

iSINUS avatar Jan 08 '24 08:01 iSINUS

@marcosmarxm @lazebnyi Sorry for disturbing. Could you review PR as it is time consuming to merge every two days to have PR in correct state. Thank you.

iSINUS avatar Jan 11 '24 11:01 iSINUS

@marcosmarxm Sorry for disturbing. Could you finalise of the PR review? Thank you.

iSINUS avatar Jan 22 '24 07:01 iSINUS

@lazebnyi can you do the review again? After approved I'll handle the publish process.

marcosmarxm avatar Feb 01 '24 16:02 marcosmarxm

@iSINUS Hi, could you grant me permission to push changes to your branch? I'd like to add my fixes and then merge your PR. Thanks!

tolik0 avatar Feb 19 '24 13:02 tolik0

@iSINUS Hi, could you grant me permission to push changes to your branch? I'd like to add my fixes and then merge your PR. Thanks!

@tolik0 Hi! I have no rights to repo with branch, person who has is on vacation today. Will ask tomorrow. Thank you!

iSINUS avatar Feb 19 '24 13:02 iSINUS

@iSINUS Hi, could you grant me permission to push changes to your branch? I'd like to add my fixes and then merge your PR. Thanks!

@tolik0 Done. Now you should have access.

Please, take into account that you have removed AdCreative status, but it is required - https://developers.facebook.com/docs/marketing-api/reference/ad-creative/ "status enum {ACTIVE, IN_PROCESS, WITH_ISSUES, DELETED} | The status of the creative. WITH_ISSUES and IN_PROCESS are available for 4.0 or higher"

iSINUS avatar Feb 20 '24 12:02 iSINUS

@iSINUS Hello. The AdCreative endpoint doesn't support status filtering. Please check the docs: the Parameters block shows which fields can be used for filtering.

Status:  400\n  Response:\n    {\n      \"error\": {\n        \"message\": \"(#100) Filtering field 'adcreative.status' with operation 'in' is not supported\"

tolik0 avatar Feb 20 '24 13:02 tolik0

@iSINUS Hello. The AdCreative endpoint doesn't support status filtering. Please check the docs: the Parameters block shows which fields can be used for filtering.

Status:  400\n  Response:\n    {\n      \"error\": {\n        \"message\": \"(#100) Filtering field 'adcreative.status' with operation 'in' is not supported\"

@tolik0 OK. Thank you.

iSINUS avatar Feb 20 '24 14:02 iSINUS