chore: remove repos from integrations.settings column for github and github-nango integrations (CM-1005)#3882
Open
chore: remove repos from integrations.settings column for github and github-nango integrations (CM-1005)#3882
Conversation
…repositories table Signed-off-by: Uroš Marolt <uros@marolt.me>
…and some old bugs Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Uroš Marolt <uros@marolt.me>
| // Strip legacy top-level keys that may still exist in the DB column | ||
| delete output.settings.repos | ||
| delete output.settings.unavailableRepos | ||
| } |
There was a problem hiding this comment.
Duplicated repo-population logic across two layers
Low Severity
_populateRelations in integrationRepository.ts and populateGithubSettingsWithRepos in repositories/index.ts contain nearly identical logic: query repos from public.repositories, group by owner, and merge into settings.orgs[].repos. They differ only in ORM (Sequelize vs pg-promise) and in whether legacy keys are stripped. This duplication risks future divergence — a bug fix or schema change applied to one but not the other.
Additional Locations (1)
Signed-off-by: Uroš Marolt <uros@marolt.me>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
backend/src/database/migrations/V1772043927__removeReposFromGithubSettings.sql
Outdated
Show resolved
Hide resolved
Signed-off-by: Uroš Marolt <uros@marolt.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Note
High Risk
Includes a data-migrating SQL script and broad changes to GitHub/GitHub-Nango mapping and worker execution paths; mistakes could drop repo visibility or break onboarding/sync runs.
Overview
GitHub repo metadata is no longer stored in
integrations.settings. A new migration backs up existing settings, removesorgs[].reposplus legacy top-levelrepos/unavailableReposfor non-mappingGitHub integrations, and the backend now rehydratessettings.orgs[].reposfrompublic.repositorieswhen returning integrations.GitHub/GitHub-Nango flows were updated to write repos only to
public.repositories: mapping now preservesforkedFromvia an explicit map, strips repo fields from settings after unified repo sync, and triggers integration runs after transaction commit so workers can see the new rows. Worker/cron/nango code paths that previously iteratedsettings.orgs[].reposnow callgetReposForGithubIntegrationorpopulateGithubSettingsWithRepos, and the legacy GitHub stream processor stops writingreposback into settings (keeps onlyunavailableRepos).Written by Cursor Bugbot for commit d3f6b90. This will update automatically on new commits. Configure here.