Skip to content

fix: projects metadata on github nango#3918

Open
joanagmaia wants to merge 1 commit intomainfrom
fix/projects-metadata-github
Open

fix: projects metadata on github nango#3918
joanagmaia wants to merge 1 commit 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
Adjusts the timing of updateInsightsProject for PlatformType.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_NANGO integrations by changing when updateInsightsProject runs.

During integration create, the initial updateInsightsProject call is now skipped for GITHUB_NANGO (repos aren’t available at that stage). After githubNangoConnect maps repositories via mapGithubRepos, the service now re-runs updateInsightsProject so metadata fetching occurs once repos exist.

Written by Cursor Bugbot for commit cbab62f. 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.

Comment on lines +850 to +856
await txService.updateInsightsProject({
insightsProjectId: insightsProject.id,
isFirstUpdate: true,
platform: PlatformType.GITHUB_NANGO,
segmentId: insightsProject.segmentId,
transaction,
})
Comment on lines +844 to +856
// 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,
})
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.

2 participants