diff --git a/connectors/migrations/20241216_backfill_confluence_folders.ts b/connectors/migrations/20241216_backfill_confluence_folders.ts index 17a07ca3c716..9e739a6d0d5b 100644 --- a/connectors/migrations/20241216_backfill_confluence_folders.ts +++ b/connectors/migrations/20241216_backfill_confluence_folders.ts @@ -26,6 +26,7 @@ makeScript({}, async ({ execute }, logger) => { dataSourceConfig, folderId: makeSpaceInternalId(space.spaceId), parents: [makeSpaceInternalId(space.spaceId)], + parentId: null, title: space.name, mimeType: "application/vnd.dust.confluence.space", }); diff --git a/connectors/migrations/20241216_backfill_zendesk_folders.ts b/connectors/migrations/20241216_backfill_zendesk_folders.ts index 71359fbb25e4..97418be6ea24 100644 --- a/connectors/migrations/20241216_backfill_zendesk_folders.ts +++ b/connectors/migrations/20241216_backfill_zendesk_folders.ts @@ -33,6 +33,7 @@ makeScript({}, async ({ execute }, logger) => { dataSourceConfig, folderId: brandInternalId, parents: [brandInternalId], + parentId: null, title: brand.name, mimeType: "application/vnd.dust.zendesk.brand", }); @@ -45,6 +46,7 @@ makeScript({}, async ({ execute }, logger) => { helpCenterNode.internalId, helpCenterNode.parentInternalId, ], + parentId: helpCenterNode.parentInternalId, title: helpCenterNode.title, mimeType: "application/vnd.dust.zendesk.helpcenter", }); @@ -54,6 +56,7 @@ makeScript({}, async ({ execute }, logger) => { dataSourceConfig, folderId: ticketsNode.internalId, parents: [ticketsNode.internalId, ticketsNode.parentInternalId], + parentId: ticketsNode.parentInternalId, title: ticketsNode.title, mimeType: "application/vnd.dust.zendesk.tickets", }); @@ -81,6 +84,7 @@ makeScript({}, async ({ execute }, logger) => { dataSourceConfig: dataSourceConfigFromConnector(connector), folderId: parents[0], parents, + parentId: parents[1], title: category.name, mimeType: "application/vnd.dust.zendesk.category", }); diff --git a/connectors/migrations/20241218_backfill_webcrawler_folders.ts b/connectors/migrations/20241218_backfill_webcrawler_folders.ts index 0932a3613e2d..ded602b9ab49 100644 --- a/connectors/migrations/20241218_backfill_webcrawler_folders.ts +++ b/connectors/migrations/20241218_backfill_webcrawler_folders.ts @@ -76,11 +76,13 @@ makeScript( execute, }); if (execute) { + const parents = getParents(folder); const result = await upsertDataSourceFolder({ dataSourceConfig, folderId: folder.internalId, timestampMs: folder.updatedAt.getTime(), - parents: getParents(folder), + parents, + parentId: parents[1] || null, title: folder.url, mimeType: "application/vnd.dust.webcrawler.folder", }); diff --git a/connectors/migrations/20241219_backfill_github_folders.ts b/connectors/migrations/20241219_backfill_github_folders.ts index a8ee24170d11..f6d3ab58bc23 100644 --- a/connectors/migrations/20241219_backfill_github_folders.ts +++ b/connectors/migrations/20241219_backfill_github_folders.ts @@ -42,6 +42,7 @@ async function upsertFoldersForConnector( dataSourceConfig, folderId: repoInternalId, parents: [repoInternalId], + parentId: null, title: repoName, mimeType: "application/vnd.dust.github.repository", }); @@ -61,6 +62,7 @@ async function upsertFoldersForConnector( dataSourceConfig, folderId: issuesInternalId, parents: [issuesInternalId, repoInternalId], + parentId: repoInternalId, title: "Issues", mimeType: "application/vnd.dust.github.issues", }); @@ -76,6 +78,7 @@ async function upsertFoldersForConnector( dataSourceConfig, folderId: discussionsInternalId, parents: [discussionsInternalId, repoInternalId], + parentId: repoInternalId, title: "Discussions", mimeType: "application/vnd.dust.github.discussions", }); @@ -96,6 +99,7 @@ async function upsertFoldersForConnector( folderId: codeRootInternalId, title: "Code", parents: [codeRootInternalId, repoInternalId], + parentId: repoInternalId, mimeType: "application/vnd.dust.github.code.root", }); logger.info(`Upserted code root folder ${codeRootInternalId}`); @@ -121,6 +125,7 @@ async function upsertFoldersForConnector( dataSourceConfig, folderId: directory.internalId, parents: [directory.internalId, ...dirParents], + parentId: dirParents[0] || null, title: directory.dirName, mimeType: "application/vnd.dust.github.code.directory", }); diff --git a/connectors/migrations/20241219_backfill_intercom_data_source_folders.ts b/connectors/migrations/20241219_backfill_intercom_data_source_folders.ts index c54c3e088da0..d0ed53d635dc 100644 --- a/connectors/migrations/20241219_backfill_intercom_data_source_folders.ts +++ b/connectors/migrations/20241219_backfill_intercom_data_source_folders.ts @@ -34,6 +34,7 @@ async function createFolderNodes(execute: boolean) { dataSourceConfig, folderId: getTeamsInternalId(connector.id), parents: [getTeamsInternalId(connector.id)], + parentId: null, title: "Conversations", mimeType: getDataSourceNodeMimeType("CONVERSATIONS_FOLDER"), }); @@ -57,6 +58,7 @@ async function createFolderNodes(execute: boolean) { dataSourceConfig, folderId: teamInternalId, parents: [teamInternalId, getTeamsInternalId(connector.id)], + parentId: getTeamsInternalId(connector.id), title: team.name, mimeType: getDataSourceNodeMimeType("TEAM"), }); @@ -95,6 +97,7 @@ async function createFolderNodes(execute: boolean) { dataSourceConfig, folderId: helpCenterInternalId, parents: [helpCenterInternalId], + parentId: null, title: helpCenter.name, mimeType: getDataSourceNodeMimeType("HELP_CENTER"), }); @@ -128,6 +131,7 @@ async function createFolderNodes(execute: boolean) { dataSourceConfig, folderId: collectionInternalId, parents: collectionParents, + parentId: collectionParents[1] || null, title: collection.name, mimeType: getDataSourceNodeMimeType("COLLECTION"), });