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

fix(source-intercom) raise config error on Active subscription needed error, transient error for Companies stream #42094

Merged
merged 12 commits into from
Jul 29, 2024

Conversation

darynaishchenko
Copy link
Collaborator

@darynaishchenko darynaishchenko commented Jul 18, 2024

What

resolved: https://github.com/airbytehq/oncall/issues/2909, https://github.com/airbytehq/oncall/issues/5291

How

Updated the source to use latest aribyte cdk.
Added config error for Active subscription needed error
Updated error handling for stream Companies

Review guide

User Impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

@darynaishchenko darynaishchenko self-assigned this Jul 18, 2024
Copy link

vercel bot commented Jul 18, 2024

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

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Jul 29, 2024 9:21am

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/intercom labels Jul 18, 2024
@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Jul 18, 2024

/format-fix

Format-fix job started... Check job output.

✅ Changes applied successfully. (bf31e13)

@darynaishchenko darynaishchenko requested a review from a team July 18, 2024 11:28
Copy link
Contributor

@brianjlai brianjlai left a comment

Choose a reason for hiding this comment

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

Things look good to me on the version bump and the fix for the error. One thing I wanted to highlight is on my OC shift, I noticed an issue related to intercom that could also be addressed in the version bump.

https://github.com/airbytehq/oncall/issues/5291 is asking to update recent CDK changes and classify the 400 and 500 errors as non-system errors. These are both transient due to Intercom or the customer's configuration along with a custom error.

Do you mind also updating the response_filters on the companies stream to allow for applying the correct failure type and error message to also close out this OC issue?

error_handlers:
  - type: DefaultErrorHandler
    description:
      " 400 - existing scroll_param, need to wait at least 60 sec
      to continue and retry 500 - server-side error, should retry after 60
      sec. "
    response_filters:
    < changes to manifest start here >
      - http_codes: [400]
        action: RETRY
        failure_type: transient_error
        error_message: "A scroll (export) job is already in progress for this Intercom account, causing the request to fail. Only one active scroll per Intercom account is allowed; ensure no overlap by limiting active connections or scheduling jobs appropriately."
      - http_codes: [500]
        action: RETRY
        failure_type: transient_error
    < changes to manifest end here >
    backoff_strategies:
      - type: ConstantBackoffStrategy
        backoff_time_in_seconds: 60
  - type: DefaultErrorHandler
    description:
      "404 - scroll_param is expired or not found while requesting,
      ignore"
    response_filters:
      - http_codes: [404]
        action: IGNORE

@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Jul 25, 2024

@brianjlai Sure, I'll update it. UPD: updated error handling for companies stream

@darynaishchenko darynaishchenko changed the title fix(source-intercom) raise config error on Active subscription needed error fix(source-intercom) raise config error on Active subscription needed error, transient error for Companies stream Jul 25, 2024
@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Jul 25, 2024

Regression tests report:
test_catalog_are_the_same [failed]: new connector version contains new fields: "is_resumable": true; and "multipleOf": 1e-08 now is "multipleOf": 1e-8

@brianjlai
Copy link
Contributor

brianjlai commented Jul 25, 2024

thanks for updating the connector. I will re-review Daryna

the is_resumable should be expected since we're bumping past CDK ^1 where that change to the catalog was added. We can mark that as an acceptable "regression" and it is used for incremental syncs + rfr syncs.

I am not sure about the second one however

Copy link
Contributor

@brianjlai brianjlai left a comment

Choose a reason for hiding this comment

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

question about whether we still need a custom Intercom HttpRequester class

since we deal with Response.status_code == 200,
the default requester's logic doesn't allow to handle the status of 200 with `should_retry()`.
"""
class IntercomHttpRequester(HttpRequester):
Copy link
Contributor

Choose a reason for hiding this comment

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

Something that seems unclear to me is where this custom IntercomHttpRequester differs from the regular HttpRequester that is supplied by the low-code CDK, since we removed interpret_response_status into a custom error handler, it doesn't seem like this class is overriding anything meaningful.

I see that we instantiate a bunch of interpolators, but the overwritten get_request_params() and other methods seem to just do the same behavior as interpolated_request_options_provider.py which makes me think this class is not needed anymore.

What do you think @darynaishchenko ? If this is in fact needed, let's add a docstring explaining the need for this custom class. Otherwise we should just swap this out and use HttpRequester in the manifest

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, you are right, here is no need to overwrite HttpRequester now. Changed it manifest file.
Run regression tests here: request urls looks good.

@darynaishchenko
Copy link
Collaborator Author

thanks for updating the connector. I will re-review Daryna

the is_resumable should be expected since we're bumping past CDK ^1 where that change to the catalog was added. We can mark that as an acceptable "regression" and it is used for incremental syncs + rfr syncs.

I am not sure about the second one however

@brianjlai Also not sure about second one, it should affect data if we use default schema normalization, but it's disabled for intercom. I didn't find any usage of it in destinations, so looks like it was added for documentation purpose. I think we can move on with it.

Copy link
Contributor

@pnilan pnilan left a comment

Choose a reason for hiding this comment

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

Looks good! nice work.

Copy link
Contributor

@brianjlai brianjlai left a comment

Choose a reason for hiding this comment

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

nice work @darynaishchenko and thanks for wrapping in the additional error handling change. that should also wrap an OC issue we have out right now

@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Jul 29, 2024

regression tests for latest version: link
test_catalog_are_the_same [failed] with the same error above.

"multipleOf": 1e-08 now is "multipleOf": 1e-8

I double checked value for multipleOf field in the get response for refresh schema action on UI and on both version it's 1.0e-8(0.00000001 as manifest declares).
So I'm approving regression tests for these changes.

@darynaishchenko
Copy link
Collaborator Author

darynaishchenko commented Jul 29, 2024

/approve-regression-tests

Check job output.

✅ Approving regression tests

@darynaishchenko darynaishchenko merged commit 4dc4200 into master Jul 29, 2024
37 of 38 checks passed
@darynaishchenko darynaishchenko deleted the daryna/source-intercom/raise-config-error branch July 29, 2024 12:16
jtruty pushed a commit to jtruty/airbyte that referenced this pull request Aug 10, 2024
…d` error, transient error for Companies stream (airbytehq#42094)

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@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 connectors/source/intercom
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants