Skip to content

Commit

Permalink
github - add new workflows with the folders upsert (#9562)
Browse files Browse the repository at this point in the history
* add new workflows that are duplicates of the old ones with the new upsert activities

* fix backfill script

* rename workflows with v2

* 📝
  • Loading branch information
aubin-tchoi authored Dec 20, 2024
1 parent 872ea87 commit 0cf6530
Show file tree
Hide file tree
Showing 3 changed files with 369 additions and 6 deletions.
2 changes: 1 addition & 1 deletion connectors/migrations/20241219_backfill_github_folders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ async function upsertFoldersForConnector(
}
}
makeScript({}, async ({ execute }, logger) => {
const connectors = await ConnectorResource.listByType("zendesk", {});
const connectors = await ConnectorResource.listByType("github", {});

for (const connector of connectors) {
logger.info(`Upserting folders for connector ${connector.id}`);
Expand Down
10 changes: 5 additions & 5 deletions connectors/src/connectors/github/temporal/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import {
githubCodeSyncWorkflow,
githubDiscussionGarbageCollectWorkflow,
githubDiscussionSyncWorkflow,
githubFullSyncWorkflow,
githubFullSyncWorkflowV2,
githubIssueGarbageCollectWorkflow,
githubIssueSyncWorkflow,
githubRepoGarbageCollectWorkflow,
githubReposSyncWorkflow,
githubReposSyncWorkflowV2,
} from "@connectors/connectors/github/temporal/workflows";
import { dataSourceConfigFromConnector } from "@connectors/lib/api/data_source_config";
import { getTemporalClient } from "@connectors/lib/temporal";
Expand Down Expand Up @@ -68,7 +68,7 @@ export async function launchGithubFullSyncWorkflow({
return;
}

await client.workflow.start(githubFullSyncWorkflow, {
await client.workflow.start(githubFullSyncWorkflowV2, {
args: [dataSourceConfig, connectorId, syncCodeOnly, forceCodeResync],
taskQueue: QUEUE_NAME,
workflowId: getFullSyncWorkflowId(connectorId),
Expand All @@ -87,7 +87,7 @@ export async function getGithubFullSyncWorkflow(connectorId: ModelId): Promise<{
} | null> {
const client = await getTemporalClient();

const handle: WorkflowHandle<typeof githubFullSyncWorkflow> =
const handle: WorkflowHandle<typeof githubFullSyncWorkflowV2> =
client.workflow.getHandle(getFullSyncWorkflowId(connectorId));

try {
Expand Down Expand Up @@ -116,7 +116,7 @@ export async function launchGithubReposSyncWorkflow(
}
const dataSourceConfig = dataSourceConfigFromConnector(connector);

await client.workflow.start(githubReposSyncWorkflow, {
await client.workflow.start(githubReposSyncWorkflowV2, {
args: [dataSourceConfig, connectorId, orgLogin, repos],
taskQueue: QUEUE_NAME,
workflowId: getReposSyncWorkflowId(connectorId),
Expand Down
Loading

0 comments on commit 0cf6530

Please sign in to comment.