Skip to content

feat(ENG-10766): add falcon connector support#10

Merged
adefreitas merged 2 commits into
mainfrom
ENG-10766/add-falcon-connector-support
Aug 27, 2025
Merged

feat(ENG-10766): add falcon connector support#10
adefreitas merged 2 commits into
mainfrom
ENG-10766/add-falcon-connector-support

Conversation

@adefreitas

@adefreitas adefreitas commented Aug 26, 2025

Copy link
Copy Markdown
Collaborator

Summary by cubic

Adds native Falcon connector support with versioned providers (provider@version) and the new configFields schema. Users can pick and connect specific connector versions; configs are fetched from Falcon or legacy endpoints as needed (ENG-10766).

  • New Features

    • Version-aware connectors: detect Falcon by version, show version in the list, and use provider@version as the button key.
    • Config fetching: use /hub/connectors/falcon/:key (encoded provider@version) for Falcon, and /hub/connectors/legacy/:key for legacy.
    • Falcon schema support: handle configFields (conditions, evaluated defaults, hub_settings, support link/description), prefill external-trigger-token, and keep secrets masked with a dummy value.
    • API/types: connectAccount posts provider@version; added FalconConnectorConfig union and AccountData.version; new isFalconVersion util.
  • Bug Fixes

    • Error panel in IntegrationFields shows raw provider_response when JSON parsing fails.

@adefreitas adefreitas requested review from Copilot and jpmiguel August 26, 2025 15:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces support for Falcon connector versions by implementing version-aware logic to differentiate between legacy and Falcon connectors. The system now handles different connector configurations and API endpoints based on the connector version.

  • Adds Falcon connector configuration support with distinct API endpoints
  • Implements version detection logic to route between legacy and Falcon connectors
  • Updates account connection flow to include version information

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/shared/utils/utils.ts Adds version detection utility to identify Falcon versions
src/modules/integration-picker/types.ts Defines new Falcon connector configuration interface and adds version field
src/modules/integration-picker/queries.ts Splits connector config queries into legacy and Falcon endpoints, updates account connection
src/modules/integration-picker/hooks/useIntegrationPicker.ts Implements version-aware connector configuration logic and form handling
src/modules/integration-picker/components/IntegrationList.tsx Updates integration display to show version info and use version-aware keys
src/modules/integration-picker/components/IntegrationFields.tsx Improves error handling for provider responses

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/shared/utils/utils.ts
Comment on lines +1 to +2
export const isFalconVersion = (version: string) => {
return version != null && version != '1' && version != '2';

Copilot AI Aug 26, 2025

Copy link

Choose a reason for hiding this comment

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

The function logic assumes any version that isn't null, '1', or '2' is a Falcon version. This could incorrectly classify unexpected version values. Consider explicitly checking for known Falcon version patterns or adding validation for expected version formats.

Suggested change
export const isFalconVersion = (version: string) => {
return version != null && version != '1' && version != '2';
// Falcon versions are expected to match the pattern 'falcon-x' or 'falcon-x.y', where x and y are numbers
if (typeof version !== 'string') return false;
const falconVersionPattern = /^falcon-\d+(\.\d+)?$/;
return falconVersionPattern.test(version);

Copilot uses AI. Check for mistakes.
return { fields };
}

if ('configFields' in connectorData.config) {

Copilot AI Aug 26, 2025

Copy link

Choose a reason for hiding this comment

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

Using property existence checks to determine config type is fragile. Consider using a discriminated union with a type field or explicit type guards to make the type distinction more reliable and maintainable.

Copilot uses AI. Check for mistakes.
Comment on lines +322 to +327
if ('authentication' in connectorData.config) {
return connectorData.config.authentication?.[
selectedIntegration.authentication_config_key
]?.[selectedIntegration.environment];
}
return connectorData.config;

Copilot AI Aug 26, 2025

Copy link

Choose a reason for hiding this comment

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

Similar to the previous issue, using property existence checks makes the code fragile. The fallback return connectorData.config could return incompatible types. Use proper type guards or discriminated unions to ensure type safety.

Suggested change
if ('authentication' in connectorData.config) {
return connectorData.config.authentication?.[
selectedIntegration.authentication_config_key
]?.[selectedIntegration.environment];
}
return connectorData.config;
if (hasAuthenticationConfig(connectorData.config)) {
return connectorData.config.authentication?.[
selectedIntegration.authentication_config_key
]?.[selectedIntegration.environment];
}
// Optionally, handle the fallback more safely or return null
return null;

Copilot uses AI. Check for mistakes.
@adefreitas adefreitas merged commit 3ed2a7d into main Aug 27, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants