Skip to content

chore: remove repos from integrations.settings column for github and github-nango integrations (CM-1005)#3882

Open
themarolt wants to merge 6 commits intomainfrom
fixes-and-repos-removal-CM-1005
Open

chore: remove repos from integrations.settings column for github and github-nango integrations (CM-1005)#3882
themarolt wants to merge 6 commits intomainfrom
fixes-and-repos-removal-CM-1005

Conversation

@themarolt
Copy link
Contributor

@themarolt themarolt commented Feb 28, 2026

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, removes orgs[].repos plus legacy top-level repos/unavailableRepos for non-mapping GitHub integrations, and the backend now rehydrates settings.orgs[].repos from public.repositories when returning integrations.

GitHub/GitHub-Nango flows were updated to write repos only to public.repositories: mapping now preserves forkedFrom via 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 iterated settings.orgs[].repos now call getReposForGithubIntegration or populateGithubSettingsWithRepos, and the legacy GitHub stream processor stops writing repos back into settings (keeps only unavailableRepos).

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

…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>
@themarolt themarolt requested a review from mbani01 February 28, 2026 18:58
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
}
Copy link

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

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.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Signed-off-by: Uroš Marolt <uros@marolt.me>
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