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-hubspot-native: conditionally discover email_events binding #2222

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

Alex-Bair
Copy link
Member

@Alex-Bair Alex-Bair commented Dec 19, 2024

Description:

Not all HubSpot accounts have enough permissions to access the endpoint for the email_events binding. This binding is now discovered only if we can successfully hit the associated endpoint without a permissions error.

The permissions checking code isn't very reusable, but it can be refactored later if/when the connector needs to conditionally discover other bindings.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

Tested on a local stack. Confirmed that email_events is discovered if a user's HubSpot account has the appropriate permissions, and email_events is not discovered if the user's HubSpot account does not have the appropriate permissions.

Existing captures that have email_events enabled but whose tokens do not have the appropriate permissions should either disable the email_events binding or perform discoveries to remove email_events as a possible binding. The latter will likely be handled by auto-discovers.

The discover snapshot change is expected since the order of the bindings returned by all_resources has changed (email_events is now at the end of the list).


This change is Reviewable

Not all HubSpot accounts have enough permissions to access the endpoint for the `email_events` binding. This binding is now discovered only if we can successfully hit the associated endpoint without a permissions error.

The permissions checking code isn't very reusable, but it can be refactored later if/when the connector needs to conditionally discover other bindings.
@Alex-Bair Alex-Bair linked an issue Dec 19, 2024 that may be closed by this pull request
@Alex-Bair Alex-Bair added the change:planned This is a planned change label Dec 19, 2024
@Alex-Bair Alex-Bair marked this pull request as ready for review December 19, 2024 19:53
Copy link
Member

@williamhbaker williamhbaker left a comment

Choose a reason for hiding this comment

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

LGTM

@Alex-Bair Alex-Bair merged commit 4de5a35 into main Dec 19, 2024
74 of 81 checks passed
@Alex-Bair Alex-Bair deleted the bair/hubspot-native-email-events branch December 19, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:planned This is a planned change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

source-hubspot-native: figure out required OAuth scopes
2 participants