-
Notifications
You must be signed in to change notification settings - Fork 728
fix: nango repos to delete logic #3696
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
Conversation
Signed-off-by: Joana Maia <[email protected]>
|
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. |
2 similar comments
|
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. |
|
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. |
The work developed on this PR #3673 was not working as expected, because the
analyseGitHubIntegrationis only triggered for integrations that are active (not deleted). So the code that was added before was never reached, as it was fetching for deleted integration for ids that were always active.What does this PR fixes?
For Staging and Development (AUTOMATIC)
nangoConnectionCleanupjob we already have in place. However, it had to be refactored because once again it was only querying the active integrations:shouldDeleteflag that is true ifTested now in staging and it deleted 26 stale connections. As we weren't considering deleted connections before, there were a lot of stale connections in Nango.
For Production (MANUAL):
Tests on new script in staging:
The connection that was deleted was created by me, disconnected from the UI and it became stale in Nango.
I believe that in production we have hundreds of connections like this because in the UI we see 8537 connections and in our logs we have 7159 total connections.
This is costing us unnecessary money in Nango.
Note
Refactors Nango cleanup to consider deleted integrations and age-based pruning, removes deleted-integration handling from worker logic, and adds a script to list/delete connections tied to deleted integrations.
services/apps/cron_service/src/jobs/nangoConnectionCleanup.job.ts:fetchNangoIntegrationData+fetchNangoDeletedIntegrationData.PlatformType.GITHUB_NANGOfor GitHub checks; support repo-basednangoMapping.services/apps/nango_worker/src/activities/nangoActivities.ts:services/apps/nango_worker/src/bin/check-disconnected-integrations.ts:--deleteto remove them.fetchNangoDeletedIntegrationData; removefetchDeletedIntegrationByIdinservices/libs/data-access-layer/src/integrations/index.ts.Written by Cursor Bugbot for commit 24964b4. This will update automatically on new commits. Configure here.