@vypdev/copilot 3.9.1 → 3.9.3
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/README.md +47 -93
- package/action.yml +1 -1
- package/build/api/index.js +75 -0
- package/build/api/src/data/model/application_error.d.ts +5 -1
- package/build/api/src/domain/approval_evidence_diagnostic.d.ts +30 -0
- package/build/api/src/domain/closed_issue_reconciliation.d.ts +11 -0
- package/build/cli/index.js +816 -177
- package/build/github_action/index.js +879 -180
- package/build/web/assets/index-CfyclPC5.css +1 -0
- package/build/web/assets/index-CsboG2sG.js +3 -0
- package/build/web/index.html +2 -2
- package/package.json +1 -1
- package/setup/workflows/copilot_commit.yml +4 -0
- package/setup/workflows/copilot_issue.yml +4 -0
- package/setup/workflows/copilot_issue_comment.yml +4 -0
- package/setup/workflows/copilot_pull_request.yml +4 -0
- package/setup/workflows/copilot_pull_request_comment.yml +4 -0
- package/setup/workflows/copilot_pull_request_review_state.yml +4 -0
- package/build/web/assets/index-BTzJj-al.js +0 -3
- package/build/web/assets/index-ERZ4A62w.css +0 -1
package/build/cli/index.js
CHANGED
|
@@ -38002,6 +38002,23 @@ exports.TITLE = void 0;
|
|
|
38002
38002
|
exports.TITLE = 'Copilot';
|
|
38003
38003
|
|
|
38004
38004
|
|
|
38005
|
+
/***/ }),
|
|
38006
|
+
|
|
38007
|
+
/***/ 2396:
|
|
38008
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
38009
|
+
|
|
38010
|
+
"use strict";
|
|
38011
|
+
|
|
38012
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
38013
|
+
exports.SETUP_DOCUMENTATION = void 0;
|
|
38014
|
+
/** Public, source-controlled navigation. Never attach session, repository or credential data. */
|
|
38015
|
+
exports.SETUP_DOCUMENTATION = {
|
|
38016
|
+
tutorial: 'https://docs.page/vypdev/copilot/setup-web',
|
|
38017
|
+
firstWorkflow: 'https://docs.page/vypdev/copilot/first-workflow',
|
|
38018
|
+
recovery: 'https://docs.page/vypdev/copilot/security-operations/operations/troubleshooting',
|
|
38019
|
+
};
|
|
38020
|
+
|
|
38021
|
+
|
|
38005
38022
|
/***/ }),
|
|
38006
38023
|
|
|
38007
38024
|
/***/ 75999:
|
|
@@ -38072,6 +38089,55 @@ function runAtApplicationErrorBoundary(operation) {
|
|
|
38072
38089
|
}
|
|
38073
38090
|
|
|
38074
38091
|
|
|
38092
|
+
/***/ }),
|
|
38093
|
+
|
|
38094
|
+
/***/ 50519:
|
|
38095
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
38096
|
+
|
|
38097
|
+
"use strict";
|
|
38098
|
+
|
|
38099
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
38100
|
+
exports.approvalEvidenceError = approvalEvidenceError;
|
|
38101
|
+
exports.approvalDiagnosticError = approvalDiagnosticError;
|
|
38102
|
+
const approval_evidence_diagnostic_1 = __nccwpck_require__(98205);
|
|
38103
|
+
const application_error_1 = __nccwpck_require__(75999);
|
|
38104
|
+
function approvalEvidenceError(operation, reason) {
|
|
38105
|
+
return approvalDiagnosticError({ operation, reason, permission: approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_PERMISSIONS[operation] });
|
|
38106
|
+
}
|
|
38107
|
+
function approvalDiagnosticError(diagnostic) {
|
|
38108
|
+
const reason = diagnostic.reason;
|
|
38109
|
+
const code = reason === 'http-401' ? 'authorization.credential-invalid'
|
|
38110
|
+
: reason === 'http-403' ? 'authorization.denied'
|
|
38111
|
+
: reason === 'http-404' ? 'provider.not-found'
|
|
38112
|
+
: reason === 'http-429' ? 'provider.rate-limited'
|
|
38113
|
+
: reason === 'http-409' ? 'provider.conflict'
|
|
38114
|
+
: reason === 'transport-unavailable' || /^http-50[0234]$/u.test(reason) ? 'provider.unavailable'
|
|
38115
|
+
: 'provider.contract-invalid';
|
|
38116
|
+
return new application_error_1.ApplicationError(code, `Approval evidence read failed (${diagnostic.operation}, ${reason}).`, {
|
|
38117
|
+
recovery: { id: 'approval-evidence-read-failed', variables: diagnostic },
|
|
38118
|
+
});
|
|
38119
|
+
}
|
|
38120
|
+
|
|
38121
|
+
|
|
38122
|
+
/***/ }),
|
|
38123
|
+
|
|
38124
|
+
/***/ 12183:
|
|
38125
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
38126
|
+
|
|
38127
|
+
"use strict";
|
|
38128
|
+
|
|
38129
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
38130
|
+
exports.closedIssueReconciliationError = closedIssueReconciliationError;
|
|
38131
|
+
const application_error_1 = __nccwpck_require__(75999);
|
|
38132
|
+
/** Public diagnostic is fixed native facts and counters, never label/card/provider text. */
|
|
38133
|
+
function closedIssueReconciliationError(cause, facts) {
|
|
38134
|
+
return new application_error_1.ApplicationError(cause instanceof application_error_1.ApplicationError ? cause.code : 'provider.unavailable', 'Closed issue reconciliation remains unverified.', {
|
|
38135
|
+
...(cause instanceof application_error_1.ApplicationError ? { correlationId: cause.correlationId, retryable: cause.retryable } : {}),
|
|
38136
|
+
recovery: { id: 'closed-issue-reconciliation-failed', variables: facts },
|
|
38137
|
+
});
|
|
38138
|
+
}
|
|
38139
|
+
|
|
38140
|
+
|
|
38075
38141
|
/***/ }),
|
|
38076
38142
|
|
|
38077
38143
|
/***/ 72594:
|
|
@@ -39248,6 +39314,16 @@ const SPANISH_CONTENT = Object.freeze({
|
|
|
39248
39314
|
}),
|
|
39249
39315
|
});
|
|
39250
39316
|
const ENGLISH_RECOVERY_CONTENT = Object.freeze({
|
|
39317
|
+
'closed-issue-reconciliation-failed': Object.freeze({
|
|
39318
|
+
impact: 'Issue cleanup remains unverified: {resultId}, phase {phase}; native state {state}, reason {reason}.',
|
|
39319
|
+
action: 'Inspect the closed-issue or merged-PR run and current native state. Retry cleanup only if the issue is still closed with the intended reason; leave reopened work open. Resolve the named failure before retrying.',
|
|
39320
|
+
retainedState: 'Native state was preserved. Confirmed changes: {changed}; remaining required changes in the last verified plan: {remaining}. Unavailable reads do not establish completion.',
|
|
39321
|
+
}),
|
|
39322
|
+
'approval-evidence-read-failed': Object.freeze({
|
|
39323
|
+
impact: 'Approval evidence could not be verified: {operation} ({reason}).',
|
|
39324
|
+
action: 'Inspect {permission} access for the runtime credential and the named evidence response. Correct authorization, missing-resource or schema errors before rerunning; retry transient failures only after provider recovery or rate-limit reset.',
|
|
39325
|
+
retainedState: 'No approval is authorized by this failed read. Existing PRs, reviews and completed external effects were preserved.',
|
|
39326
|
+
}),
|
|
39251
39327
|
'workspace-changes-rejected': Object.freeze({
|
|
39252
39328
|
impact: 'The changes were rejected during workspace verification.',
|
|
39253
39329
|
action: 'Inspect the rejected paths in the workflow and correct the workspace before retrying.',
|
|
@@ -39315,6 +39391,16 @@ const ENGLISH_RECOVERY_CONTENT = Object.freeze({
|
|
|
39315
39391
|
}),
|
|
39316
39392
|
});
|
|
39317
39393
|
const SPANISH_RECOVERY_CONTENT = Object.freeze({
|
|
39394
|
+
'closed-issue-reconciliation-failed': Object.freeze({
|
|
39395
|
+
impact: 'La limpieza de la issue sigue sin verificarse: {resultId}, fase {phase}; estado nativo {state}, motivo {reason}.',
|
|
39396
|
+
action: 'Revisa la ejecución de cierre o de la PR fusionada y el estado nativo actual. Reintenta la limpieza solo si la issue sigue cerrada con el motivo previsto; conserva abierto el trabajo reabierto. Resuelve el fallo indicado antes de reintentar.',
|
|
39397
|
+
retainedState: 'Se conservó el estado nativo. Cambios confirmados: {changed}; cambios pendientes en el último plan verificado: {remaining}. Una lectura no disponible no demuestra que haya finalizado.',
|
|
39398
|
+
}),
|
|
39399
|
+
'approval-evidence-read-failed': Object.freeze({
|
|
39400
|
+
impact: 'No se pudo verificar la evidencia de aprobación: {operation} ({reason}).',
|
|
39401
|
+
action: 'Comprueba el acceso {permission} de la credencial de ejecución y la respuesta indicada. Corrige los errores de autorización, recurso o esquema antes de reejecutar; reintenta los fallos transitorios solo tras recuperarse el proveedor o restablecerse el límite.',
|
|
39402
|
+
retainedState: 'Esta lectura fallida no autoriza ninguna aprobación. Se conservaron las PRs, revisiones y efectos externos completados.',
|
|
39403
|
+
}),
|
|
39318
39404
|
'workspace-changes-rejected': Object.freeze({
|
|
39319
39405
|
impact: 'Los cambios se rechazaron durante la verificación del espacio de trabajo.',
|
|
39320
39406
|
action: 'Revisa las rutas rechazadas en la ejecución y corrige el espacio de trabajo antes de reintentar.',
|
|
@@ -45862,6 +45948,34 @@ function verifiedReadinessLink(snapshot, number) {
|
|
|
45862
45948
|
}
|
|
45863
45949
|
|
|
45864
45950
|
|
|
45951
|
+
/***/ }),
|
|
45952
|
+
|
|
45953
|
+
/***/ 59756:
|
|
45954
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
45955
|
+
|
|
45956
|
+
"use strict";
|
|
45957
|
+
|
|
45958
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
45959
|
+
exports.hasConventionalPullRequestTitle = hasConventionalPullRequestTitle;
|
|
45960
|
+
exports.generatedPullRequestTitle = generatedPullRequestTitle;
|
|
45961
|
+
/** Recognizes the conventional header shape; the consumer's CI owns its allowed types and subject rules. */
|
|
45962
|
+
function hasConventionalPullRequestTitle(title) {
|
|
45963
|
+
return !title.includes('\n') && !title.includes('\r')
|
|
45964
|
+
&& /^\p{L}[\p{L}\p{N}_-]*(?:\([^()\r\n]+\))?!?: +\S[^\r\n]*$/u.test(title);
|
|
45965
|
+
}
|
|
45966
|
+
function generatedPullRequestTitle(sourceTitle, sanitizedSubject, issueNumber, labels) {
|
|
45967
|
+
if (hasConventionalPullRequestTitle(sourceTitle))
|
|
45968
|
+
return sourceTitle;
|
|
45969
|
+
const type = labels.isHotfix || labels.isBugfix || labels.isBug ? 'fix'
|
|
45970
|
+
: labels.isFeature || labels.isEnhancement ? 'feat'
|
|
45971
|
+
: labels.isDocs || labels.isDocumentation ? 'docs' : 'chore';
|
|
45972
|
+
const prefix = `${type}: `;
|
|
45973
|
+
const suffix = ` (#${issueNumber})`;
|
|
45974
|
+
const subject = (sanitizedSubject || 'Update linked issue').slice(0, 256 - prefix.length - suffix.length).trimEnd();
|
|
45975
|
+
return `${prefix}${subject}${suffix}`;
|
|
45976
|
+
}
|
|
45977
|
+
|
|
45978
|
+
|
|
45865
45979
|
/***/ }),
|
|
45866
45980
|
|
|
45867
45981
|
/***/ 39410:
|
|
@@ -46053,6 +46167,12 @@ Do not add the \`${profile.deployment.launcherLabel}\` label, dispatch a deploym
|
|
|
46053
46167
|
|
|
46054
46168
|
Never expose credentials, tokens, private keys, or other secrets in issues, commits, pull requests, logs, or diagnostic comments.
|
|
46055
46169
|
|
|
46170
|
+
## Repository verification prerequisites
|
|
46171
|
+
|
|
46172
|
+
The setup runner profile selects placement; it does not install the project's language runtimes. An operator must provision the project's required runtimes and dependencies in every job that runs file-changing or branch-sync verification, before the Copilot step. A separate application CI job does not prepare this job.
|
|
46173
|
+
|
|
46174
|
+
Declare reviewed version prefixes in \`.copilot/verification-prerequisites.json\` (schemaVersion 1, runtimes such as java 17, node 24, pnpm 10). Copilot checks declared versions in the credential-free verification environment before each configured verification command; a missing or incompatible runtime blocks publication. Without this optional declaration, existing verification behavior remains and no language is inferred. Java provisioning may use \`actions/setup-java\`; \`JAVA_HOME\` and \`PATH\` survive isolation, while agent credentials and tool-option injection variables do not. Do not add an unreviewed bootstrap or weaken verification to work around a missing runtime. Read [verification prerequisites and same-job setup](https://docs.page/vypdev/copilot/security-operations/operations/verification#repository-verification-prerequisites).
|
|
46175
|
+
|
|
46056
46176
|
For the full contributor flow, read [repository collaboration](https://github.com/vypdev/copilot/blob/master/docs/agents/repository-collaboration.mdx). For drift and recovery, read [guidance troubleshooting](https://github.com/vypdev/copilot/blob/master/docs/agents/repository-guidance-troubleshooting.mdx).
|
|
46057
46177
|
`;
|
|
46058
46178
|
}
|
|
@@ -50159,13 +50279,16 @@ function validateDiscoveredProjectStatuses(configuration, discovery) {
|
|
|
50159
50279
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
50160
50280
|
exports.setupQuestionDocumentation = setupQuestionDocumentation;
|
|
50161
50281
|
const docs = {
|
|
50162
|
-
features: { title: '
|
|
50163
|
-
issueWorkflows: { title: '
|
|
50282
|
+
features: { title: 'Choose a Copilot goal', url: 'https://docs.page/vypdev/copilot/guides' },
|
|
50283
|
+
issueWorkflows: { title: 'Select issue kinds and forms', url: 'https://docs.page/vypdev/copilot/issues/configurable-workflows' },
|
|
50284
|
+
issuesGuide: { title: 'Manage issues and branches', url: 'https://docs.page/vypdev/copilot/guides/issues-and-branches' },
|
|
50285
|
+
reviewGuide: { title: 'Review PRs and resolve findings', url: 'https://docs.page/vypdev/copilot/guides/review-pull-requests' },
|
|
50286
|
+
botGuide: { title: 'Work with the bot', url: 'https://docs.page/vypdev/copilot/guides/work-with-the-bot' },
|
|
50287
|
+
releaseGuide: { title: 'Release and hotfix guide', url: 'https://docs.page/vypdev/copilot/guides/releases-and-hotfixes' },
|
|
50164
50288
|
branchManagement: { title: 'Issue branch management', url: 'https://docs.page/vypdev/copilot/issues/branch-management' },
|
|
50165
50289
|
preBranchSdd: { title: 'Pre-branch design documents', url: 'https://docs.page/vypdev/copilot/issues/pre-branch-sdds' },
|
|
50166
50290
|
issueLifecycle: { title: 'Issue notifications and automatic closure', url: 'https://docs.page/vypdev/copilot/issues/notifications-and-auto-close' },
|
|
50167
50291
|
assignments: { title: 'Assignees and GitHub Projects', url: 'https://docs.page/vypdev/copilot/issues/assignees-and-projects' },
|
|
50168
|
-
pullRequestWorkflows: { title: 'Pull-request workflow setup', url: 'https://docs.page/vypdev/copilot/pull-requests/workflow-setup' },
|
|
50169
50292
|
pullRequestDescription: { title: 'AI pull-request descriptions', url: 'https://docs.page/vypdev/copilot/pull-requests/ai-description' },
|
|
50170
50293
|
repositoryGuidance: { title: 'Repository guidance for agents', url: 'https://docs.page/vypdev/copilot/agents/repository-collaboration' },
|
|
50171
50294
|
runtime: { title: 'Agent runtime selection', url: 'https://docs.page/vypdev/copilot/agents/runtime-selection' },
|
|
@@ -50180,7 +50303,7 @@ const docs = {
|
|
|
50180
50303
|
projects: { title: 'Assignees and GitHub Projects', url: 'https://docs.page/vypdev/copilot/issues/assignees-and-projects' },
|
|
50181
50304
|
githubProjects: { title: 'GitHub: About Projects', url: 'https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects' },
|
|
50182
50305
|
githubStatus: { title: 'GitHub: About single-select fields', url: 'https://docs.github.com/en/issues/planning-and-tracking-with-projects/understanding-fields/about-single-select-fields' },
|
|
50183
|
-
provisioning: { title: '
|
|
50306
|
+
provisioning: { title: 'Set up with the web assistant', url: 'https://docs.page/vypdev/copilot/setup-web' },
|
|
50184
50307
|
storage: { title: 'GitHub Actions Secrets and Variables', url: 'https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-secrets' },
|
|
50185
50308
|
};
|
|
50186
50309
|
/** Links are selected from source-controlled constants, never derived from answers or remote text. */
|
|
@@ -50190,10 +50313,14 @@ function setupQuestionDocumentation(question) {
|
|
|
50190
50313
|
return { title: 'Runner profiles', url: 'https://docs.page/vypdev/copilot/configuration#runner-profiles' };
|
|
50191
50314
|
if (id === 'issueWorkflows.enabled')
|
|
50192
50315
|
return docs.issueWorkflows;
|
|
50193
|
-
if (id === 'features.issues')
|
|
50194
|
-
return docs.
|
|
50316
|
+
if (id === 'features.issues' || id === 'features.commits')
|
|
50317
|
+
return docs.issuesGuide;
|
|
50195
50318
|
if (id === 'features.pullRequests')
|
|
50196
|
-
return docs.
|
|
50319
|
+
return docs.reviewGuide;
|
|
50320
|
+
if (id === 'features.issueComments' || id === 'features.pullRequestComments')
|
|
50321
|
+
return docs.botGuide;
|
|
50322
|
+
if (id === 'features.release' || id === 'features.hotfix')
|
|
50323
|
+
return docs.releaseGuide;
|
|
50197
50324
|
if (id === 'repository.issueManagedBranches' || /^repository\.(feature|bugfix|hotfix|release|docs|chore)Tree$/u.test(id))
|
|
50198
50325
|
return docs.branchManagement;
|
|
50199
50326
|
if (id === 'repository.preBranchSdd')
|
|
@@ -53048,6 +53175,87 @@ function projectCurrentNativeStatus(status, facts) {
|
|
|
53048
53175
|
}
|
|
53049
53176
|
|
|
53050
53177
|
|
|
53178
|
+
/***/ }),
|
|
53179
|
+
|
|
53180
|
+
/***/ 89347:
|
|
53181
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
53182
|
+
|
|
53183
|
+
"use strict";
|
|
53184
|
+
|
|
53185
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
53186
|
+
exports.VerificationPrerequisiteError = exports.VERIFICATION_RUNTIME_SPECS = exports.VERIFICATION_RUNTIME_HELP = exports.VERIFICATION_RUNTIME_MANIFEST = void 0;
|
|
53187
|
+
exports.parseVerificationRuntimeManifest = parseVerificationRuntimeManifest;
|
|
53188
|
+
exports.verificationRuntimeVersion = verificationRuntimeVersion;
|
|
53189
|
+
exports.verificationRuntimeMatches = verificationRuntimeMatches;
|
|
53190
|
+
exports.VERIFICATION_RUNTIME_MANIFEST = '.copilot/verification-prerequisites.json';
|
|
53191
|
+
exports.VERIFICATION_RUNTIME_HELP = 'https://docs.page/vypdev/copilot/security-operations/operations/verification#repository-verification-prerequisites';
|
|
53192
|
+
exports.VERIFICATION_RUNTIME_SPECS = {
|
|
53193
|
+
java: { label: 'Java', program: 'java', args: ['-version'] },
|
|
53194
|
+
node: { label: 'Node.js', program: 'node', args: ['--version'] },
|
|
53195
|
+
pnpm: { label: 'pnpm', program: 'pnpm', args: ['--version'] },
|
|
53196
|
+
python: { label: 'Python', program: 'python3', args: ['--version'] },
|
|
53197
|
+
go: { label: 'Go', program: 'go', args: ['version'] },
|
|
53198
|
+
dotnet: { label: '.NET SDK', program: 'dotnet', args: ['--version'] },
|
|
53199
|
+
ruby: { label: 'Ruby', program: 'ruby', args: ['--version'] },
|
|
53200
|
+
rust: { label: 'Rust', program: 'rustc', args: ['--version'] },
|
|
53201
|
+
};
|
|
53202
|
+
const VERSION_PREFIX = /^[1-9]\d{0,2}(?:\.(?:0|[1-9]\d{0,2})){0,2}$/u;
|
|
53203
|
+
/** Only reviewed, closed runtime/version facts enter user-visible diagnostics. Raw tool output never does. */
|
|
53204
|
+
class VerificationPrerequisiteError extends Error {
|
|
53205
|
+
constructor(reason, requirement, observed, job) {
|
|
53206
|
+
const jobLabel = job && /^[A-Za-z_][A-Za-z0-9_-]{0,99}$/u.test(job) ? ` in job ${job}` : ' in this job';
|
|
53207
|
+
const runtime = requirement && Object.prototype.hasOwnProperty.call(exports.VERIFICATION_RUNTIME_SPECS, requirement.runtime)
|
|
53208
|
+
? exports.VERIFICATION_RUNTIME_SPECS[requirement.runtime].label : 'Required runtime';
|
|
53209
|
+
const version = requirement && VERSION_PREFIX.test(requirement.version) ? requirement.version : 'declared version';
|
|
53210
|
+
const actual = observed && /^[1-9]\d{0,2}(?:\.(?:0|[1-9]\d{0,2})){0,3}$/u.test(observed) ? observed : 'unavailable';
|
|
53211
|
+
const cause = reason === 'manifest-invalid' ? `${exports.VERIFICATION_RUNTIME_MANIFEST} is invalid or unsafe`
|
|
53212
|
+
: reason === 'version-mismatch' ? `${runtime} ${version} is required; observed ${actual}`
|
|
53213
|
+
: reason === 'unreadable-version' ? `${runtime} ${version} could not be verified`
|
|
53214
|
+
: `${runtime} ${version} is unavailable`;
|
|
53215
|
+
const action = reason === 'manifest-invalid' ? 'Correct the reviewed runtime declaration.'
|
|
53216
|
+
: `Provision the declared runtime in the same job before Copilot, then retry.${requirement?.runtime === 'java' ? ' For Java, configure actions/setup-java or a managed JAVA_HOME.' : ''}`;
|
|
53217
|
+
super(`Repository verification is blocked${jobLabel}: ${cause}. ${action} The repository verification command was not run. Help: ${exports.VERIFICATION_RUNTIME_HELP}`);
|
|
53218
|
+
this.name = 'VerificationPrerequisiteError';
|
|
53219
|
+
}
|
|
53220
|
+
}
|
|
53221
|
+
exports.VerificationPrerequisiteError = VerificationPrerequisiteError;
|
|
53222
|
+
function parseVerificationRuntimeManifest(value) {
|
|
53223
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
53224
|
+
throw new VerificationPrerequisiteError('manifest-invalid');
|
|
53225
|
+
const object = value;
|
|
53226
|
+
if (object.schemaVersion !== 1 || Object.keys(object).some(key => !['schemaVersion', 'runtimes'].includes(key))
|
|
53227
|
+
|| !object.runtimes || typeof object.runtimes !== 'object' || Array.isArray(object.runtimes)) {
|
|
53228
|
+
throw new VerificationPrerequisiteError('manifest-invalid');
|
|
53229
|
+
}
|
|
53230
|
+
const runtimes = object.runtimes;
|
|
53231
|
+
if (Object.keys(runtimes).length > 8)
|
|
53232
|
+
throw new VerificationPrerequisiteError('manifest-invalid');
|
|
53233
|
+
return Object.entries(runtimes).map(([runtime, version]) => {
|
|
53234
|
+
if (!Object.prototype.hasOwnProperty.call(exports.VERIFICATION_RUNTIME_SPECS, runtime) || typeof version !== 'string' || !VERSION_PREFIX.test(version)) {
|
|
53235
|
+
throw new VerificationPrerequisiteError('manifest-invalid');
|
|
53236
|
+
}
|
|
53237
|
+
return Object.freeze({ runtime: runtime, version });
|
|
53238
|
+
});
|
|
53239
|
+
}
|
|
53240
|
+
function verificationRuntimeVersion(runtime, output) {
|
|
53241
|
+
const patterns = {
|
|
53242
|
+
java: /^(?:openjdk|java) (?:version )?["']?(\d+(?:\.\d+){0,3})/imu,
|
|
53243
|
+
node: /^v(\d+\.\d+\.\d+)/mu,
|
|
53244
|
+
pnpm: /^(\d+\.\d+\.\d+)/mu,
|
|
53245
|
+
python: /^Python (\d+\.\d+\.\d+)/mu,
|
|
53246
|
+
go: /^go version go(\d+\.\d+(?:\.\d+)?)/mu,
|
|
53247
|
+
dotnet: /^(\d+\.\d+\.\d+)/mu,
|
|
53248
|
+
ruby: /^ruby (\d+\.\d+\.\d+)/mu,
|
|
53249
|
+
rust: /^rustc (\d+\.\d+\.\d+)/mu,
|
|
53250
|
+
};
|
|
53251
|
+
const version = patterns[runtime].exec(output)?.[1];
|
|
53252
|
+
return runtime === 'java' && version?.startsWith('1.') ? version.slice(2) : version;
|
|
53253
|
+
}
|
|
53254
|
+
function verificationRuntimeMatches(required, observed) {
|
|
53255
|
+
return observed === required || observed.startsWith(`${required}.`);
|
|
53256
|
+
}
|
|
53257
|
+
|
|
53258
|
+
|
|
53051
53259
|
/***/ }),
|
|
53052
53260
|
|
|
53053
53261
|
/***/ 43193:
|
|
@@ -56257,8 +56465,9 @@ function failure(taskId, message, code) {
|
|
|
56257
56465
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
56258
56466
|
exports.ReconcileClosedIssueMetadataUseCase = void 0;
|
|
56259
56467
|
const result_1 = __nccwpck_require__(73817);
|
|
56260
|
-
const issue_completion_1 = __nccwpck_require__(31147);
|
|
56261
56468
|
const application_error_1 = __nccwpck_require__(75999);
|
|
56469
|
+
const closed_issue_reconciliation_error_1 = __nccwpck_require__(12183);
|
|
56470
|
+
const reconcile_issue_completion_metadata_1 = __nccwpck_require__(70614);
|
|
56262
56471
|
/** Selective completion repair from fresh native facts; no native state authority. */
|
|
56263
56472
|
class ReconcileClosedIssueMetadataUseCase {
|
|
56264
56473
|
constructor(issues) {
|
|
@@ -56266,50 +56475,22 @@ class ReconcileClosedIssueMetadataUseCase {
|
|
|
56266
56475
|
this.taskId = 'ReconcileClosedIssueMetadataUseCase';
|
|
56267
56476
|
}
|
|
56268
56477
|
async invoke(context) {
|
|
56269
|
-
|
|
56270
|
-
let nativeClosed = false;
|
|
56478
|
+
const progress = (0, reconcile_issue_completion_metadata_1.completionRepairProgress)();
|
|
56271
56479
|
try {
|
|
56272
56480
|
if (!Number.isSafeInteger(context.issueNumber) || context.issueNumber < 1)
|
|
56273
56481
|
throw stale();
|
|
56274
56482
|
const target = this.issues.forIssue(context.issueNumber);
|
|
56275
|
-
const
|
|
56276
|
-
|
|
56277
|
-
const initialPlan = (0, issue_completion_1.planIssueCompletion)(initial, context.completionLabels);
|
|
56278
|
-
if (!nativeClosed || initialPlan.kind !== 'closed')
|
|
56279
|
-
throw stale();
|
|
56280
|
-
const fence = async () => {
|
|
56281
|
-
const current = await target.read();
|
|
56282
|
-
nativeClosed = current.number === context.issueNumber && current.state === 'closed';
|
|
56283
|
-
const plan = (0, issue_completion_1.planIssueCompletion)(current, context.completionLabels);
|
|
56284
|
-
if (!nativeClosed || plan.kind !== 'closed' || current.reason !== initial.reason)
|
|
56285
|
-
throw stale();
|
|
56286
|
-
return plan;
|
|
56287
|
-
};
|
|
56288
|
-
for (const label of initialPlan.remove) {
|
|
56289
|
-
if ((await fence()).remove.includes(label)) {
|
|
56290
|
-
await target.removeLabel(label);
|
|
56291
|
-
labelsChanged++;
|
|
56292
|
-
}
|
|
56293
|
-
}
|
|
56294
|
-
for (const label of initialPlan.add) {
|
|
56295
|
-
if ((await fence()).add.includes(label)) {
|
|
56296
|
-
await target.addLabel(label);
|
|
56297
|
-
labelsChanged++;
|
|
56298
|
-
}
|
|
56299
|
-
}
|
|
56300
|
-
const final = await fence();
|
|
56301
|
-
if (final.remove.length || final.add.length)
|
|
56302
|
-
throw stale();
|
|
56303
|
-
return [new result_1.Result({ id: this.taskId, success: true, executed: labelsChanged > 0,
|
|
56483
|
+
const repaired = await (0, reconcile_issue_completion_metadata_1.reconcileIssueCompletionMetadata)(target, context.issueNumber, context.completionLabels, progress);
|
|
56484
|
+
return [new result_1.Result({ id: this.taskId, success: true, executed: progress.labelsChanged > 0,
|
|
56304
56485
|
steps: ['The closed issue completion metadata was verified; historical and unrelated labels were retained.'],
|
|
56305
|
-
payload: { issueCompletion: { nativeClosed, labelsChanged, reconciled: true,
|
|
56486
|
+
payload: { issueCompletion: { nativeClosed: progress.nativeClosed, labelsChanged: progress.labelsChanged, reconciled: true, ...repaired } } })];
|
|
56306
56487
|
}
|
|
56307
56488
|
catch (cause) {
|
|
56308
|
-
return [new result_1.Result({ id: this.taskId, success: false, executed: labelsChanged > 0,
|
|
56309
|
-
steps: [nativeClosed ? 'The issue remains closed; completion metadata could not be fully verified. Inspect and retry the closed-issue workflow.'
|
|
56489
|
+
return [new result_1.Result({ id: this.taskId, success: false, executed: progress.labelsChanged > 0,
|
|
56490
|
+
steps: [progress.nativeClosed ? 'The issue remains closed; completion metadata could not be fully verified. Inspect and retry the closed-issue workflow.'
|
|
56310
56491
|
: 'Current native issue closure could not be verified; completion repair stopped without changing native state.'],
|
|
56311
|
-
errors: [(0,
|
|
56312
|
-
payload: { issueCompletion: { nativeClosed, labelsChanged, reconciled: false } } })];
|
|
56492
|
+
errors: [(0, closed_issue_reconciliation_error_1.closedIssueReconciliationError)(cause, { resultId: this.taskId, phase: progress.phase, state: progress.state, reason: progress.reason, changed: progress.labelsChanged, remaining: progress.remaining })],
|
|
56493
|
+
payload: { issueCompletion: { nativeClosed: progress.nativeClosed, labelsChanged: progress.labelsChanged, reconciled: false } } })];
|
|
56313
56494
|
}
|
|
56314
56495
|
}
|
|
56315
56496
|
}
|
|
@@ -56342,6 +56523,84 @@ class ReconcileClosedIssueUseCase {
|
|
|
56342
56523
|
exports.ReconcileClosedIssueUseCase = ReconcileClosedIssueUseCase;
|
|
56343
56524
|
|
|
56344
56525
|
|
|
56526
|
+
/***/ }),
|
|
56527
|
+
|
|
56528
|
+
/***/ 70614:
|
|
56529
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
56530
|
+
|
|
56531
|
+
"use strict";
|
|
56532
|
+
|
|
56533
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
56534
|
+
exports.completionRepairProgress = void 0;
|
|
56535
|
+
exports.reconcileIssueCompletionMetadata = reconcileIssueCompletionMetadata;
|
|
56536
|
+
const application_error_1 = __nccwpck_require__(75999);
|
|
56537
|
+
const issue_completion_1 = __nccwpck_require__(31147);
|
|
56538
|
+
const closed_issue_reconciliation_1 = __nccwpck_require__(21565);
|
|
56539
|
+
const completionRepairProgress = () => ({ nativeClosed: false, labelsChanged: 0,
|
|
56540
|
+
phase: 'identity', state: 'unavailable', reason: 'unavailable', remaining: 0 });
|
|
56541
|
+
exports.completionRepairProgress = completionRepairProgress;
|
|
56542
|
+
/** At most two bounded selective passes, with fresh native fences before every write. */
|
|
56543
|
+
async function reconcileIssueCompletionMetadata(target, number, configuration, progress, initial) {
|
|
56544
|
+
let expectedReason;
|
|
56545
|
+
let superseded = false;
|
|
56546
|
+
const read = async (phase, snapshot) => {
|
|
56547
|
+
progress.phase = phase;
|
|
56548
|
+
progress.state = 'unavailable';
|
|
56549
|
+
progress.reason = 'unavailable';
|
|
56550
|
+
const facts = snapshot ?? await target.read();
|
|
56551
|
+
progress.nativeClosed = facts?.number === number && facts.state === 'closed';
|
|
56552
|
+
progress.state = facts?.number === number && ['open', 'closed'].includes(facts.state) ? facts.state : 'unavailable';
|
|
56553
|
+
progress.reason = closed_issue_reconciliation_1.CLOSED_ISSUE_REASONS.some(reason => reason === facts?.reason) ? facts.reason : 'unavailable';
|
|
56554
|
+
const plan = (0, issue_completion_1.planIssueCompletion)(facts, configuration);
|
|
56555
|
+
if (!progress.nativeClosed || plan.kind !== 'closed' || expectedReason !== undefined && facts.reason !== expectedReason) {
|
|
56556
|
+
throw new application_error_1.ApplicationError('workflow.stale', 'The native issue identity, state or closure reason changed.');
|
|
56557
|
+
}
|
|
56558
|
+
expectedReason = facts.reason;
|
|
56559
|
+
progress.remaining = plan.remove.length + plan.add.length;
|
|
56560
|
+
return plan;
|
|
56561
|
+
};
|
|
56562
|
+
let plan = await read('read', initial);
|
|
56563
|
+
for (let pass = 0; pass < 2; pass++) {
|
|
56564
|
+
for (const label of plan.remove) {
|
|
56565
|
+
if (!(await read('label-remove')).remove.includes(label)) {
|
|
56566
|
+
superseded = true;
|
|
56567
|
+
continue;
|
|
56568
|
+
}
|
|
56569
|
+
try {
|
|
56570
|
+
await target.removeLabel(label);
|
|
56571
|
+
progress.labelsChanged++;
|
|
56572
|
+
}
|
|
56573
|
+
catch (cause) {
|
|
56574
|
+
if ((await read('label-remove')).remove.includes(label))
|
|
56575
|
+
throw cause;
|
|
56576
|
+
superseded = true;
|
|
56577
|
+
}
|
|
56578
|
+
}
|
|
56579
|
+
for (const label of plan.add) {
|
|
56580
|
+
if (!(await read('label-add')).add.includes(label)) {
|
|
56581
|
+
superseded = true;
|
|
56582
|
+
continue;
|
|
56583
|
+
}
|
|
56584
|
+
try {
|
|
56585
|
+
await target.addLabel(label);
|
|
56586
|
+
progress.labelsChanged++;
|
|
56587
|
+
}
|
|
56588
|
+
catch (cause) {
|
|
56589
|
+
if ((await read('label-add')).add.includes(label))
|
|
56590
|
+
throw cause;
|
|
56591
|
+
superseded = true;
|
|
56592
|
+
}
|
|
56593
|
+
}
|
|
56594
|
+
plan = await read('metadata-verification');
|
|
56595
|
+
if (!progress.remaining)
|
|
56596
|
+
return { reason: plan.reason,
|
|
56597
|
+
outcome: progress.labelsChanged ? 'reconciled' : 'already-converged', superseded };
|
|
56598
|
+
superseded = true;
|
|
56599
|
+
}
|
|
56600
|
+
throw new application_error_1.ApplicationError('provider.conflict', 'Completion metadata remains incomplete after two bounded passes.');
|
|
56601
|
+
}
|
|
56602
|
+
|
|
56603
|
+
|
|
56345
56604
|
/***/ }),
|
|
56346
56605
|
|
|
56347
56606
|
/***/ 74111:
|
|
@@ -56351,7 +56610,9 @@ exports.ReconcileClosedIssueUseCase = ReconcileClosedIssueUseCase;
|
|
|
56351
56610
|
|
|
56352
56611
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
56353
56612
|
exports.RetireBranchSyncUseCase = void 0;
|
|
56354
|
-
const
|
|
56613
|
+
const verify_closed_issue_card_retirement_1 = __nccwpck_require__(78813);
|
|
56614
|
+
const closed_issue_reconciliation_error_1 = __nccwpck_require__(12183);
|
|
56615
|
+
const closed_issue_reconciliation_1 = __nccwpck_require__(21565);
|
|
56355
56616
|
const result_1 = __nccwpck_require__(73817);
|
|
56356
56617
|
const github_user_policy_1 = __nccwpck_require__(84403);
|
|
56357
56618
|
const publication_identity_policy_1 = __nccwpck_require__(45403);
|
|
@@ -56369,17 +56630,33 @@ class RetireBranchSyncUseCase {
|
|
|
56369
56630
|
async invoke(context) {
|
|
56370
56631
|
let retired = 0;
|
|
56371
56632
|
let nativeClosed = false;
|
|
56633
|
+
let phase = 'identity';
|
|
56634
|
+
let state = 'unavailable';
|
|
56635
|
+
let reason = 'unavailable';
|
|
56636
|
+
let remaining = 0;
|
|
56637
|
+
let superseded = false;
|
|
56372
56638
|
try {
|
|
56373
56639
|
if (!Number.isSafeInteger(context.issueNumber) || context.issueNumber < 1 || !context.trustedBotLogin) {
|
|
56374
56640
|
return [this.result(retired, nativeClosed)];
|
|
56375
56641
|
}
|
|
56376
|
-
const
|
|
56377
|
-
|
|
56642
|
+
const read = async () => {
|
|
56643
|
+
state = 'unavailable';
|
|
56644
|
+
reason = 'unavailable';
|
|
56645
|
+
const facts = await this.issues.readIssue(context.issueNumber);
|
|
56646
|
+
nativeClosed = facts?.number === context.issueNumber && facts.state === 'closed';
|
|
56647
|
+
state = facts?.number === context.issueNumber && ['open', 'closed'].includes(facts.state) ? facts.state : 'unavailable';
|
|
56648
|
+
reason = closed_issue_reconciliation_1.CLOSED_ISSUE_REASONS.some(value => value === facts?.reason) ? facts.reason : 'unavailable';
|
|
56649
|
+
return facts;
|
|
56650
|
+
};
|
|
56651
|
+
phase = 'read';
|
|
56652
|
+
const initial = await read();
|
|
56653
|
+
if (initial.number !== context.issueNumber || !['open', 'closed'].includes(initial.state) || initial.state === 'closed' && !['completed', 'not_planned', 'duplicate', 'unknown'].includes(initial.reason))
|
|
56378
56654
|
throw stale();
|
|
56379
56655
|
if (initial.state !== 'closed')
|
|
56380
56656
|
return [this.result(retired, nativeClosed)];
|
|
56381
56657
|
nativeClosed = true;
|
|
56382
56658
|
const messages = (0, branch_sync_message_catalog_1.resolveStaticBranchSyncCatalog)(context.locale);
|
|
56659
|
+
phase = 'card-inventory';
|
|
56383
56660
|
const cards = (await this.comments.listIssueComments(context.issueNumber)).filter(comment => {
|
|
56384
56661
|
const marker = (0, publication_identity_policy_1.parsePublicationMarker)(comment.body);
|
|
56385
56662
|
return marker?.identity.topic === 'branch-sync' && marker.identity.target.kind === 'issue'
|
|
@@ -56388,38 +56665,40 @@ class RetireBranchSyncUseCase {
|
|
|
56388
56665
|
&& Number.isSafeInteger(comment.id) && comment.id > 0
|
|
56389
56666
|
&& Boolean(comment.user?.login && (0, github_user_policy_1.githubUsersMatch)(context.trustedBotLogin, comment.user.login));
|
|
56390
56667
|
});
|
|
56668
|
+
remaining = Math.min(cards.length, 3000);
|
|
56391
56669
|
if (cards.length > 20)
|
|
56392
56670
|
throw stale();
|
|
56671
|
+
const verifyClosed = async () => {
|
|
56672
|
+
phase = 'native-fence';
|
|
56673
|
+
const fresh = await read();
|
|
56674
|
+
if (!nativeClosed || fresh.reason !== initial.reason)
|
|
56675
|
+
throw stale();
|
|
56676
|
+
};
|
|
56393
56677
|
for (const card of cards) {
|
|
56394
56678
|
const marker = (0, publication_identity_policy_1.parsePublicationMarker)(card.body);
|
|
56395
56679
|
const body = (0, branch_sync_notification_policy_1.buildRetiredBranchSyncComment)(marker.identity, messages);
|
|
56396
|
-
|
|
56397
|
-
|
|
56398
|
-
|
|
56399
|
-
|
|
56400
|
-
|
|
56401
|
-
|
|
56402
|
-
throw stale();
|
|
56403
|
-
const fresh = await this.issues.readIssue(context.issueNumber);
|
|
56404
|
-
nativeClosed = fresh.number === context.issueNumber && fresh.state === 'closed';
|
|
56405
|
-
if (!nativeClosed || fresh.reason !== initial.reason)
|
|
56406
|
-
throw stale();
|
|
56407
|
-
await this.comments.updateComment(context.issueNumber, card.id, body);
|
|
56408
|
-
retired++;
|
|
56680
|
+
const verified = await (0, verify_closed_issue_card_retirement_1.verifyClosedIssueCardRetirement)({ issueNumber: context.issueNumber,
|
|
56681
|
+
commentId: card.id, author: context.trustedBotLogin, originalBody: card.body ?? '', finalBody: body,
|
|
56682
|
+
freshness: this.cardFreshness, verifyClosed, onUpdated: () => { retired++; }, phase: value => { phase = value; },
|
|
56683
|
+
update: () => this.comments.updateComment(context.issueNumber, card.id, body) });
|
|
56684
|
+
superseded || (superseded = verified.superseded);
|
|
56685
|
+
remaining--;
|
|
56409
56686
|
}
|
|
56410
|
-
|
|
56687
|
+
await verifyClosed();
|
|
56688
|
+
return [this.result(retired, nativeClosed, superseded)];
|
|
56411
56689
|
}
|
|
56412
56690
|
catch (cause) {
|
|
56413
56691
|
return [new result_1.Result({ id: this.taskId, success: false, executed: retired > 0,
|
|
56414
56692
|
steps: [nativeClosed ? 'Issue closure is retained; synchronization recommendation retirement could not be fully verified. Retry the closed-issue event or merged-PR operation.' : 'Native issue closure could not be verified; synchronization recommendations were left unchanged.'],
|
|
56415
|
-
errors: [(0,
|
|
56693
|
+
errors: [(0, closed_issue_reconciliation_error_1.closedIssueReconciliationError)(cause, { resultId: this.taskId, phase, state, reason, changed: retired, remaining })],
|
|
56416
56694
|
payload: { nativeClosed, retiredCards: retired, reconciled: false } })];
|
|
56417
56695
|
}
|
|
56418
56696
|
}
|
|
56419
|
-
result(retired, nativeClosed) {
|
|
56697
|
+
result(retired, nativeClosed, superseded = false) {
|
|
56420
56698
|
return new result_1.Result({ id: this.taskId, success: true, executed: retired > 0,
|
|
56421
56699
|
steps: [retired ? 'The closed issue’s synchronization recommendations were retired.' : 'No synchronization recommendation required retirement.'],
|
|
56422
|
-
payload: { ...(nativeClosed ? { state: 'closed' } : {}), nativeClosed, retiredCards: retired, reconciled: true
|
|
56700
|
+
payload: { ...(nativeClosed ? { state: 'closed' } : {}), nativeClosed, retiredCards: retired, reconciled: true, superseded,
|
|
56701
|
+
outcome: nativeClosed ? retired ? 'reconciled' : 'already-converged' : 'not-applicable' } });
|
|
56423
56702
|
}
|
|
56424
56703
|
}
|
|
56425
56704
|
exports.RetireBranchSyncUseCase = RetireBranchSyncUseCase;
|
|
@@ -56460,7 +56739,9 @@ exports.RetireClosedIssueCardsUseCase = RetireClosedIssueCardsUseCase;
|
|
|
56460
56739
|
|
|
56461
56740
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
56462
56741
|
exports.RetireProgressUseCase = void 0;
|
|
56463
|
-
const
|
|
56742
|
+
const verify_closed_issue_card_retirement_1 = __nccwpck_require__(78813);
|
|
56743
|
+
const closed_issue_reconciliation_error_1 = __nccwpck_require__(12183);
|
|
56744
|
+
const closed_issue_reconciliation_1 = __nccwpck_require__(21565);
|
|
56464
56745
|
const result_1 = __nccwpck_require__(73817);
|
|
56465
56746
|
const github_user_policy_1 = __nccwpck_require__(84403);
|
|
56466
56747
|
const publication_identity_policy_1 = __nccwpck_require__(45403);
|
|
@@ -56477,16 +56758,32 @@ class RetireProgressUseCase {
|
|
|
56477
56758
|
async invoke(context) {
|
|
56478
56759
|
let retired = 0;
|
|
56479
56760
|
let nativeClosed = false;
|
|
56761
|
+
let phase = 'identity';
|
|
56762
|
+
let state = 'unavailable';
|
|
56763
|
+
let reason = 'unavailable';
|
|
56764
|
+
let remaining = 0;
|
|
56765
|
+
let superseded = false;
|
|
56480
56766
|
try {
|
|
56481
56767
|
if (!Number.isSafeInteger(context.issueNumber) || context.issueNumber < 1 || !context.trustedBotLogin) {
|
|
56482
56768
|
return [this.result(retired, nativeClosed)];
|
|
56483
56769
|
}
|
|
56484
|
-
const
|
|
56770
|
+
const read = async () => {
|
|
56771
|
+
state = 'unavailable';
|
|
56772
|
+
reason = 'unavailable';
|
|
56773
|
+
const facts = await this.issues.readIssue(context.issueNumber);
|
|
56774
|
+
nativeClosed = facts?.number === context.issueNumber && facts.state === 'closed';
|
|
56775
|
+
state = facts?.number === context.issueNumber && ['open', 'closed'].includes(facts.state) ? facts.state : 'unavailable';
|
|
56776
|
+
reason = closed_issue_reconciliation_1.CLOSED_ISSUE_REASONS.some(value => value === facts?.reason) ? facts.reason : 'unavailable';
|
|
56777
|
+
return facts;
|
|
56778
|
+
};
|
|
56779
|
+
phase = 'read';
|
|
56780
|
+
const initial = await read();
|
|
56485
56781
|
if (initial.number !== context.issueNumber || !['open', 'closed'].includes(initial.state) || initial.state === 'closed' && !['completed', 'not_planned', 'duplicate', 'unknown'].includes(initial.reason))
|
|
56486
56782
|
throw stale();
|
|
56487
56783
|
if (initial.state !== 'closed')
|
|
56488
56784
|
return [this.result(retired, nativeClosed)];
|
|
56489
56785
|
nativeClosed = true;
|
|
56786
|
+
phase = 'card-inventory';
|
|
56490
56787
|
const cards = (await this.comments.listIssueComments(context.issueNumber)).filter(comment => {
|
|
56491
56788
|
const marker = (0, publication_identity_policy_1.parsePublicationMarker)(comment.body);
|
|
56492
56789
|
return marker?.identity.topic === 'progress' && marker.identity.target.kind === 'issue'
|
|
@@ -56495,37 +56792,39 @@ class RetireProgressUseCase {
|
|
|
56495
56792
|
&& Number.isSafeInteger(comment.id) && comment.id > 0
|
|
56496
56793
|
&& Boolean(comment.user?.login && (0, github_user_policy_1.githubUsersMatch)(context.trustedBotLogin, comment.user.login));
|
|
56497
56794
|
});
|
|
56795
|
+
remaining = Math.min(cards.length, 3000);
|
|
56498
56796
|
if (cards.length > 20)
|
|
56499
56797
|
throw stale();
|
|
56500
|
-
|
|
56501
|
-
|
|
56502
|
-
|
|
56503
|
-
continue;
|
|
56504
|
-
const witness = Object.freeze({ surface: 'issue-comment', commentId: card.id,
|
|
56505
|
-
author: context.trustedBotLogin, target: Object.freeze({ kind: 'issue', number: context.issueNumber }),
|
|
56506
|
-
bodyDigest: (0, reply_request_digest_1.replyRequestBodyDigest)(card.body ?? '') });
|
|
56507
|
-
if (!await this.cardFreshness.matches(witness))
|
|
56508
|
-
throw stale();
|
|
56509
|
-
const fresh = await this.issues.readIssue(context.issueNumber);
|
|
56510
|
-
nativeClosed = fresh.number === context.issueNumber && fresh.state === 'closed';
|
|
56798
|
+
const verifyClosed = async () => {
|
|
56799
|
+
phase = 'native-fence';
|
|
56800
|
+
const fresh = await read();
|
|
56511
56801
|
if (!nativeClosed || fresh.reason !== initial.reason)
|
|
56512
56802
|
throw stale();
|
|
56513
|
-
|
|
56514
|
-
|
|
56803
|
+
};
|
|
56804
|
+
for (const card of cards) {
|
|
56805
|
+
const body = (0, retired_progress_presentation_policy_1.buildRetiredProgressComment)(card.body ?? '', context.locale, initial.reason);
|
|
56806
|
+
const verified = await (0, verify_closed_issue_card_retirement_1.verifyClosedIssueCardRetirement)({ issueNumber: context.issueNumber,
|
|
56807
|
+
commentId: card.id, author: context.trustedBotLogin, originalBody: card.body ?? '', finalBody: body,
|
|
56808
|
+
freshness: this.cardFreshness, verifyClosed, onUpdated: () => { retired++; }, phase: value => { phase = value; },
|
|
56809
|
+
update: () => this.comments.updateComment(context.issueNumber, card.id, body) });
|
|
56810
|
+
superseded || (superseded = verified.superseded);
|
|
56811
|
+
remaining--;
|
|
56515
56812
|
}
|
|
56516
|
-
|
|
56813
|
+
await verifyClosed();
|
|
56814
|
+
return [this.result(retired, nativeClosed, superseded)];
|
|
56517
56815
|
}
|
|
56518
56816
|
catch (cause) {
|
|
56519
56817
|
return [new result_1.Result({ id: this.taskId, success: false, executed: retired > 0,
|
|
56520
56818
|
steps: [nativeClosed ? 'Issue closure is retained; progress card retirement could not be fully verified. Retry the closed-issue event or merged-PR operation.' : 'Native issue closure could not be verified; progress cards were left unchanged.'],
|
|
56521
|
-
errors: [(0,
|
|
56819
|
+
errors: [(0, closed_issue_reconciliation_error_1.closedIssueReconciliationError)(cause, { resultId: this.taskId, phase, state, reason, changed: retired, remaining })],
|
|
56522
56820
|
payload: { nativeClosed, retiredCards: retired, reconciled: false } })];
|
|
56523
56821
|
}
|
|
56524
56822
|
}
|
|
56525
|
-
result(retired, nativeClosed) {
|
|
56823
|
+
result(retired, nativeClosed, superseded = false) {
|
|
56526
56824
|
return new result_1.Result({ id: this.taskId, success: true, executed: retired > 0,
|
|
56527
56825
|
steps: [retired ? 'The closed issue’s progress cards were retired.' : 'No progress card required retirement.'],
|
|
56528
|
-
payload: { ...(nativeClosed ? { state: 'closed' } : {}), nativeClosed, retiredCards: retired, reconciled: true
|
|
56826
|
+
payload: { ...(nativeClosed ? { state: 'closed' } : {}), nativeClosed, retiredCards: retired, reconciled: true, superseded,
|
|
56827
|
+
outcome: nativeClosed ? retired ? 'reconciled' : 'already-converged' : 'not-applicable' } });
|
|
56529
56828
|
}
|
|
56530
56829
|
}
|
|
56531
56830
|
exports.RetireProgressUseCase = RetireProgressUseCase;
|
|
@@ -56916,6 +57215,48 @@ function sameLabels(left, right) {
|
|
|
56916
57215
|
}
|
|
56917
57216
|
|
|
56918
57217
|
|
|
57218
|
+
/***/ }),
|
|
57219
|
+
|
|
57220
|
+
/***/ 78813:
|
|
57221
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
57222
|
+
|
|
57223
|
+
"use strict";
|
|
57224
|
+
|
|
57225
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
57226
|
+
exports.verifyClosedIssueCardRetirement = verifyClosedIssueCardRetirement;
|
|
57227
|
+
const reply_request_digest_1 = __nccwpck_require__(47971);
|
|
57228
|
+
const application_error_1 = __nccwpck_require__(75999);
|
|
57229
|
+
/** Adopt another invocation only after the exact final owned body and native closure are fresh. */
|
|
57230
|
+
async function verifyClosedIssueCardRetirement(input) {
|
|
57231
|
+
const witness = (body) => Object.freeze({ surface: 'issue-comment',
|
|
57232
|
+
commentId: input.commentId, author: input.author,
|
|
57233
|
+
target: Object.freeze({ kind: 'issue', number: input.issueNumber }), bodyDigest: (0, reply_request_digest_1.replyRequestBodyDigest)(body) });
|
|
57234
|
+
let updated = false;
|
|
57235
|
+
let failedWrite;
|
|
57236
|
+
if (input.originalBody !== input.finalBody) {
|
|
57237
|
+
input.phase('card-freshness');
|
|
57238
|
+
if (await input.freshness.matches(witness(input.originalBody))) {
|
|
57239
|
+
await input.verifyClosed();
|
|
57240
|
+
input.phase('card-update');
|
|
57241
|
+
try {
|
|
57242
|
+
await input.update();
|
|
57243
|
+
updated = true;
|
|
57244
|
+
input.onUpdated();
|
|
57245
|
+
}
|
|
57246
|
+
catch (cause) {
|
|
57247
|
+
failedWrite = cause;
|
|
57248
|
+
}
|
|
57249
|
+
}
|
|
57250
|
+
}
|
|
57251
|
+
input.phase('card-verification');
|
|
57252
|
+
if (!await input.freshness.matches(witness(input.finalBody))) {
|
|
57253
|
+
throw failedWrite ?? new application_error_1.ApplicationError('workflow.stale', 'The required final owned card could not be verified.');
|
|
57254
|
+
}
|
|
57255
|
+
await input.verifyClosed();
|
|
57256
|
+
return { updated, superseded: !updated && input.originalBody !== input.finalBody };
|
|
57257
|
+
}
|
|
57258
|
+
|
|
57259
|
+
|
|
56919
57260
|
/***/ }),
|
|
56920
57261
|
|
|
56921
57262
|
/***/ 4643:
|
|
@@ -57143,7 +57484,7 @@ class SyncBranchUseCase {
|
|
|
57143
57484
|
const commands = (0, verify_command_policy_1.limitVerifyCommands)([...context.verifyCommands]);
|
|
57144
57485
|
if (commands.length === verify_command_policy_1.MAX_VERIFY_COMMANDS)
|
|
57145
57486
|
(0, logging_ports_1.logInfo)(`Branch sync verification is capped at ${verify_command_policy_1.MAX_VERIFY_COMMANDS} commands.`);
|
|
57146
|
-
const verification = await (0, verify_command_runner_1.runVerifyCommands)(commands, (program, args) => this.git.execute(program, args, { untrusted: true }));
|
|
57487
|
+
const verification = await (0, verify_command_runner_1.runVerifyCommands)(commands, (program, args) => this.git.execute(program, args, { untrusted: true, verifyRuntimePrerequisites: true }));
|
|
57147
57488
|
if (!verification.success) {
|
|
57148
57489
|
return {
|
|
57149
57490
|
commandCount: commands.length,
|
|
@@ -65658,7 +65999,7 @@ async function runVerification(context, gitCommitPort) {
|
|
|
65658
65999
|
if (verifyCommands.length === 0)
|
|
65659
66000
|
return undefined;
|
|
65660
66001
|
(0, logging_ports_1.logInfo)(`Running ${verifyCommands.length} verify ${verifyCommands.length === 1 ? 'command' : 'commands'}...`);
|
|
65661
|
-
const verify = await (0, verify_command_runner_1.runVerifyCommands)(verifyCommands, (program, args) => gitCommitPort.execute(program, args, { untrusted: true }));
|
|
66002
|
+
const verify = await (0, verify_command_runner_1.runVerifyCommands)(verifyCommands, (program, args) => gitCommitPort.execute(program, args, { untrusted: true, verifyRuntimePrerequisites: true }));
|
|
65662
66003
|
return verify.success
|
|
65663
66004
|
? undefined
|
|
65664
66005
|
: verify.error ?? `Verify command failed: ${verify.failedCommand ?? "unknown"}.`;
|
|
@@ -67881,6 +68222,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
67881
68222
|
exports.runVerifyCommands = runVerifyCommands;
|
|
67882
68223
|
const logging_ports_1 = __nccwpck_require__(6152);
|
|
67883
68224
|
const verify_command_policy_1 = __nccwpck_require__(96031);
|
|
68225
|
+
const verification_runtime_policy_1 = __nccwpck_require__(89347);
|
|
67884
68226
|
async function runVerifyCommands(commands, execute) {
|
|
67885
68227
|
for (const command of commands) {
|
|
67886
68228
|
const result = await executeVerifyCommand(command, execute);
|
|
@@ -67899,7 +68241,11 @@ async function executeVerifyCommand(command, execute) {
|
|
|
67899
68241
|
? { success: true }
|
|
67900
68242
|
: { success: false, failedCommand: formatCommandForDiagnostics(parsed) };
|
|
67901
68243
|
}
|
|
67902
|
-
catch {
|
|
68244
|
+
catch (error) {
|
|
68245
|
+
if (error instanceof verification_runtime_policy_1.VerificationPrerequisiteError) {
|
|
68246
|
+
return { success: false, failedCommand: formatCommandForDiagnostics(parsed),
|
|
68247
|
+
error: `${error.message} Verification command: ${formatCommandForDiagnostics(parsed)}.` };
|
|
68248
|
+
}
|
|
67903
68249
|
(0, logging_ports_1.logError)('Verify command failed.');
|
|
67904
68250
|
return { success: false, failedCommand: formatCommandForDiagnostics(parsed) };
|
|
67905
68251
|
}
|
|
@@ -70081,6 +70427,7 @@ exports.titleUpdateFailure = titleUpdateFailure;
|
|
|
70081
70427
|
const result_1 = __nccwpck_require__(73817);
|
|
70082
70428
|
const application_error_1 = __nccwpck_require__(75999);
|
|
70083
70429
|
const positive_integer_policy_1 = __nccwpck_require__(19879);
|
|
70430
|
+
const pull_request_title_policy_1 = __nccwpck_require__(59756);
|
|
70084
70431
|
function projectUpdateTitleContext(source) {
|
|
70085
70432
|
if (source.isIssue) {
|
|
70086
70433
|
return Object.freeze({
|
|
@@ -70131,19 +70478,27 @@ async function runPullRequestTitleUpdate(param, taskId, issueRepository) {
|
|
|
70131
70478
|
if (!linkedIssueNumber || linkedIssueNumber === param.pullRequestNumber) {
|
|
70132
70479
|
return [skippedResult(taskId)];
|
|
70133
70480
|
}
|
|
70481
|
+
const currentTitle = await issueRepository.getTitle(param.pullRequestNumber);
|
|
70482
|
+
if (currentTitle === undefined) {
|
|
70483
|
+
return [new result_1.Result({ id: taskId, success: false, executed: true,
|
|
70484
|
+
steps: ['The current pull request title could not be read. No title change was attempted.'],
|
|
70485
|
+
errors: [new application_error_1.ApplicationError('provider.unavailable', 'Unable to read the current pull request title.')] })];
|
|
70486
|
+
}
|
|
70487
|
+
if ((0, pull_request_title_policy_1.hasConventionalPullRequestTitle)(currentTitle))
|
|
70488
|
+
return [skippedResult(taskId)];
|
|
70134
70489
|
const issueTitle = await issueRepository.getTitle(linkedIssueNumber);
|
|
70135
70490
|
if (issueTitle === undefined) {
|
|
70136
70491
|
return [new result_1.Result({ id: taskId, success: false, executed: true, steps: ['Tried to update title, but there was a problem.'] })];
|
|
70137
70492
|
}
|
|
70138
70493
|
const title = await issueRepository.updatePullRequestTitle({
|
|
70139
|
-
pullRequestTitle:
|
|
70494
|
+
pullRequestTitle: currentTitle,
|
|
70140
70495
|
issueTitle,
|
|
70141
70496
|
issueNumber: linkedIssueNumber,
|
|
70142
70497
|
pullRequestNumber: param.pullRequestNumber,
|
|
70143
70498
|
labelFacts: param.labelFacts,
|
|
70144
70499
|
});
|
|
70145
70500
|
return title
|
|
70146
|
-
? [updatedResult(taskId, `The pull request's title was updated from \`${
|
|
70501
|
+
? [updatedResult(taskId, `The pull request's title was updated from \`${currentTitle}\` to \`${title}\`.`)]
|
|
70147
70502
|
: [skippedResult(taskId)];
|
|
70148
70503
|
}
|
|
70149
70504
|
function titleUpdateFailure(taskId, error) {
|
|
@@ -70586,6 +70941,8 @@ exports.CheckPriorityIssueSizeUseCase = CheckPriorityIssueSizeUseCase;
|
|
|
70586
70941
|
|
|
70587
70942
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
70588
70943
|
exports.CloseIssueAfterMergingUseCase = void 0;
|
|
70944
|
+
const reconcile_issue_completion_metadata_1 = __nccwpck_require__(70614);
|
|
70945
|
+
const closed_issue_reconciliation_error_1 = __nccwpck_require__(12183);
|
|
70589
70946
|
const result_1 = __nccwpck_require__(73817);
|
|
70590
70947
|
const issue_completion_1 = __nccwpck_require__(31147);
|
|
70591
70948
|
const application_error_1 = __nccwpck_require__(75999);
|
|
@@ -70604,7 +70961,7 @@ class CloseIssueAfterMergingUseCase {
|
|
|
70604
70961
|
steps: ['No separate safe linked issue and pull request were found; issue closure was skipped.'] })];
|
|
70605
70962
|
let closedThisRun = false;
|
|
70606
70963
|
let nativeClosed = false;
|
|
70607
|
-
|
|
70964
|
+
const progress = (0, reconcile_issue_completion_metadata_1.completionRepairProgress)();
|
|
70608
70965
|
try {
|
|
70609
70966
|
const pull = await this.issues.readPullRequest(pullNumber);
|
|
70610
70967
|
if (pull.number !== pullNumber || pull.state !== 'closed' || pull.merged !== true)
|
|
@@ -70628,44 +70985,21 @@ class CloseIssueAfterMergingUseCase {
|
|
|
70628
70985
|
nativeClosed = facts.state === 'closed';
|
|
70629
70986
|
if (!nativeClosed || closedThisRun && facts.reason !== 'completed')
|
|
70630
70987
|
throw stale();
|
|
70631
|
-
const
|
|
70632
|
-
|
|
70633
|
-
|
|
70634
|
-
if (freshPlan.kind !== 'closed' || freshFacts.reason !== facts.reason)
|
|
70635
|
-
throw stale();
|
|
70636
|
-
return freshPlan;
|
|
70637
|
-
};
|
|
70638
|
-
const plan = (0, issue_completion_1.planIssueCompletion)(facts, param.completionLabels);
|
|
70639
|
-
if (plan.kind !== 'closed')
|
|
70640
|
-
throw stale();
|
|
70641
|
-
for (const label of plan.remove) {
|
|
70642
|
-
const fresh = await fence();
|
|
70643
|
-
if (fresh.remove.includes(label)) {
|
|
70644
|
-
await target.removeLabel(label);
|
|
70645
|
-
labelsChanged++;
|
|
70646
|
-
}
|
|
70647
|
-
}
|
|
70648
|
-
for (const label of plan.add) {
|
|
70649
|
-
const fresh = await fence();
|
|
70650
|
-
if (fresh.add.includes(label)) {
|
|
70651
|
-
await target.addLabel(label);
|
|
70652
|
-
labelsChanged++;
|
|
70653
|
-
}
|
|
70654
|
-
}
|
|
70655
|
-
const final = await fence();
|
|
70656
|
-
if (final.remove.length || final.add.length)
|
|
70657
|
-
throw stale();
|
|
70658
|
-
return [new result_1.Result({ id: this.taskId, success: true, executed: closedThisRun || labelsChanged > 0,
|
|
70988
|
+
const repaired = await (0, reconcile_issue_completion_metadata_1.reconcileIssueCompletionMetadata)(target, number, param.completionLabels, progress, facts);
|
|
70989
|
+
nativeClosed = progress.nativeClosed;
|
|
70990
|
+
return [new result_1.Result({ id: this.taskId, success: true, executed: closedThisRun || progress.labelsChanged > 0,
|
|
70659
70991
|
steps: [`Issue #${number} is closed and its completion metadata was verified after PR #${pullNumber} merged.`],
|
|
70660
|
-
payload: { issueCompletion: Object.freeze({ number, nativeClosed, closedThisRun, labelsChanged
|
|
70992
|
+
payload: { issueCompletion: Object.freeze({ number, nativeClosed, closedThisRun, labelsChanged: progress.labelsChanged, ...repaired, reconciled: true }) } })];
|
|
70661
70993
|
}
|
|
70662
70994
|
catch (error) {
|
|
70663
|
-
|
|
70664
|
-
|
|
70665
|
-
|
|
70666
|
-
|
|
70995
|
+
if (progress.phase !== 'identity')
|
|
70996
|
+
nativeClosed = progress.nativeClosed;
|
|
70997
|
+
const semanticError = (0, closed_issue_reconciliation_error_1.closedIssueReconciliationError)(error, { resultId: this.taskId,
|
|
70998
|
+
phase: progress.phase, state: progress.state, reason: progress.reason,
|
|
70999
|
+
changed: progress.labelsChanged, remaining: progress.remaining });
|
|
71000
|
+
return [new result_1.Result({ id: this.taskId, success: false, executed: closedThisRun || progress.labelsChanged > 0,
|
|
70667
71001
|
steps: [nativeClosed ? 'The native issue closure was retained; completion metadata remains unverified.' : 'Native issue completion remains unverified.'],
|
|
70668
|
-
errors: [semanticError], payload: { issueCompletion: Object.freeze({ number, nativeClosed, closedThisRun, labelsChanged, reconciled: false }) } })];
|
|
71002
|
+
errors: [semanticError], payload: { issueCompletion: Object.freeze({ number, nativeClosed, closedThisRun, labelsChanged: progress.labelsChanged, reconciled: false }) } })];
|
|
70669
71003
|
}
|
|
70670
71004
|
}
|
|
70671
71005
|
}
|
|
@@ -73494,6 +73828,7 @@ exports.registerSetupCommand = registerSetupCommand;
|
|
|
73494
73828
|
const product_identity_1 = __nccwpck_require__(18739);
|
|
73495
73829
|
const setup_command_options_1 = __nccwpck_require__(99254);
|
|
73496
73830
|
const setup_execution_1 = __nccwpck_require__(51293);
|
|
73831
|
+
const setup_documentation_1 = __nccwpck_require__(2396);
|
|
73497
73832
|
function registerSetupCommand(program) {
|
|
73498
73833
|
program
|
|
73499
73834
|
.command('setup')
|
|
@@ -73527,6 +73862,7 @@ function registerSetupCommand(program) {
|
|
|
73527
73862
|
.option('--update-workflows', 'Allow setup-managed workflows already in the repository to be updated', false)
|
|
73528
73863
|
.option('--workflow-pat <token>', 'Workflow PAT for the bot account (prefer the hidden interactive prompt)')
|
|
73529
73864
|
.option('--secret <name=value>', 'Secret value for non-interactive setup; repeat for each API key', setup_command_options_1.collectSecret, {})
|
|
73865
|
+
.addHelpText('after', `\nGuides (open only when you choose):\n Web setup tutorial: ${setup_documentation_1.SETUP_DOCUMENTATION.tutorial}\n First issue-to-PR workflow: ${setup_documentation_1.SETUP_DOCUMENTATION.firstWorkflow}\n Troubleshooting: ${setup_documentation_1.SETUP_DOCUMENTATION.recovery}\n\nDuring interactive setup, type ? for question help and :back to revisit an answer.\n`)
|
|
73530
73866
|
.action(setup_execution_1.executeSetupCommand);
|
|
73531
73867
|
}
|
|
73532
73868
|
|
|
@@ -75440,9 +75776,19 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
75440
75776
|
exports.ConsoleSetupJourneyPresenter = void 0;
|
|
75441
75777
|
exports.renderSetupJourney = renderSetupJourney;
|
|
75442
75778
|
const setup_prompt_rendering_1 = __nccwpck_require__(76673);
|
|
75779
|
+
const setup_documentation_1 = __nccwpck_require__(2396);
|
|
75443
75780
|
class ConsoleSetupJourneyPresenter {
|
|
75444
75781
|
present(view) {
|
|
75445
75782
|
console.log(renderSetupJourney(view));
|
|
75783
|
+
if (view.outcome === 'complete') {
|
|
75784
|
+
console.log(`Next: install the reviewed files, then verify your first workflow: ${setup_documentation_1.SETUP_DOCUMENTATION.firstWorkflow}`);
|
|
75785
|
+
}
|
|
75786
|
+
else if (view.outcome === 'blocked' || view.outcome === 'partial') {
|
|
75787
|
+
console.log(`Inspect the result before retrying. Troubleshooting: ${setup_documentation_1.SETUP_DOCUMENTATION.recovery}`);
|
|
75788
|
+
}
|
|
75789
|
+
else if (view.current === 'Repository' || view.outcome === 'dry-run') {
|
|
75790
|
+
console.log(`Setup tutorial (opens only when you choose): ${setup_documentation_1.SETUP_DOCUMENTATION.tutorial}`);
|
|
75791
|
+
}
|
|
75446
75792
|
}
|
|
75447
75793
|
}
|
|
75448
75794
|
exports.ConsoleSetupJourneyPresenter = ConsoleSetupJourneyPresenter;
|
|
@@ -78008,6 +78354,8 @@ var _ApplicationError_cause;
|
|
|
78008
78354
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
78009
78355
|
exports.ApplicationError = exports.APPLICATION_ERROR_METADATA = exports.APPLICATION_ERROR_RECOVERY_IDS = void 0;
|
|
78010
78356
|
exports.isApplicationErrorCorrelationId = isApplicationErrorCorrelationId;
|
|
78357
|
+
const closed_issue_reconciliation_1 = __nccwpck_require__(21565);
|
|
78358
|
+
const approval_evidence_diagnostic_1 = __nccwpck_require__(98205);
|
|
78011
78359
|
const branch_sync_validation_1 = __nccwpck_require__(90981);
|
|
78012
78360
|
exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([
|
|
78013
78361
|
'pull-request-link-restored',
|
|
@@ -78023,6 +78371,8 @@ exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([
|
|
|
78023
78371
|
'sdd-draft-size-exceeded',
|
|
78024
78372
|
'sdd-draft-format-invalid',
|
|
78025
78373
|
'workspace-changes-rejected',
|
|
78374
|
+
'closed-issue-reconciliation-failed',
|
|
78375
|
+
'approval-evidence-read-failed',
|
|
78026
78376
|
]);
|
|
78027
78377
|
const PRESERVED_STATE = 'Existing persisted state and completed external effects were preserved.';
|
|
78028
78378
|
const UNCHANGED_STATE = 'No new state or external effect was created.';
|
|
@@ -78214,6 +78564,8 @@ class ApplicationError extends Error {
|
|
|
78214
78564
|
exports.ApplicationError = ApplicationError;
|
|
78215
78565
|
_ApplicationError_cause = new WeakMap();
|
|
78216
78566
|
const RECOVERY_VARIABLE_KEYS = Object.freeze({
|
|
78567
|
+
'closed-issue-reconciliation-failed': Object.freeze(['resultId', 'phase', 'state', 'reason', 'changed', 'remaining']),
|
|
78568
|
+
'approval-evidence-read-failed': Object.freeze(['operation', 'reason', 'permission']),
|
|
78217
78569
|
'pull-request-link-restored': Object.freeze([]),
|
|
78218
78570
|
'pull-request-link-base-retained': Object.freeze([]),
|
|
78219
78571
|
'pull-request-link-reference-retained': Object.freeze([]),
|
|
@@ -78266,6 +78618,20 @@ function normalizeApplicationErrorRecovery(recovery) {
|
|
|
78266
78618
|
&& !branch_sync_validation_1.BRANCH_SYNC_VALIDATION_CODES.some(code => code === variables.validationCode)) {
|
|
78267
78619
|
throw new TypeError('Application error recovery synchronization validation code is invalid.');
|
|
78268
78620
|
}
|
|
78621
|
+
if (recovery.id === 'closed-issue-reconciliation-failed'
|
|
78622
|
+
&& (!closed_issue_reconciliation_1.CLOSED_ISSUE_RESULTS.some(value => value === variables.resultId)
|
|
78623
|
+
|| !closed_issue_reconciliation_1.CLOSED_ISSUE_PHASES.some(value => value === variables.phase)
|
|
78624
|
+
|| !['open', 'closed', 'unavailable'].includes(variables.state)
|
|
78625
|
+
|| !closed_issue_reconciliation_1.CLOSED_ISSUE_REASONS.some(value => value === variables.reason)
|
|
78626
|
+
|| ![variables.changed, variables.remaining].every(value => typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 && value <= 3000))) {
|
|
78627
|
+
throw new TypeError('Closed issue reconciliation diagnostic is invalid.');
|
|
78628
|
+
}
|
|
78629
|
+
if (recovery.id === 'approval-evidence-read-failed'
|
|
78630
|
+
&& (!Object.prototype.hasOwnProperty.call(approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_PERMISSIONS, variables.operation)
|
|
78631
|
+
|| !approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_REASONS.some(reason => reason === variables.reason)
|
|
78632
|
+
|| approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_PERMISSIONS[variables.operation] !== variables.permission)) {
|
|
78633
|
+
throw new TypeError('Approval evidence diagnostic is invalid.');
|
|
78634
|
+
}
|
|
78269
78635
|
return Object.freeze({
|
|
78270
78636
|
id: recovery.id,
|
|
78271
78637
|
variables: Object.freeze({ ...variables }),
|
|
@@ -84736,6 +85102,7 @@ exports.IssueProgressTrackingRepository = IssueProgressTrackingRepository;
|
|
|
84736
85102
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
84737
85103
|
exports.IssueTitleRepository = void 0;
|
|
84738
85104
|
const issue_emoji_policy_1 = __nccwpck_require__(81201);
|
|
85105
|
+
const pull_request_title_policy_1 = __nccwpck_require__(59756);
|
|
84739
85106
|
const issue_title_policy_1 = __nccwpck_require__(83179);
|
|
84740
85107
|
const issue_title_update_1 = __nccwpck_require__(9229);
|
|
84741
85108
|
class IssueTitleRepository {
|
|
@@ -84753,10 +85120,12 @@ class IssueTitleRepository {
|
|
|
84753
85120
|
return (0, issue_title_update_1.updateIssueTitle)(this.issueTitleClient, owner, repository, issueTitle, formattedTitle, issueNumber, token);
|
|
84754
85121
|
});
|
|
84755
85122
|
};
|
|
84756
|
-
this.updateTitlePullRequestFormat = async (owner, repository, pullRequestTitle, issueTitle, issueNumber, pullRequestNumber,
|
|
85123
|
+
this.updateTitlePullRequestFormat = async (owner, repository, pullRequestTitle, issueTitle, issueNumber, pullRequestNumber, _branchManagementEmoji, labels, token) => {
|
|
84757
85124
|
return (0, issue_title_update_1.withTitleUpdateLogging)(() => {
|
|
84758
|
-
|
|
84759
|
-
|
|
85125
|
+
if ((0, pull_request_title_policy_1.hasConventionalPullRequestTitle)(pullRequestTitle))
|
|
85126
|
+
return Promise.resolve(undefined);
|
|
85127
|
+
const sourceTitle = (0, issue_title_policy_1.normalizePullRequestSourceTitle)(issueTitle, issueNumber);
|
|
85128
|
+
const formattedTitle = (0, pull_request_title_policy_1.generatedPullRequestTitle)(sourceTitle, (0, issue_title_policy_1.sanitizePullRequestTitle)(sourceTitle), issueNumber, labels);
|
|
84760
85129
|
return (0, issue_title_update_1.updateIssueTitle)(this.issueTitleClient, owner, repository, pullRequestTitle, formattedTitle, pullRequestNumber, token);
|
|
84761
85130
|
});
|
|
84762
85131
|
};
|
|
@@ -86051,6 +86420,41 @@ function parseApprovalCoverageZip(value) {
|
|
|
86051
86420
|
}
|
|
86052
86421
|
|
|
86053
86422
|
|
|
86423
|
+
/***/ }),
|
|
86424
|
+
|
|
86425
|
+
/***/ 9958:
|
|
86426
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
86427
|
+
|
|
86428
|
+
"use strict";
|
|
86429
|
+
|
|
86430
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
86431
|
+
exports.readApprovalEvidence = readApprovalEvidence;
|
|
86432
|
+
const application_error_1 = __nccwpck_require__(75999);
|
|
86433
|
+
const approval_evidence_error_1 = __nccwpck_require__(50519);
|
|
86434
|
+
const approval_evidence_diagnostic_1 = __nccwpck_require__(98205);
|
|
86435
|
+
/** Terminates provider exceptions; even unknown statuses never interpolate provider text. */
|
|
86436
|
+
async function readApprovalEvidence(operation, read) {
|
|
86437
|
+
try {
|
|
86438
|
+
return await read();
|
|
86439
|
+
}
|
|
86440
|
+
catch (cause) {
|
|
86441
|
+
if (cause instanceof application_error_1.ApplicationError && cause.recovery?.id === 'approval-evidence-read-failed')
|
|
86442
|
+
throw cause;
|
|
86443
|
+
const error = cause && typeof cause === 'object' ? cause : undefined;
|
|
86444
|
+
const response = error?.response;
|
|
86445
|
+
const status = error?.status;
|
|
86446
|
+
const rateLimited = status === 403 && (response?.headers?.['x-ratelimit-remaining'] === '0'
|
|
86447
|
+
|| typeof response?.headers?.['retry-after'] === 'string' && /^\d{1,8}$/u.test(response.headers['retry-after']));
|
|
86448
|
+
const http = typeof status === 'number' ? `http-${status}` : undefined;
|
|
86449
|
+
const reason = rateLimited ? 'http-429'
|
|
86450
|
+
: approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_REASONS.some(value => value === http) ? http
|
|
86451
|
+
: cause instanceof application_error_1.ApplicationError && cause.code === 'provider.contract-invalid' ? 'invalid-response'
|
|
86452
|
+
: status === undefined ? 'transport-unavailable' : 'invalid-response';
|
|
86453
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)(operation, reason);
|
|
86454
|
+
}
|
|
86455
|
+
}
|
|
86456
|
+
|
|
86457
|
+
|
|
86054
86458
|
/***/ }),
|
|
86055
86459
|
|
|
86056
86460
|
/***/ 55165:
|
|
@@ -86085,21 +86489,22 @@ exports.BugbotPullRequestRepository = BugbotPullRequestRepository;
|
|
|
86085
86489
|
/***/ }),
|
|
86086
86490
|
|
|
86087
86491
|
/***/ 68742:
|
|
86088
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
86492
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
86089
86493
|
|
|
86090
86494
|
"use strict";
|
|
86091
86495
|
|
|
86092
86496
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
86093
86497
|
exports.readCurrentBaseRevision = readCurrentBaseRevision;
|
|
86498
|
+
const application_error_1 = __nccwpck_require__(75999);
|
|
86094
86499
|
/** PR base metadata can lag a parent push; read the exact native branch ref. */
|
|
86095
86500
|
async function readCurrentBaseRevision(port, target, baseRef) {
|
|
86096
86501
|
if (typeof baseRef !== 'string' || baseRef.length === 0 || baseRef.length > 1024
|
|
86097
86502
|
|| baseRef.includes('\u0000') || /[\r\n]/u.test(baseRef))
|
|
86098
|
-
throw new
|
|
86503
|
+
throw new application_error_1.ApplicationError('provider.contract-invalid', 'The PR base ref is invalid.');
|
|
86099
86504
|
const { data } = await port.getRef({ owner: target.owner, repo: target.repository, ref: `heads/${baseRef}` });
|
|
86100
86505
|
if (data?.ref !== `refs/heads/${baseRef}` || data.object?.type !== 'commit' || typeof data.object.sha !== 'string'
|
|
86101
86506
|
|| !/^[a-f0-9]{40}$/u.test(data.object.sha))
|
|
86102
|
-
throw new
|
|
86507
|
+
throw new application_error_1.ApplicationError('provider.contract-invalid', 'The PR base ref cannot be verified.');
|
|
86103
86508
|
return data.object.sha;
|
|
86104
86509
|
}
|
|
86105
86510
|
|
|
@@ -86147,6 +86552,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
86147
86552
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
86148
86553
|
exports.PullRequestApprovalRepository = void 0;
|
|
86149
86554
|
exports.readEffectiveApprovalPolicy = readEffectiveApprovalPolicy;
|
|
86555
|
+
const approval_evidence_read_1 = __nccwpck_require__(9958);
|
|
86556
|
+
const approval_evidence_error_1 = __nccwpck_require__(50519);
|
|
86557
|
+
const application_error_1 = __nccwpck_require__(75999);
|
|
86150
86558
|
const current_base_revision_query_1 = __nccwpck_require__(68742);
|
|
86151
86559
|
const logging_ports_1 = __nccwpck_require__(6152);
|
|
86152
86560
|
const github = __importStar(__nccwpck_require__(78227));
|
|
@@ -86173,40 +86581,64 @@ class PullRequestApprovalRepository {
|
|
|
86173
86581
|
}
|
|
86174
86582
|
}
|
|
86175
86583
|
async readPolicy(target) {
|
|
86176
|
-
return (await this.readEffectivePolicy(target))?.value;
|
|
86584
|
+
return (0, approval_evidence_read_1.readApprovalEvidence)('policy', async () => (await this.readEffectivePolicy(target))?.value);
|
|
86177
86585
|
}
|
|
86178
86586
|
async readEffectivePolicy(target) {
|
|
86179
86587
|
return readEffectiveApprovalPolicy(this.octokit, target);
|
|
86180
86588
|
}
|
|
86181
86589
|
async loadEvidence(target) {
|
|
86182
|
-
const
|
|
86183
|
-
|
|
86590
|
+
const diagnostics = [];
|
|
86591
|
+
const { data: pull } = await (0, approval_evidence_read_1.readApprovalEvidence)('pull-request', async () => {
|
|
86592
|
+
const response = await this.octokit.rest.pulls.get({ owner: target.owner, repo: target.repository, pull_number: target.pullNumber });
|
|
86593
|
+
if (!response.data?.head || !response.data?.base || typeof response.data.head.sha !== 'string'
|
|
86594
|
+
|| typeof response.data.head.ref !== 'string' || !Number.isSafeInteger(response.data.number)) {
|
|
86595
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('pull-request', 'invalid-response');
|
|
86596
|
+
}
|
|
86597
|
+
return response;
|
|
86184
86598
|
});
|
|
86185
86599
|
const headSha = pull.head.sha;
|
|
86186
86600
|
const baseSha = await this.readCurrentBaseSha(target, pull.base.ref);
|
|
86187
|
-
const policy = (0,
|
|
86601
|
+
const policy = await (0, approval_evidence_read_1.readApprovalEvidence)('policy', async () => {
|
|
86602
|
+
const raw = await this.readPolicy(target);
|
|
86603
|
+
try {
|
|
86604
|
+
return (0, pull_request_approval_policy_1.parsePullRequestApprovalPolicy)(raw);
|
|
86605
|
+
}
|
|
86606
|
+
catch {
|
|
86607
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('policy', 'invalid-response');
|
|
86608
|
+
}
|
|
86609
|
+
});
|
|
86188
86610
|
let testedMergeSha;
|
|
86189
86611
|
if (pull.mergeable === true && /^[a-f0-9]{40}$/iu.test(pull.merge_commit_sha ?? '')) {
|
|
86190
86612
|
try {
|
|
86191
|
-
const merge = await
|
|
86192
|
-
owner: target.owner, repo: target.repository, commit_sha: pull.merge_commit_sha
|
|
86613
|
+
const merge = await (0, approval_evidence_read_1.readApprovalEvidence)('merge-commit', async () => {
|
|
86614
|
+
const response = await this.octokit.rest.git.getCommit({ owner: target.owner, repo: target.repository, commit_sha: pull.merge_commit_sha });
|
|
86615
|
+
if (!Array.isArray(response.data?.parents))
|
|
86616
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('merge-commit', 'invalid-response');
|
|
86617
|
+
return response;
|
|
86193
86618
|
});
|
|
86194
86619
|
if (merge.data.parents[0]?.sha === baseSha && merge.data.parents[1]?.sha === headSha
|
|
86195
86620
|
&& merge.data.parents.length === 2)
|
|
86196
86621
|
testedMergeSha = pull.merge_commit_sha;
|
|
86197
86622
|
}
|
|
86198
|
-
catch {
|
|
86623
|
+
catch (cause) {
|
|
86624
|
+
collectDiagnostic(diagnostics, cause);
|
|
86625
|
+
}
|
|
86199
86626
|
}
|
|
86200
86627
|
const [files, reviews, comments, headChecks, mergeChecks, headRuns, mergeRuns, rules, user] = await Promise.all([
|
|
86201
|
-
this.allPages(this.octokit.rest.pulls.listFiles, { owner: target.owner, repo: target.repository, pull_number: target.pullNumber }),
|
|
86202
|
-
this.allPages(this.octokit.rest.pulls.listReviews, { owner: target.owner, repo: target.repository, pull_number: target.pullNumber }),
|
|
86203
|
-
this.allPages(this.octokit.rest.issues.listComments, { owner: target.owner, repo: target.repository, issue_number: target.pullNumber }),
|
|
86204
|
-
this.allPages(this.octokit.rest.checks.listForRef, { owner: target.owner, repo: target.repository, ref: headSha, filter: 'all' }),
|
|
86205
|
-
testedMergeSha ? this.allPages(this.octokit.rest.checks.listForRef, { owner: target.owner, repo: target.repository, ref: testedMergeSha, filter: 'all' }) : Promise.resolve([]),
|
|
86206
|
-
this.allPages(this.octokit.rest.actions.listWorkflowRunsForRepo, { owner: target.owner, repo: target.repository, head_sha: headSha }),
|
|
86207
|
-
testedMergeSha ? this.allPages(this.octokit.rest.actions.listWorkflowRunsForRepo, { owner: target.owner, repo: target.repository, head_sha: testedMergeSha }) : Promise.resolve([]),
|
|
86208
|
-
this.effectiveRules(target.owner, target.repository, pull.base.ref),
|
|
86209
|
-
|
|
86628
|
+
this.allPages('files', this.octokit.rest.pulls.listFiles, { owner: target.owner, repo: target.repository, pull_number: target.pullNumber }),
|
|
86629
|
+
this.allPages('reviews', this.octokit.rest.pulls.listReviews, { owner: target.owner, repo: target.repository, pull_number: target.pullNumber }),
|
|
86630
|
+
this.allPages('comments', this.octokit.rest.issues.listComments, { owner: target.owner, repo: target.repository, issue_number: target.pullNumber }),
|
|
86631
|
+
this.allPages('head-checks', this.octokit.rest.checks.listForRef, { owner: target.owner, repo: target.repository, ref: headSha, filter: 'all' }),
|
|
86632
|
+
testedMergeSha ? this.allPages('merge-checks', this.octokit.rest.checks.listForRef, { owner: target.owner, repo: target.repository, ref: testedMergeSha, filter: 'all' }) : Promise.resolve([]),
|
|
86633
|
+
this.allPages('head-runs', this.octokit.rest.actions.listWorkflowRunsForRepo, { owner: target.owner, repo: target.repository, head_sha: headSha }),
|
|
86634
|
+
testedMergeSha ? this.allPages('merge-runs', this.octokit.rest.actions.listWorkflowRunsForRepo, { owner: target.owner, repo: target.repository, head_sha: testedMergeSha }) : Promise.resolve([]),
|
|
86635
|
+
this.effectiveRules(target.owner, target.repository, pull.base.ref, diagnostics),
|
|
86636
|
+
(0, approval_evidence_read_1.readApprovalEvidence)('authenticated-user', async () => {
|
|
86637
|
+
const response = await this.octokit.rest.users.getAuthenticated();
|
|
86638
|
+
if (!Number.isSafeInteger(response.data?.id) || response.data.id < 1)
|
|
86639
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('authenticated-user', 'invalid-response');
|
|
86640
|
+
return response;
|
|
86641
|
+
}),
|
|
86210
86642
|
]);
|
|
86211
86643
|
const branch = Object.entries(this.settings.branchPrefixes)
|
|
86212
86644
|
.find(([, prefix]) => pull.head.ref.startsWith(`${prefix}/`));
|
|
@@ -86227,7 +86659,7 @@ class PullRequestApprovalRepository {
|
|
|
86227
86659
|
});
|
|
86228
86660
|
const currentJobs = await Promise.all(latestRuns.map(async (run) => ({
|
|
86229
86661
|
run,
|
|
86230
|
-
jobs: await this.allPages(this.octokit.rest.actions.listJobsForWorkflowRunAttempt, {
|
|
86662
|
+
jobs: await this.allPages('jobs', this.octokit.rest.actions.listJobsForWorkflowRunAttempt, {
|
|
86231
86663
|
owner: target.owner, repo: target.repository, run_id: run.id, attempt_number: run.run_attempt,
|
|
86232
86664
|
}),
|
|
86233
86665
|
})));
|
|
@@ -86258,9 +86690,10 @@ class PullRequestApprovalRepository {
|
|
|
86258
86690
|
submittedAt: review.submitted_at ?? '',
|
|
86259
86691
|
}));
|
|
86260
86692
|
const numericCoverage = policy.coverage.mode === 'numeric'
|
|
86261
|
-
? await this.numericCoverage(target, policy.coverage.artifactWorkflowName, headSha, baseSha, testedMergeSha, workflowRuns)
|
|
86693
|
+
? await this.numericCoverage(target, policy.coverage.artifactWorkflowName, headSha, baseSha, testedMergeSha, workflowRuns, diagnostics)
|
|
86262
86694
|
: undefined;
|
|
86263
86695
|
return {
|
|
86696
|
+
...(diagnostics.length ? { diagnostics: Object.freeze(diagnostics) } : {}),
|
|
86264
86697
|
repositoryId: pull.base.repo?.id ?? 0,
|
|
86265
86698
|
pullNumber: pull.number,
|
|
86266
86699
|
headSha,
|
|
@@ -86294,7 +86727,7 @@ class PullRequestApprovalRepository {
|
|
|
86294
86727
|
...(numericCoverage ? { numericCoverage } : {}),
|
|
86295
86728
|
};
|
|
86296
86729
|
}
|
|
86297
|
-
async numericCoverage(target, workflowName, headSha, baseSha, testedMergeSha, workflowRuns) {
|
|
86730
|
+
async numericCoverage(target, workflowName, headSha, baseSha, testedMergeSha, workflowRuns, diagnostics) {
|
|
86298
86731
|
const candidates = workflowRuns.filter(run => run.name === workflowName
|
|
86299
86732
|
&& (run.head_sha === headSha || run.head_sha === testedMergeSha));
|
|
86300
86733
|
const mergeCandidates = candidates.filter(run => run.head_sha === testedMergeSha);
|
|
@@ -86303,25 +86736,27 @@ class PullRequestApprovalRepository {
|
|
|
86303
86736
|
if (!run || run.conclusion !== 'success' || run.status !== 'completed')
|
|
86304
86737
|
return undefined;
|
|
86305
86738
|
try {
|
|
86306
|
-
const artifacts = await this.allPages(this.octokit.rest.actions.listWorkflowRunArtifacts, {
|
|
86739
|
+
const artifacts = await this.allPages('coverage-artifacts', this.octokit.rest.actions.listWorkflowRunArtifacts, {
|
|
86307
86740
|
owner: target.owner, repo: target.repository, run_id: run.id,
|
|
86308
86741
|
});
|
|
86309
86742
|
const matches = artifacts.filter(artifact => artifact.name === 'copilot-diff-coverage-v1' && !artifact.expired);
|
|
86310
86743
|
if (matches.length !== 1 || matches[0].size_in_bytes > 64 * 1024)
|
|
86311
|
-
|
|
86312
|
-
const response = await this.octokit.rest.actions.downloadArtifact({
|
|
86744
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('coverage-artifacts', 'artifact-unavailable');
|
|
86745
|
+
const response = await (0, approval_evidence_read_1.readApprovalEvidence)('coverage-download', async () => this.octokit.rest.actions.downloadArtifact({
|
|
86313
86746
|
owner: target.owner, repo: target.repository, artifact_id: matches[0].id, archive_format: 'zip',
|
|
86314
|
-
});
|
|
86747
|
+
}));
|
|
86315
86748
|
const data = response.data;
|
|
86316
86749
|
const bytes = data instanceof ArrayBuffer ? new Uint8Array(data)
|
|
86317
86750
|
: data instanceof Uint8Array ? data
|
|
86318
86751
|
: typeof data === 'string' ? Buffer.from(data, 'binary') : undefined;
|
|
86319
86752
|
const attestation = bytes ? (0, approval_coverage_artifact_1.parseApprovalCoverageZip)(bytes) : undefined;
|
|
86320
|
-
if (!attestation
|
|
86753
|
+
if (!attestation)
|
|
86754
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('coverage-parse', 'artifact-invalid');
|
|
86755
|
+
if (attestation.repositoryId !== target.repositoryId
|
|
86321
86756
|
|| attestation.pullNumber !== target.pullNumber || attestation.headSha !== headSha
|
|
86322
86757
|
|| attestation.baseSha !== baseSha || attestation.workflowRunId !== run.id
|
|
86323
86758
|
|| attestation.workflowRunAttempt !== run.run_attempt)
|
|
86324
|
-
|
|
86759
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('coverage-parse', 'artifact-mismatch');
|
|
86325
86760
|
return {
|
|
86326
86761
|
coveredChangedLines: attestation.coveredChangedLines,
|
|
86327
86762
|
totalChangedLines: attestation.totalChangedLines,
|
|
@@ -86329,7 +86764,8 @@ class PullRequestApprovalRepository {
|
|
|
86329
86764
|
baseSha,
|
|
86330
86765
|
};
|
|
86331
86766
|
}
|
|
86332
|
-
catch {
|
|
86767
|
+
catch (cause) {
|
|
86768
|
+
collectDiagnostic(diagnostics, cause);
|
|
86333
86769
|
return undefined;
|
|
86334
86770
|
}
|
|
86335
86771
|
}
|
|
@@ -86355,7 +86791,7 @@ class PullRequestApprovalRepository {
|
|
|
86355
86791
|
throw new Error('PR head or base changed before assessment publication.');
|
|
86356
86792
|
}
|
|
86357
86793
|
const user = await this.octokit.rest.users.getAuthenticated();
|
|
86358
|
-
const comments = await this.allPages(this.octokit.rest.issues.listComments, {
|
|
86794
|
+
const comments = await this.allPages('comments', this.octokit.rest.issues.listComments, {
|
|
86359
86795
|
owner: target.owner, repo: target.repository, issue_number: target.pullNumber,
|
|
86360
86796
|
});
|
|
86361
86797
|
const card = [...comments].reverse().find(comment => comment.user?.id === user.data.id
|
|
@@ -86401,24 +86837,26 @@ class PullRequestApprovalRepository {
|
|
|
86401
86837
|
}
|
|
86402
86838
|
}
|
|
86403
86839
|
async readCurrentBaseSha(target, baseRef) {
|
|
86404
|
-
return (0, current_base_revision_query_1.readCurrentBaseRevision)(this.octokit.rest.git, target, baseRef);
|
|
86840
|
+
return (0, approval_evidence_read_1.readApprovalEvidence)('base-ref', () => (0, current_base_revision_query_1.readCurrentBaseRevision)(this.octokit.rest.git, target, baseRef));
|
|
86405
86841
|
}
|
|
86406
|
-
async effectiveRules(owner, repo, branch) {
|
|
86842
|
+
async effectiveRules(owner, repo, branch, diagnostics) {
|
|
86407
86843
|
try {
|
|
86408
|
-
const rulesResponse = await this.octokit.request('GET /repos/{owner}/{repo}/rules/branches/{branch}', { owner, repo, branch });
|
|
86844
|
+
const rulesResponse = await (0, approval_evidence_read_1.readApprovalEvidence)('rules', async () => this.octokit.request('GET /repos/{owner}/{repo}/rules/branches/{branch}', { owner, repo, branch }));
|
|
86409
86845
|
if (!Array.isArray(rulesResponse.data) || rulesResponse.data.some((rule) => !record(rule)
|
|
86410
86846
|
|| typeof record(rule)?.type !== 'string' || record(rule)?.type === '')) {
|
|
86411
|
-
throw
|
|
86847
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('rules', 'invalid-response');
|
|
86412
86848
|
}
|
|
86413
86849
|
const rules = rulesResponse.data;
|
|
86414
86850
|
let classic;
|
|
86415
86851
|
try {
|
|
86416
86852
|
const response = await this.octokit.rest.repos.getBranchProtection({ owner, repo, branch });
|
|
86853
|
+
if (!record(response.data))
|
|
86854
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)('classic-protection', 'invalid-response');
|
|
86417
86855
|
classic = response.data;
|
|
86418
86856
|
}
|
|
86419
86857
|
catch (error) {
|
|
86420
86858
|
if (statusOf(error) !== 404)
|
|
86421
|
-
throw error;
|
|
86859
|
+
await (0, approval_evidence_read_1.readApprovalEvidence)('classic-protection', async () => { throw error; });
|
|
86422
86860
|
}
|
|
86423
86861
|
const reviewRules = rules.filter(rule => rule.type === 'pull_request');
|
|
86424
86862
|
const classicReview = classic?.required_pull_request_reviews;
|
|
@@ -86444,23 +86882,26 @@ class PullRequestApprovalRepository {
|
|
|
86444
86882
|
}
|
|
86445
86883
|
return { readable: true, dismissesStaleReviews: hasStaleRule && allStale, requiredChecks: [...requiredChecks] };
|
|
86446
86884
|
}
|
|
86447
|
-
catch {
|
|
86885
|
+
catch (cause) {
|
|
86886
|
+
collectDiagnostic(diagnostics, cause);
|
|
86448
86887
|
return { readable: false, dismissesStaleReviews: false, requiredChecks: [] };
|
|
86449
86888
|
}
|
|
86450
86889
|
}
|
|
86451
|
-
async allPages(method, params) {
|
|
86452
|
-
|
|
86453
|
-
|
|
86454
|
-
const
|
|
86455
|
-
|
|
86456
|
-
|
|
86457
|
-
|
|
86458
|
-
|
|
86459
|
-
|
|
86460
|
-
|
|
86461
|
-
|
|
86462
|
-
|
|
86463
|
-
|
|
86890
|
+
async allPages(operation, method, params) {
|
|
86891
|
+
return (0, approval_evidence_read_1.readApprovalEvidence)(operation, async () => {
|
|
86892
|
+
const result = [];
|
|
86893
|
+
for await (const response of this.octokit.paginate.iterator(method, { ...params, per_page: 100 })) {
|
|
86894
|
+
const page = Array.isArray(response.data) ? response.data
|
|
86895
|
+
: record(response.data)?.check_runs ?? record(response.data)?.workflow_runs
|
|
86896
|
+
?? record(response.data)?.artifacts ?? record(response.data)?.jobs;
|
|
86897
|
+
if (!Array.isArray(page))
|
|
86898
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)(operation, 'invalid-page');
|
|
86899
|
+
result.push(...page);
|
|
86900
|
+
if (result.length > 3000)
|
|
86901
|
+
throw (0, approval_evidence_error_1.approvalEvidenceError)(operation, 'page-limit');
|
|
86902
|
+
}
|
|
86903
|
+
return result;
|
|
86904
|
+
});
|
|
86464
86905
|
}
|
|
86465
86906
|
}
|
|
86466
86907
|
exports.PullRequestApprovalRepository = PullRequestApprovalRepository;
|
|
@@ -86497,7 +86938,7 @@ function array(value) { return Array.isArray(value) ? value : []; }
|
|
|
86497
86938
|
async function readEffectiveApprovalPolicy(octokit, target) {
|
|
86498
86939
|
const admit = (source, value) => {
|
|
86499
86940
|
if (typeof value !== 'string' || value.length > 65536)
|
|
86500
|
-
throw new
|
|
86941
|
+
throw new application_error_1.ApplicationError('provider.contract-invalid', 'Approval policy response is malformed or unbounded.');
|
|
86501
86942
|
return { source, value };
|
|
86502
86943
|
};
|
|
86503
86944
|
try {
|
|
@@ -86521,6 +86962,14 @@ async function readEffectiveApprovalPolicy(octokit, target) {
|
|
|
86521
86962
|
throw error;
|
|
86522
86963
|
}
|
|
86523
86964
|
}
|
|
86965
|
+
function collectDiagnostic(diagnostics, cause) {
|
|
86966
|
+
if (cause instanceof application_error_1.ApplicationError && cause.recovery?.id === 'approval-evidence-read-failed') {
|
|
86967
|
+
diagnostics.push(cause.recovery.variables);
|
|
86968
|
+
}
|
|
86969
|
+
else {
|
|
86970
|
+
diagnostics.push((0, approval_evidence_error_1.approvalEvidenceError)('evidence', 'invalid-response').recovery.variables);
|
|
86971
|
+
}
|
|
86972
|
+
}
|
|
86524
86973
|
|
|
86525
86974
|
|
|
86526
86975
|
/***/ }),
|
|
@@ -88761,6 +89210,44 @@ class AgentResponseLengthFailure extends Error {
|
|
|
88761
89210
|
exports.AgentResponseLengthFailure = AgentResponseLengthFailure;
|
|
88762
89211
|
|
|
88763
89212
|
|
|
89213
|
+
/***/ }),
|
|
89214
|
+
|
|
89215
|
+
/***/ 98205:
|
|
89216
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
89217
|
+
|
|
89218
|
+
"use strict";
|
|
89219
|
+
|
|
89220
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
89221
|
+
exports.APPROVAL_EVIDENCE_REASONS = exports.APPROVAL_EVIDENCE_PERMISSIONS = void 0;
|
|
89222
|
+
/** Closed vocabulary: no provider text, URLs, headers, policy values or credentials. */
|
|
89223
|
+
exports.APPROVAL_EVIDENCE_PERMISSIONS = Object.freeze({
|
|
89224
|
+
'evidence': 'repository-read',
|
|
89225
|
+
'pull-request': 'pull-requests-read',
|
|
89226
|
+
'base-ref': 'contents-read',
|
|
89227
|
+
'merge-commit': 'contents-read',
|
|
89228
|
+
'policy': 'actions-variables-read',
|
|
89229
|
+
'files': 'pull-requests-read',
|
|
89230
|
+
'reviews': 'pull-requests-read',
|
|
89231
|
+
'comments': 'issues-read',
|
|
89232
|
+
'head-checks': 'checks-read',
|
|
89233
|
+
'merge-checks': 'checks-read',
|
|
89234
|
+
'head-runs': 'actions-read',
|
|
89235
|
+
'merge-runs': 'actions-read',
|
|
89236
|
+
'jobs': 'actions-read',
|
|
89237
|
+
'rules': 'metadata-read',
|
|
89238
|
+
'classic-protection': 'administration-read',
|
|
89239
|
+
'authenticated-user': 'authenticated-user-read',
|
|
89240
|
+
'coverage-artifacts': 'actions-read',
|
|
89241
|
+
'coverage-download': 'actions-read',
|
|
89242
|
+
'coverage-parse': 'actions-read',
|
|
89243
|
+
});
|
|
89244
|
+
exports.APPROVAL_EVIDENCE_REASONS = Object.freeze([
|
|
89245
|
+
'http-400', 'http-401', 'http-403', 'http-404', 'http-409', 'http-422', 'http-429',
|
|
89246
|
+
'http-500', 'http-502', 'http-503', 'http-504', 'transport-unavailable',
|
|
89247
|
+
'invalid-response', 'invalid-page', 'page-limit', 'artifact-unavailable', 'artifact-invalid', 'artifact-mismatch',
|
|
89248
|
+
]);
|
|
89249
|
+
|
|
89250
|
+
|
|
88764
89251
|
/***/ }),
|
|
88765
89252
|
|
|
88766
89253
|
/***/ 51114:
|
|
@@ -89389,6 +89876,25 @@ function isNewerCliVersion(installedVersion, publishedVersion) {
|
|
|
89389
89876
|
}
|
|
89390
89877
|
|
|
89391
89878
|
|
|
89879
|
+
/***/ }),
|
|
89880
|
+
|
|
89881
|
+
/***/ 21565:
|
|
89882
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
89883
|
+
|
|
89884
|
+
"use strict";
|
|
89885
|
+
|
|
89886
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
89887
|
+
exports.CLOSED_ISSUE_REASONS = exports.CLOSED_ISSUE_PHASES = exports.CLOSED_ISSUE_RESULTS = void 0;
|
|
89888
|
+
exports.CLOSED_ISSUE_RESULTS = Object.freeze([
|
|
89889
|
+
'ReconcileClosedIssueMetadataUseCase', 'CloseIssueAfterMergingUseCase', 'RetireBranchSyncUseCase', 'RetireProgressUseCase',
|
|
89890
|
+
]);
|
|
89891
|
+
exports.CLOSED_ISSUE_PHASES = Object.freeze([
|
|
89892
|
+
'identity', 'read', 'native-fence', 'label-remove', 'label-add', 'metadata-verification',
|
|
89893
|
+
'card-inventory', 'card-freshness', 'card-update', 'card-verification',
|
|
89894
|
+
]);
|
|
89895
|
+
exports.CLOSED_ISSUE_REASONS = Object.freeze(['completed', 'not_planned', 'duplicate', 'reopened', 'unknown', 'unavailable']);
|
|
89896
|
+
|
|
89897
|
+
|
|
89392
89898
|
/***/ }),
|
|
89393
89899
|
|
|
89394
89900
|
/***/ 77454:
|
|
@@ -96391,6 +96897,7 @@ const exec = __importStar(__nccwpck_require__(18538));
|
|
|
96391
96897
|
const git_authentication_environment_1 = __nccwpck_require__(16535);
|
|
96392
96898
|
const untrusted_command_environment_1 = __nccwpck_require__(2304);
|
|
96393
96899
|
const git_hook_isolation_1 = __nccwpck_require__(39764);
|
|
96900
|
+
const verification_runtime_preflight_1 = __nccwpck_require__(23100);
|
|
96394
96901
|
class GitCommitAdapter {
|
|
96395
96902
|
constructor(executeCommand = (program, args, options) => options
|
|
96396
96903
|
? exec.exec(program, args, {
|
|
@@ -96400,16 +96907,21 @@ class GitCommitAdapter {
|
|
|
96400
96907
|
...(options.stdout ? { listeners: { stdout: options.stdout } } : {}),
|
|
96401
96908
|
...(options.env ? { env: options.env } : {}),
|
|
96402
96909
|
})
|
|
96403
|
-
: exec.exec(program, args)) {
|
|
96910
|
+
: exec.exec(program, args), checkPrerequisites = verification_runtime_preflight_1.assertVerificationRuntimePrerequisites) {
|
|
96404
96911
|
this.executeCommand = executeCommand;
|
|
96912
|
+
this.checkPrerequisites = checkPrerequisites;
|
|
96405
96913
|
}
|
|
96406
96914
|
async execute(program, args, options) {
|
|
96915
|
+
if (options?.verifyRuntimePrerequisites && !options.untrusted)
|
|
96916
|
+
throw new Error('Runtime preflight requires credential-free verification.');
|
|
96407
96917
|
if (!options?.untrusted)
|
|
96408
96918
|
return options ? this.executeCommand(program, args, options) : this.executeCommand(program, args);
|
|
96409
96919
|
if (options.env)
|
|
96410
96920
|
throw new Error('Untrusted command execution does not accept a caller-supplied environment.');
|
|
96411
96921
|
const runtime = (0, untrusted_command_environment_1.prepareUntrustedCommandEnvironment)();
|
|
96412
96922
|
try {
|
|
96923
|
+
if (options.verifyRuntimePrerequisites)
|
|
96924
|
+
this.checkPrerequisites(runtime.environment);
|
|
96413
96925
|
return await this.executeCommand(program, args, {
|
|
96414
96926
|
...(options.stdout ? { stdout: options.stdout } : {}),
|
|
96415
96927
|
env: runtime.environment,
|
|
@@ -101890,6 +102402,7 @@ const node_path_1 = __nccwpck_require__(49411);
|
|
|
101890
102402
|
const agent_private_install_root_1 = __nccwpck_require__(44640);
|
|
101891
102403
|
const ALLOWED_VARIABLES = [
|
|
101892
102404
|
'PATH',
|
|
102405
|
+
'JAVA_HOME',
|
|
101893
102406
|
'LANG',
|
|
101894
102407
|
'LANGUAGE',
|
|
101895
102408
|
'LC_ALL',
|
|
@@ -101949,6 +102462,132 @@ function prepareUntrustedCommandEnvironment(source = process.env, platform = pro
|
|
|
101949
102462
|
}
|
|
101950
102463
|
|
|
101951
102464
|
|
|
102465
|
+
/***/ }),
|
|
102466
|
+
|
|
102467
|
+
/***/ 91053:
|
|
102468
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
102469
|
+
|
|
102470
|
+
"use strict";
|
|
102471
|
+
|
|
102472
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
102473
|
+
exports.readVerificationRuntimeManifest = readVerificationRuntimeManifest;
|
|
102474
|
+
const node_fs_1 = __nccwpck_require__(87561);
|
|
102475
|
+
const node_path_1 = __nccwpck_require__(49411);
|
|
102476
|
+
const verification_runtime_policy_1 = __nccwpck_require__(89347);
|
|
102477
|
+
const MAX_MANIFEST_BYTES = 16 * 1024;
|
|
102478
|
+
function readVerificationRuntimeManifest(root) {
|
|
102479
|
+
const path = (0, node_path_1.resolve)(root, verification_runtime_policy_1.VERIFICATION_RUNTIME_MANIFEST);
|
|
102480
|
+
let descriptor;
|
|
102481
|
+
try {
|
|
102482
|
+
let directory;
|
|
102483
|
+
try {
|
|
102484
|
+
directory = (0, node_fs_1.lstatSync)((0, node_path_1.join)(root, '.copilot'));
|
|
102485
|
+
}
|
|
102486
|
+
catch (error) {
|
|
102487
|
+
if (error.code === 'ENOENT')
|
|
102488
|
+
return [];
|
|
102489
|
+
throw error;
|
|
102490
|
+
}
|
|
102491
|
+
if (!directory.isDirectory() || directory.isSymbolicLink()
|
|
102492
|
+
|| (0, node_fs_1.realpathSync)((0, node_path_1.join)(root, '.copilot')) !== (0, node_path_1.join)((0, node_fs_1.realpathSync)(root), '.copilot'))
|
|
102493
|
+
throw new Error('Unsafe manifest parent');
|
|
102494
|
+
let entry;
|
|
102495
|
+
try {
|
|
102496
|
+
entry = (0, node_fs_1.lstatSync)(path, { bigint: true });
|
|
102497
|
+
}
|
|
102498
|
+
catch (error) {
|
|
102499
|
+
if (error.code === 'ENOENT')
|
|
102500
|
+
return [];
|
|
102501
|
+
throw error;
|
|
102502
|
+
}
|
|
102503
|
+
if (!entry.isFile() || entry.isSymbolicLink() || entry.nlink !== 1n || entry.size > BigInt(MAX_MANIFEST_BYTES))
|
|
102504
|
+
throw new Error('Unsafe manifest');
|
|
102505
|
+
descriptor = (0, node_fs_1.openSync)(path, node_fs_1.constants.O_RDONLY | (node_fs_1.constants.O_NOFOLLOW ?? 0));
|
|
102506
|
+
const opened = (0, node_fs_1.fstatSync)(descriptor, { bigint: true });
|
|
102507
|
+
if (!opened.isFile() || opened.nlink !== 1n || opened.dev !== entry.dev || opened.ino !== entry.ino
|
|
102508
|
+
|| opened.size > BigInt(MAX_MANIFEST_BYTES))
|
|
102509
|
+
throw new Error('Manifest changed');
|
|
102510
|
+
const bytes = Buffer.alloc(MAX_MANIFEST_BYTES + 1);
|
|
102511
|
+
const size = (0, node_fs_1.readSync)(descriptor, bytes, 0, bytes.length, 0);
|
|
102512
|
+
if (size > MAX_MANIFEST_BYTES)
|
|
102513
|
+
throw new Error('Oversized manifest');
|
|
102514
|
+
return (0, verification_runtime_policy_1.parseVerificationRuntimeManifest)(JSON.parse(bytes.subarray(0, size).toString('utf8')));
|
|
102515
|
+
}
|
|
102516
|
+
catch {
|
|
102517
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('manifest-invalid');
|
|
102518
|
+
}
|
|
102519
|
+
finally {
|
|
102520
|
+
if (descriptor !== undefined)
|
|
102521
|
+
(0, node_fs_1.closeSync)(descriptor);
|
|
102522
|
+
}
|
|
102523
|
+
}
|
|
102524
|
+
|
|
102525
|
+
|
|
102526
|
+
/***/ }),
|
|
102527
|
+
|
|
102528
|
+
/***/ 23100:
|
|
102529
|
+
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
102530
|
+
|
|
102531
|
+
"use strict";
|
|
102532
|
+
|
|
102533
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
102534
|
+
exports.assertVerificationRuntimePrerequisites = assertVerificationRuntimePrerequisites;
|
|
102535
|
+
const node_child_process_1 = __nccwpck_require__(17718);
|
|
102536
|
+
const node_path_1 = __nccwpck_require__(49411);
|
|
102537
|
+
const verification_runtime_manifest_1 = __nccwpck_require__(91053);
|
|
102538
|
+
const verification_runtime_policy_1 = __nccwpck_require__(89347);
|
|
102539
|
+
const probe = (program, args, environment) => {
|
|
102540
|
+
const result = (0, node_child_process_1.spawnSync)(program, [...args], { env: environment, encoding: 'utf8', shell: false,
|
|
102541
|
+
windowsHide: true, timeout: 5000, maxBuffer: 8192, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
102542
|
+
return { status: result.status, output: `${result.stdout ?? ''}\n${result.stderr ?? ''}`, failed: !!result.error };
|
|
102543
|
+
};
|
|
102544
|
+
const hasControlCharacter = (value) => [...value].some(character => character.charCodeAt(0) < 32);
|
|
102545
|
+
/** Fixed version probes only; never installs a runtime or executes a repository-provided bootstrap. */
|
|
102546
|
+
function assertVerificationRuntimePrerequisites(environment, root = process.cwd(), run = probe, platform = process.platform, job = process.env.GITHUB_JOB) {
|
|
102547
|
+
for (const requirement of (0, verification_runtime_manifest_1.readVerificationRuntimeManifest)(root)) {
|
|
102548
|
+
checkRuntime(requirement, environment, run, platform, job);
|
|
102549
|
+
}
|
|
102550
|
+
}
|
|
102551
|
+
function checkRuntime(requirement, environment, run, platform, job) {
|
|
102552
|
+
const spec = verification_runtime_policy_1.VERIFICATION_RUNTIME_SPECS[requirement.runtime];
|
|
102553
|
+
let program = spec.program;
|
|
102554
|
+
let args = spec.args;
|
|
102555
|
+
if (requirement.runtime === 'java' && environment.JAVA_HOME) {
|
|
102556
|
+
const paths = platform === 'win32' ? node_path_1.win32 : node_path_1.posix;
|
|
102557
|
+
if (!paths.isAbsolute(environment.JAVA_HOME) || hasControlCharacter(environment.JAVA_HOME)) {
|
|
102558
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unavailable', requirement, undefined, job);
|
|
102559
|
+
}
|
|
102560
|
+
program = paths.join(environment.JAVA_HOME, 'bin', platform === 'win32' ? 'java.exe' : 'java');
|
|
102561
|
+
}
|
|
102562
|
+
else if (requirement.runtime === 'python' && platform === 'win32')
|
|
102563
|
+
program = 'python';
|
|
102564
|
+
else if (requirement.runtime === 'pnpm' && platform === 'win32') {
|
|
102565
|
+
const systemRoot = environment.SystemRoot;
|
|
102566
|
+
if (!systemRoot || !node_path_1.win32.isAbsolute(systemRoot) || hasControlCharacter(systemRoot)) {
|
|
102567
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unavailable', requirement, undefined, job);
|
|
102568
|
+
}
|
|
102569
|
+
program = node_path_1.win32.join(systemRoot, 'System32', 'cmd.exe');
|
|
102570
|
+
args = ['/d', '/s', '/c', 'pnpm --version'];
|
|
102571
|
+
}
|
|
102572
|
+
let result;
|
|
102573
|
+
try {
|
|
102574
|
+
result = run(program, args, environment);
|
|
102575
|
+
}
|
|
102576
|
+
catch {
|
|
102577
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unavailable', requirement, undefined, job);
|
|
102578
|
+
}
|
|
102579
|
+
if (result.failed || result.status !== 0 || result.output.length > 8192) {
|
|
102580
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unavailable', requirement, undefined, job);
|
|
102581
|
+
}
|
|
102582
|
+
const observed = (0, verification_runtime_policy_1.verificationRuntimeVersion)(requirement.runtime, result.output);
|
|
102583
|
+
if (!observed)
|
|
102584
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('unreadable-version', requirement, undefined, job);
|
|
102585
|
+
if (!(0, verification_runtime_policy_1.verificationRuntimeMatches)(requirement.version, observed)) {
|
|
102586
|
+
throw new verification_runtime_policy_1.VerificationPrerequisiteError('version-mismatch', requirement, observed, job);
|
|
102587
|
+
}
|
|
102588
|
+
}
|
|
102589
|
+
|
|
102590
|
+
|
|
101952
102591
|
/***/ }),
|
|
101953
102592
|
|
|
101954
102593
|
/***/ 92540:
|