chore: refactor sync insights project to common layer and use it in nango worker as well (CM-786)#3628
Conversation
…ango worker as well Signed-off-by: Uroš Marolt <uros@marolt.me>
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
|
LGTM ✅ |
Signed-off-by: Uroš Marolt <uros@marolt.me>
Note
Moves repository-to-insights syncing and segment repo queries into common services and the data-access layer, updates backend to use them, and adds a nango worker activity to trigger sync after GitHub processing.
CommonIntegrationService.syncGithubRepositoriesToInsights(...)to upsertsegmentRepositories, prune stale mappings, and updateinsightsProject.repositories.findRepositoriesForSegment(...),findNangoRepositoriesToBeRemoved(...), plain repo unmap helpers, and includesegmentIdinfetchIntegrationById.getGithubMappedRepos(...),getGitlabMappedRepos(...), and cross-segment URL checks.updatedAttonow().GET /segments/{id}/repositories: switch to DALfindRepositoriesForSegment.CommonIntegrationService.syncGithubRepositoriesToInsights(...); use DAL for mapped repo queries; remove legacy segment-repo sync logic.SegmentRepositorynow provided by DAL.syncGithubReposToInsightsactivity and call it post GitHub connection processing to persist repositories to insights.Written by Cursor Bugbot for commit 41808d4. This will update automatically on new commits. Configure here.