Skip to content

Commit

Permalink
last PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
philipperolet committed Sep 8, 2023
1 parent de327b6 commit 74a96b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions connectors/migrations/20230906_3_github_fill_parents_field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function updateDiscussionsParentsFieldForConnector(connector: Connector) {
attributes: ["repoId", "discussionNumber"],
});
// update all parents fields for discussions by chunks of 128
const chunkSize = 128;
const chunkSize = 32;
for (let i = 0; i < documentData.length; i += chunkSize) {
const chunk = documentData.slice(i, i + chunkSize);
console.log(`Updating ${chunk.length} documents`);
Expand Down Expand Up @@ -76,7 +76,7 @@ async function updateIssuesParentsFieldForConnector(connector: Connector) {
attributes: ["repoId", "issueNumber"],
});
// update all parents fields for all issues by chunks of 128
const chunkSize = 128;
const chunkSize = 32;
for (let i = 0; i < documentData.length; i += chunkSize) {
const chunk = documentData.slice(i, i + chunkSize);
console.log(`Updating ${chunk.length} documents`);
Expand Down
8 changes: 6 additions & 2 deletions connectors/src/connectors/github/temporal/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ export async function githubUpsertIssueActivity(
// repos, but not practical for issues since the external id is the
// issue number, which is not guaranteed unique in the workspace.
// Therefore as a special case we use getIssueDocumentId() to get a parent string
// The repo id from github is globally unique so used as-is, as per
// convention to use the external id string.
parents: [
getIssueDocumentId(repoId.toString(), issue.number),
repoId.toString(),
Expand Down Expand Up @@ -290,8 +292,10 @@ export async function githubUpsertDiscussionActivity(
tags,
// The convention for parents is to use the external id string; it is ok for
// repos, but not practical for discussions since the external id is the
// issue number, which is not guaranteed unique in the workspace.
// Therefore as a special case we use getDiscussionDocumentId() to get a parent string
// issue number, which is not guaranteed unique in the workspace. Therefore
// as a special case we use getDiscussionDocumentId() to get a parent string
// The repo id from github is globally unique so used as-is, as per
// convention to use the external id string.
parents: [
getDiscussionDocumentId(repoId.toString(), discussionNumber),
repoId.toString(),
Expand Down

0 comments on commit 74a96b9

Please sign in to comment.