Skip to content

Commit

Permalink
fix: implement batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
saenyakorn committed Oct 28, 2024
1 parent ae8ced6 commit a9a4aea
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
31 changes: 26 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,23 @@ export class ReleaseTracker {

const releases = await this.fetchReleases(filterredTags)

await this.lcSdk.releaseIssues({
projectId: this.config.projectId,
apps: releases
})
for (const release of releases) {
core.info(`Releasing issues for ${release.appName}@${release.version}`)

const batches = R.chunk(release.issues, 20)

for (const batch of batches) {
await this.lcSdk.releaseIssues({
projectId: this.config.projectId,
apps: [
{
appName: release.appName,
version: release.version,
issues: batch
}
]
})
}
}
}
}
2 changes: 1 addition & 1 deletion src/sdk/linear-changeset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const LinearChangesetSdkReleaseIssuesBody = object({
apps: array(
object({
appName: string(),
version: string(),
issues: array(
object({
version: string(),
issueId: string(),
url: string()
})
Expand Down

0 comments on commit a9a4aea

Please sign in to comment.