fix: projects metadata on github nango#3918
Conversation
|
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. |
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
37fa97c to
cbab62f
Compare
|
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.
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
updateInsightsProjectcall during integration creation forPlatformType.GITHUB_NANGO. - After
mapGithubReposcompletes ingithubNangoConnect, re-runupdateInsightsProjectso 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>
|
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.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| error: err, | ||
| }, | ||
| ) | ||
| } |
There was a problem hiding this comment.
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.


The call to
updateInsightsProjectwhere 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_NANGOplatform 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_NANGOintegration workflow:updateInsightsProjectduring integration creation forGITHUB_NANGO, since repositories are not available at that stage. (backend/src/services/integrationService.ts)updateInsightsProjectafter repositories have been mapped forGITHUB_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
updateInsightsProjectuntil 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_NANGOby skipping the initialupdateInsightsProjectcall during integrationcreate()(repos are not available yet) and re-running it aftermapGithubRepos()completes ingithubNangoConnect().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.