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.
| await txService.updateInsightsProject({ | ||
| insightsProjectId: insightsProject.id, | ||
| isFirstUpdate: true, | ||
| platform: PlatformType.GITHUB_NANGO, | ||
| segmentId: insightsProject.segmentId, | ||
| transaction, | ||
| }) |
| // Re-run updateInsightsProject now that repos are mapped, so metadata can be fetched | ||
| const collectionService = new CollectionService(txOptions) | ||
| const [insightsProject] = await collectionService.findInsightsProjectsBySegmentId( | ||
| integration.segmentId, | ||
| ) | ||
| if (insightsProject) { | ||
| await txService.updateInsightsProject({ | ||
| insightsProjectId: insightsProject.id, | ||
| isFirstUpdate: true, | ||
| platform: PlatformType.GITHUB_NANGO, | ||
| segmentId: insightsProject.segmentId, | ||
| transaction, | ||
| }) |
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
Adjusts the timing of
updateInsightsProjectforPlatformType.GITHUB_NANGO, which can affect when project metadata is populated during onboarding; failures here could leave metadata stale but is scoped to the GitHub Nango flow.Overview
Fixes missing Insights Project metadata for
GITHUB_NANGOintegrations by changing whenupdateInsightsProjectruns.During integration
create, the initialupdateInsightsProjectcall is now skipped forGITHUB_NANGO(repos aren’t available at that stage). AftergithubNangoConnectmaps repositories viamapGithubRepos, the service now re-runsupdateInsightsProjectso metadata fetching occurs once repos exist.Written by Cursor Bugbot for commit cbab62f. This will update automatically on new commits. Configure here.