@vypdev/copilot 3.10.0 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli/index.js
CHANGED
|
@@ -87046,12 +87046,13 @@ class PullRequestApprovalRepository {
|
|
|
87046
87046
|
collectDiagnostic(diagnostics, cause);
|
|
87047
87047
|
}
|
|
87048
87048
|
}
|
|
87049
|
+
const checkClient = this.checkOctokit ?? this.octokit;
|
|
87049
87050
|
const [files, reviews, comments, headChecks, mergeChecks, headRuns, mergeRuns, rules, user] = await Promise.all([
|
|
87050
87051
|
this.allPages('files', this.octokit.rest.pulls.listFiles, { owner: target.owner, repo: target.repository, pull_number: target.pullNumber }),
|
|
87051
87052
|
this.allPages('reviews', this.octokit.rest.pulls.listReviews, { owner: target.owner, repo: target.repository, pull_number: target.pullNumber }),
|
|
87052
87053
|
this.allPages('comments', this.octokit.rest.issues.listComments, { owner: target.owner, repo: target.repository, issue_number: target.pullNumber }),
|
|
87053
|
-
this.allPages('head-checks',
|
|
87054
|
-
testedMergeSha ? this.allPages('merge-checks',
|
|
87054
|
+
this.allPages('head-checks', checkClient.rest.checks.listForRef, { owner: target.owner, repo: target.repository, ref: headSha, filter: 'all' }, checkClient),
|
|
87055
|
+
testedMergeSha ? this.allPages('merge-checks', checkClient.rest.checks.listForRef, { owner: target.owner, repo: target.repository, ref: testedMergeSha, filter: 'all' }, checkClient) : Promise.resolve([]),
|
|
87055
87056
|
this.allPages('head-runs', this.octokit.rest.actions.listWorkflowRunsForRepo, { owner: target.owner, repo: target.repository, head_sha: headSha }),
|
|
87056
87057
|
testedMergeSha ? this.allPages('merge-runs', this.octokit.rest.actions.listWorkflowRunsForRepo, { owner: target.owner, repo: target.repository, head_sha: testedMergeSha }) : Promise.resolve([]),
|
|
87057
87058
|
this.effectiveRules(target.owner, target.repository, pull.base.ref, diagnostics),
|
|
@@ -87309,10 +87310,10 @@ class PullRequestApprovalRepository {
|
|
|
87309
87310
|
return { readable: false, dismissesStaleReviews: false, requiredChecks: [] };
|
|
87310
87311
|
}
|
|
87311
87312
|
}
|
|
87312
|
-
async allPages(operation, method, params) {
|
|
87313
|
+
async allPages(operation, method, params, client = this.octokit) {
|
|
87313
87314
|
return (0, approval_evidence_read_1.readApprovalEvidence)(operation, async () => {
|
|
87314
87315
|
const result = [];
|
|
87315
|
-
for await (const response of
|
|
87316
|
+
for await (const response of client.paginate.iterator(method, { ...params, per_page: 100 })) {
|
|
87316
87317
|
const page = Array.isArray(response.data) ? response.data
|
|
87317
87318
|
: record(response.data)?.check_runs ?? record(response.data)?.workflow_runs
|
|
87318
87319
|
?? record(response.data)?.artifacts ?? record(response.data)?.jobs;
|
|
@@ -77558,12 +77558,13 @@ class PullRequestApprovalRepository {
|
|
|
77558
77558
|
collectDiagnostic(diagnostics, cause);
|
|
77559
77559
|
}
|
|
77560
77560
|
}
|
|
77561
|
+
const checkClient = this.checkOctokit ?? this.octokit;
|
|
77561
77562
|
const [files, reviews, comments, headChecks, mergeChecks, headRuns, mergeRuns, rules, user] = await Promise.all([
|
|
77562
77563
|
this.allPages('files', this.octokit.rest.pulls.listFiles, { owner: target.owner, repo: target.repository, pull_number: target.pullNumber }),
|
|
77563
77564
|
this.allPages('reviews', this.octokit.rest.pulls.listReviews, { owner: target.owner, repo: target.repository, pull_number: target.pullNumber }),
|
|
77564
77565
|
this.allPages('comments', this.octokit.rest.issues.listComments, { owner: target.owner, repo: target.repository, issue_number: target.pullNumber }),
|
|
77565
|
-
this.allPages('head-checks',
|
|
77566
|
-
testedMergeSha ? this.allPages('merge-checks',
|
|
77566
|
+
this.allPages('head-checks', checkClient.rest.checks.listForRef, { owner: target.owner, repo: target.repository, ref: headSha, filter: 'all' }, checkClient),
|
|
77567
|
+
testedMergeSha ? this.allPages('merge-checks', checkClient.rest.checks.listForRef, { owner: target.owner, repo: target.repository, ref: testedMergeSha, filter: 'all' }, checkClient) : Promise.resolve([]),
|
|
77567
77568
|
this.allPages('head-runs', this.octokit.rest.actions.listWorkflowRunsForRepo, { owner: target.owner, repo: target.repository, head_sha: headSha }),
|
|
77568
77569
|
testedMergeSha ? this.allPages('merge-runs', this.octokit.rest.actions.listWorkflowRunsForRepo, { owner: target.owner, repo: target.repository, head_sha: testedMergeSha }) : Promise.resolve([]),
|
|
77569
77570
|
this.effectiveRules(target.owner, target.repository, pull.base.ref, diagnostics),
|
|
@@ -77821,10 +77822,10 @@ class PullRequestApprovalRepository {
|
|
|
77821
77822
|
return { readable: false, dismissesStaleReviews: false, requiredChecks: [] };
|
|
77822
77823
|
}
|
|
77823
77824
|
}
|
|
77824
|
-
async allPages(operation, method, params) {
|
|
77825
|
+
async allPages(operation, method, params, client = this.octokit) {
|
|
77825
77826
|
return (0, approval_evidence_read_1.readApprovalEvidence)(operation, async () => {
|
|
77826
77827
|
const result = [];
|
|
77827
|
-
for await (const response of
|
|
77828
|
+
for await (const response of client.paginate.iterator(method, { ...params, per_page: 100 })) {
|
|
77828
77829
|
const page = Array.isArray(response.data) ? response.data
|
|
77829
77830
|
: record(response.data)?.check_runs ?? record(response.data)?.workflow_runs
|
|
77830
77831
|
?? record(response.data)?.artifacts ?? record(response.data)?.jobs;
|