-
Notifications
You must be signed in to change notification settings - Fork 44
feat(integrations): declare HubSpot managed-connector migration + error hints #345
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
Changes from all commits
1522794
5be8b3f
4bf8516
3054242
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -87,6 +87,36 @@ export const hubspotOptionalScopes = [ | |||||||||||||||||
| "crm.schemas.deals.read", | ||||||||||||||||||
| ]; | ||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
| * Historical HubSpot OAuth scope bundles. Before the managed connector pointed | ||||||||||||||||||
| * at mcp.hubspot.com, already-stored HubSpot connectors carried these scopes. | ||||||||||||||||||
| * The integrations hub compares a stored connector's scopes against these | ||||||||||||||||||
| * bundles to detect legacy connectors that need re-discovery, so the values | ||||||||||||||||||
| * here must match the bundles the hub previously hardcoded exactly. | ||||||||||||||||||
| */ | ||||||||||||||||||
|
Comment on lines
+90
to
+96
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: This 7-line block comment narrates the diff and explains what the hub does with the data — neither survives in the source. The data's meaning is already in the
Suggested change
|
||||||||||||||||||
| export const hubspotLegacyScopeBundle = [ | ||||||||||||||||||
| ...hubspotRequiredScopes, | ||||||||||||||||||
| ...hubspotOptionalScopes, | ||||||||||||||||||
| ]; | ||||||||||||||||||
|
|
||||||||||||||||||
| export const hubspotLegacyScopeBundleWithoutOauth = | ||||||||||||||||||
| hubspotLegacyScopeBundle.filter((scope) => scope !== "oauth"); | ||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
| * Declarative HubSpot managed-connector migration descriptor. Lets the | ||||||||||||||||||
| * integrations hub migrate/normalize legacy HubSpot connectors from catalog | ||||||||||||||||||
| * data instead of branching on the "hubspot" slug in its own source. | ||||||||||||||||||
| */ | ||||||||||||||||||
|
Comment on lines
+105
to
+109
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: This 5-line block comment restates what
Suggested change
|
||||||||||||||||||
| export const hubspotManagedConnectorMigration = { | ||||||||||||||||||
| canonicalServerUrl: hubspotMcpServerUrl, | ||||||||||||||||||
| legacyScopeBundles: { | ||||||||||||||||||
| required: hubspotRequiredScopes, | ||||||||||||||||||
| optional: hubspotOptionalScopes, | ||||||||||||||||||
| union: hubspotLegacyScopeBundle, | ||||||||||||||||||
| unionWithoutOauth: hubspotLegacyScopeBundleWithoutOauth, | ||||||||||||||||||
| }, | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| const registrationDefaults = { | ||||||||||||||||||
| github: { | ||||||||||||||||||
| apiBaseUrl: "https://api.github.com", | ||||||||||||||||||
|
|
@@ -330,6 +360,13 @@ const registrationDefaults = { | |||||||||||||||||
| scopes: [], | ||||||||||||||||||
| credentialHelp: | ||||||||||||||||||
| "Use the client ID and secret from a HubSpot MCP auth app (Development → MCP Auth Apps). Standard HubSpot OAuth apps and private apps will not authenticate with mcp.hubspot.com.", | ||||||||||||||||||
| managedConnectorMigration: hubspotManagedConnectorMigration, | ||||||||||||||||||
|
neubig marked this conversation as resolved.
|
||||||||||||||||||
| errorHints: { | ||||||||||||||||||
|
neubig marked this conversation as resolved.
|
||||||||||||||||||
| 401: | ||||||||||||||||||
| "HubSpot MCP requires a user-level OAuth token from a HubSpot MCP auth app. Reconnect HubSpot with an MCP auth app instead of a standard HubSpot OAuth app or private app.", | ||||||||||||||||||
| 403: | ||||||||||||||||||
| "HubSpot MCP may need reauthorization to grant the current server tool scopes. Disconnect and reconnect HubSpot, then try discovery again.", | ||||||||||||||||||
| }, | ||||||||||||||||||
| }, | ||||||||||||||||||
| zendesk: { | ||||||||||||||||||
| apiBaseUrl: "https://{subdomain}.zendesk.com/api/v2", | ||||||||||||||||||
|
|
||||||||||||||||||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Suggestion: Four fields here where two would carry the same information.
unionis always[...required, ...optional]andunionWithoutOauthisunion.filter(s => s !== 'oauth')— the hub can compute both fromrequired+optional. Declaring all four as data creates a hidden invariant (changingrequiredmust imply recomputingunion, otherwise the hub's match logic drifts). Either dropunion/unionWithoutOauthand let the consumer derive them, or keep justunion+ anoauthScope: stringfield.