Skip to content

Comments

chore: refactor integrations.settings column and extract nango mappings (CM-963)#3866

Open
themarolt wants to merge 3 commits intomainfrom
refactor-integrations-table-CM-963
Open

chore: refactor integrations.settings column and extract nango mappings (CM-963)#3866
themarolt wants to merge 3 commits intomainfrom
refactor-integrations-table-CM-963

Conversation

@themarolt
Copy link
Contributor

@themarolt themarolt commented Feb 23, 2026

Note

Medium Risk
Includes a schema migration moving GitHub-Nango connection mappings into a new table and removing several integration columns/endpoints; risks are mainly around data migration correctness and any missed code paths still expecting settings.nangoMapping or removed import/limit fields.

Overview
Refactors integration persistence by dropping deprecated integration columns (limitCount, limitLastResetAt, emailSentAt, importHash) and removing the /integration/import API + related permission/service logic.

Extracts GitHub-Nango settings.nangoMapping into a new integration.nango_mapping table, migrates existing JSONB data into it, and updates Nango cron jobs/workers + data-access helpers to read/write mappings via SQL. Backend responses for github-nango integrations continue to expose settings.nangoMapping by hydrating it from the new table, and the nango worker now links mapping rows to repositories via repositoryId when possible.

Unifies integration settings typing by moving platform-specific settings interfaces into @crowd/types (integrationSettings.ts) and making IIntegration generic/typed by PlatformType.

Written by Cursor Bugbot for commit ad940fb. This will update automatically on new commits. Configure here.

@themarolt themarolt requested a review from mbani01 February 23, 2026 13:48
Signed-off-by: Uroš Marolt <uros@marolt.me>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

`Repository not found, nango_mapping.repositoryId remains NULL`,
)
}
}
Copy link

Choose a reason for hiding this comment

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

Repository link uses non-normalized URL

Medium Severity

linkNangoMappingToRepo looks up repositories using an exact url = $(url) match, but repository URLs may be normalized (case, trailing slash, .git, protocol). This can cause the lookup to miss an existing repository and leave integration.nango_mapping.repositoryId as NULL, breaking the intended repo-linking behavior.

Fix in Cursor Fix in Web

}
output.settings = { ...output.settings, nangoMapping }
}
}
Copy link

Choose a reason for hiding this comment

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

N+1 queries when populating nango mapping

Medium Severity

_populateRelations now runs an extra SQL query per github-nango integration to rebuild settings.nangoMapping. Any endpoint returning lists of integrations can degrade into an N+1 query pattern, increasing latency and DB load proportional to the number of returned integrations.

Fix in Cursor Fix in Web

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.

1 participant