Skip to content

fix: projects metadata on github nango#3918

Merged
joanagmaia merged 2 commits intomainfrom
fix/projects-metadata-github
Mar 16, 2026
Merged

fix: projects metadata on github nango#3918
joanagmaia merged 2 commits intomainfrom
fix/projects-metadata-github

Conversation

@joanagmaia
Copy link
Contributor

@joanagmaia joanagmaia commented Mar 13, 2026

The call to updateInsightsProject where we got metadata for insights project was broken for projects that had github nango connected when we removed the repos from the settings table.

Fix

This pull request introduces logic to handle the unique workflow for the GITHUB_NANGO platform during integration creation and repository mapping. The main improvement is ensuring that the project metadata is updated only after repositories are available, which resolves issues with missing repository information at creation time.

Changes related to GITHUB_NANGO integration workflow:

  • Skipped the initial call to updateInsightsProject during integration creation for GITHUB_NANGO, since repositories are not available at that stage. (backend/src/services/integrationService.ts)
  • Added a follow-up call to updateInsightsProject after repositories have been mapped for GITHUB_NANGO, allowing metadata to be fetched with the correct repository information. (backend/src/services/integrationService.ts)

Note

Medium Risk
Changes the GitHub Nango connection flow to defer updateInsightsProject until after repo mapping, which affects integration creation behavior and relies on a best-effort follow-up step for metadata enrichment.

Overview
Fixes missing Insights Project metadata for PlatformType.GITHUB_NANGO by skipping the initial updateInsightsProject call during integration create() (repos are not available yet) and re-running it after mapGithubRepos() completes in githubNangoConnect().

The post-mapping metadata update is wrapped in a try/catch so failures are logged and do not roll back the core GitHub Nango connection or repository mapping transaction.

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

@joanagmaia joanagmaia requested review from Copilot and ulemons March 13, 2026 12:31
@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

1 similar comment
@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
@joanagmaia joanagmaia force-pushed the fix/projects-metadata-github branch from 37fa97c to cbab62f Compare March 13, 2026 12:32
@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes GitHub Nango integration creation so Insights Project metadata is updated only after repositories have been mapped (since repos are no longer stored in integration settings for GITHUB_NANGO).

Changes:

  • Skip the initial updateInsightsProject call during integration creation for PlatformType.GITHUB_NANGO.
  • After mapGithubRepos completes in githubNangoConnect, re-run updateInsightsProject so metadata can be fetched using mapped repositories.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
@github-actions
Copy link
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

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 1 potential issue.

Fix All in Cursor

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

error: err,
},
)
}
Copy link

Choose a reason for hiding this comment

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

Try-catch ineffective within shared PostgreSQL transaction

Medium Severity

The try-catch around updateInsightsProject is intended to make it "best-effort," but it runs within the same transaction used by the outer operation. In PostgreSQL, if any statement fails within a transaction, the transaction enters an aborted state and all subsequent commands are rejected. If updateInsightsProject triggers a database error, catching the JS exception doesn't recover the transaction — the commitTransaction call at the end of githubNangoConnect will still fail, causing the entire operation to roll back despite the catch block.

Additional Locations (1)
Fix in Cursor Fix in Web

@joanagmaia joanagmaia merged commit 304dd20 into main Mar 16, 2026
9 checks passed
@joanagmaia joanagmaia deleted the fix/projects-metadata-github branch March 16, 2026 12:20
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.

3 participants