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 Recharge: added old api version for orders stream #29992

Merged

Conversation

darynaishchenko
Copy link
Collaborator

@darynaishchenko darynaishchenko commented Aug 30, 2023

What

resolved: https://github.com/airbytehq/oncall/issues/2833
User doesn't have email, first_name, last_name columns in orders stream, because API v2022-11 removed it

How

Reverted to old API version 2022-01 where this fields are present

@darynaishchenko darynaishchenko self-assigned this Aug 30, 2023
@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues area/documentation Improvements or additions to documentation labels Aug 30, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 30, 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.
  • 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
Copy link
Contributor

source-recharge test report (commit 0d3b2d88f1) - ✅

⏲️ Total pipeline duration: 06mn03s

Step Result
Connector package install
Build source-recharge docker image for platform linux/x86_64
Unit tests
Acceptance tests
Code format checks
Validate airbyte-integrations/connectors/source-recharge/metadata.yaml
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-recharge test

@github-actions
Copy link
Contributor

source-recharge test report (commit caaa472aa6) - ✅

⏲️ Total pipeline duration: 05mn35s

Step Result
Connector package install
Build source-recharge docker image for platform linux/x86_64
Unit tests
Acceptance tests
Code format checks
Validate airbyte-integrations/connectors/source-recharge/metadata.yaml
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-recharge test

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

source-recharge test report (commit 8ef5395faa) - ✅

⏲️ Total pipeline duration: 06mn28s

Step Result
Connector package install
Build source-recharge docker image for platform linux/x86_64
Unit tests
Acceptance tests
Code format checks
Validate airbyte-integrations/connectors/source-recharge/metadata.yaml
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-recharge test

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

source-recharge test report (commit 75d3f37e06) - ✅

⏲️ Total pipeline duration: 06mn06s

Step Result
Connector package install
Build source-recharge docker image for platform linux/x86_64
Unit tests
Acceptance tests
Code format checks
Validate airbyte-integrations/connectors/source-recharge/metadata.yaml
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ View runs for commit in Dagger Cloud

Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command

airbyte-ci connectors --name=source-recharge test

@roman-yermilov-gl
Copy link
Contributor

There is another option that let us not to rollback to old API version. We can add ?include=customer query param: (https://developer.rechargepayments.com/2021-11/extending_responses), so we will have entier customer model included in response in this way:

{
    "id": 534919106,
    ...,
    "customer": {
        "id": 64962974,
        "email": "email@example.com",
        "external_customer_id": {
            "ecommerce": "5213433266347"
        },
        "hash": "f99bd4a6877257af"
    },
    "include": {
        "customer": {
            "id": 10000000,
            "analytics_data": {
                "utm_params": []
            },
            "created_at": "2021-05-13T09:46:44+00:00",
            "email": "email@example.com",
            "external_customer_id": {
                "ecommerce": "5213433266347"
            },
            "first_charge_processed_at": "2021-05-13T13:46:39+00:00",
            "first_name": "Banana",
            "has_payment_method_in_dunning": false,
            "has_valid_payment_method": true,
            "hash": "f99bd4a6877257af",
            "last_name": "Green",
            "phone": "+11111111111",
            "subscriptions_active_count": 1,
            "subscriptions_total_count": 1,
            "tax_exempt": false,
            "updated_at": "2023-05-13T04:16:36+00:00"
        }
    }
    ...
}

It let us transform a record, so we can put missing fields from include.customer.<field> to customer.<field>. There are also some disadvatages: record will contain more data and we will have some duplicated fields.
But advantages are: switching API version is a little bit destructive change because those versions are not backward compatible. So with this option we will break nothing but extend a model with some missing parts as well as keep API updated.
I am not requesting change. This is just another option of how we can fix this problem

@darynaishchenko
Copy link
Collaborator Author

There is another option that let us not to rollback to old API version. We can add ?include=customer query param: (https://developer.rechargepayments.com/2021-11/extending_responses), so we will have entier customer model included in response in this way:

{
    "id": 534919106,
    ...,
    "customer": {
        "id": 64962974,
        "email": "email@example.com",
        "external_customer_id": {
            "ecommerce": "5213433266347"
        },
        "hash": "f99bd4a6877257af"
    },
    "include": {
        "customer": {
            "id": 10000000,
            "analytics_data": {
                "utm_params": []
            },
            "created_at": "2021-05-13T09:46:44+00:00",
            "email": "email@example.com",
            "external_customer_id": {
                "ecommerce": "5213433266347"
            },
            "first_charge_processed_at": "2021-05-13T13:46:39+00:00",
            "first_name": "Banana",
            "has_payment_method_in_dunning": false,
            "has_valid_payment_method": true,
            "hash": "f99bd4a6877257af",
            "last_name": "Green",
            "phone": "+11111111111",
            "subscriptions_active_count": 1,
            "subscriptions_total_count": 1,
            "tax_exempt": false,
            "updated_at": "2023-05-13T04:16:36+00:00"
        }
    }
    ...
}

It let us transform a record, so we can put missing fields from include.customer.<field> to customer.<field>. There are also some disadvatages: record will contain more data and we will have some duplicated fields. But advantages are: switching API version is a little bit destructive change because those versions are not backward compatible. So with this option we will break nothing but extend a model with some missing parts as well as keep API updated. I am not requesting change. This is just another option of how we can fix this problem

this is a good point, but the problem is we have fields in old api version that don't exist in a new one. so in future we can receive another oncall about missing fields.

@darynaishchenko darynaishchenko merged commit a470355 into master Sep 11, 2023
25 checks passed
@darynaishchenko darynaishchenko deleted the daryna/source-recharge/oncall-2833/missing-columns branch September 11, 2023 09:43
@bazarnov
Copy link
Collaborator

so in future we can receive another oncall about missing fields.

And sure we did: https://github.com/airbytehq/oncall/issues/2956

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/recharge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants