Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions build/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7050,6 +7050,7 @@ const progress_partition_length_failure_1 = __nccwpck_require__(9292);
const progress_binary_evidence_diagnostic_1 = __nccwpck_require__(364);
const issue_workflow_diagnostic_1 = __nccwpck_require__(4347);
const change_size_reconciliation_1 = __nccwpck_require__(5304);
const issue_assignment_diagnostic_1 = __nccwpck_require__(2616);
const copilot_command_validation_1 = __nccwpck_require__(4237);
const closed_issue_reconciliation_1 = __nccwpck_require__(1565);
const approval_evidence_diagnostic_1 = __nccwpck_require__(8205);
Expand Down Expand Up @@ -7088,6 +7089,8 @@ exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([
'closed-issue-reconciliation-failed',
'approval-evidence-read-failed',
'change-size-reconciliation-failed',
'issue-assignment-failed',
'issue-assignment-count-invalid',
'issue-workflow-admission-blocked',
'progress-binary-evidence-unavailable',
'progress-inventory-incomplete',
Expand Down Expand Up @@ -7270,9 +7273,13 @@ class ApplicationError extends Error {
this.action = metadata.action;
this.retainedState = options.recovery?.id === 'change-size-reconciliation-failed'
? 'Completed effects were retained; the failed and later size operations remain unverified.'
: options.recovery?.id === 'deployment-publication-context-missing'
? PRESERVED_STATE
: metadata.retainedState;
: options.recovery?.id === 'issue-assignment-failed'
? 'Verified assignments and independently completed effects were retained; the failed assignment operation remains unverified.'
: options.recovery?.id === 'issue-assignment-count-invalid'
? 'No assignment operation was attempted; independently completed lifecycle effects were retained.'
: options.recovery?.id === 'deployment-publication-context-missing'
? PRESERVED_STATE
: metadata.retainedState;
this.correlationId = correlationId;
this.recovery = normalizeApplicationErrorRecovery(options.recovery);
__classPrivateFieldSet(this, _ApplicationError_cause, options.cause, "f");
Expand Down Expand Up @@ -7315,6 +7322,8 @@ const RECOVERY_VARIABLE_KEYS = Object.freeze({
'approval-evidence-read-failed': Object.freeze(['operation', 'reason', 'permission']),
'issue-workflow-admission-blocked': Object.freeze(['kind', 'reason', 'fields']),
'change-size-reconciliation-failed': Object.freeze(['operation', 'issueNumber', 'targetNumber', 'projectIndex', 'verifiedOperations', 'pendingProjectSizes', 'providerStatus', 'providerReference']),
'issue-assignment-failed': Object.freeze(['targetNumber', 'desiredCount', 'stage', 'operation', 'providerStatus', 'assigneeRead', 'observedAssignees', 'confirmedAssignments', 'remainingAssignments', 'mutation']),
'issue-assignment-count-invalid': Object.freeze([]),
'pull-request-link-restored': Object.freeze([]),
'pull-request-link-base-retained': Object.freeze([]),
'pull-request-link-reference-retained': Object.freeze([]),
Expand Down Expand Up @@ -7455,6 +7464,9 @@ function normalizeApplicationErrorRecovery(recovery) {
if (recovery.id === 'change-size-reconciliation-failed' && !(0, change_size_reconciliation_1.isChangeSizeReconciliationFacts)(variables)) {
throw new TypeError('Change size reconciliation diagnostic is invalid.');
}
if (recovery.id === 'issue-assignment-failed' && !(0, issue_assignment_diagnostic_1.isIssueAssignmentDiagnostic)(variables)) {
throw new TypeError('Issue assignment diagnostic is invalid.');
}
return Object.freeze({
id: recovery.id,
variables: Object.freeze({ ...variables }),
Expand Down Expand Up @@ -8586,6 +8598,43 @@ function githubUsersMatch(left, right) {
}


/***/ }),

/***/ 2616:
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ASSIGNMENT_OPERATIONS = exports.ASSIGNMENT_STAGES = void 0;
exports.isAssignmentProviderStatus = isAssignmentProviderStatus;
exports.isIssueAssignmentDiagnostic = isIssueAssignmentDiagnostic;
exports.ASSIGNMENT_STAGES = Object.freeze(['read-assignees', 'lookup-members', 'select-members', 'assign-creator', 'assign-members']);
exports.ASSIGNMENT_OPERATIONS = Object.freeze(['read-assignees', 'list-teams', 'list-team-members', 'add-assignees', 'initialize-client', 'unavailable']);
function isAssignmentProviderStatus(value) {
return typeof value === 'string' && (value === 'http-unavailable' || /^http-[1-5][0-9]{2}$/u.test(value));
}
function isIssueAssignmentDiagnostic(value) {
return Number.isSafeInteger(value.targetNumber) && Number(value.targetNumber) > 0
&& Number.isInteger(value.desiredCount) && Number(value.desiredCount) >= 1 && Number(value.desiredCount) <= 10
&& exports.ASSIGNMENT_STAGES.includes(value.stage)
&& exports.ASSIGNMENT_OPERATIONS.includes(value.operation)
&& isAssignmentProviderStatus(value.providerStatus)
&& ['verified', 'unavailable'].includes(value.assigneeRead)
&& ['not-attempted', 'unverified', 'verified'].includes(value.mutation)
&& validCount(value.confirmedAssignments) && Number(value.confirmedAssignments) <= Number(value.desiredCount)
&& (value.mutation !== 'not-attempted' || value.confirmedAssignments === 0)
&& (value.mutation !== 'verified' || Number(value.confirmedAssignments) > 0)
&& (value.assigneeRead === 'unavailable'
? value.observedAssignees === 'unavailable' && value.remainingAssignments === 'unavailable'
&& value.confirmedAssignments === 0 && value.mutation === 'not-attempted' && value.stage === 'read-assignees'
: validCount(value.observedAssignees) && validCount(value.remainingAssignments)
&& value.remainingAssignments === Math.max(0, Number(value.desiredCount) - Number(value.observedAssignees) - Number(value.confirmedAssignments)));
}
function validCount(value) {
return Number.isInteger(value) && Number(value) >= 0 && Number(value) <= 10;
}


/***/ }),

/***/ 9376:
Expand Down
5 changes: 4 additions & 1 deletion build/api/src/data/model/application_error.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { type ProgressPartitionLengthDiagnostic } from '../../domain/progress_pa
import { type ProgressBinaryEvidenceFacts } from '../../domain/progress_binary_evidence_diagnostic';
import { type IssueWorkflowDiagnosticFacts } from '../../domain/issue_workflow_diagnostic';
import { type ChangeSizeReconciliationFacts } from '../../domain/change_size_reconciliation';
import { type IssueAssignmentDiagnostic } from '../../domain/issue_assignment_diagnostic';
import { type CopilotCommandValidationReason } from '../../domain/copilot_command_validation';
import type { CopilotCommandName } from '../../domain/copilot_command';
import { type ClosedIssueReconciliationFacts } from '../../domain/closed_issue_reconciliation';
Expand All @@ -18,7 +19,7 @@ import { type BranchSyncCatalogDiagnostic } from '../../domain/branch_sync_catal
import { type SddSourceContextDiagnostic } from '../../domain/agent_source_snapshot';
export type ApplicationErrorKind = 'configuration' | 'authorization' | 'provider' | 'agent' | 'validation' | 'workflow' | 'unknown';
export type ApplicationErrorCode = 'configuration.invalid' | 'configuration.unsupported' | 'authorization.denied' | 'authorization.credential-invalid' | 'provider.not-found' | 'provider.conflict' | 'provider.rate-limited' | 'provider.unavailable' | 'provider.contract-invalid' | 'agent.policy-rejected' | 'agent.failed' | 'locale.output-invalid' | 'locale.translation-failed' | 'validation.invalid-input' | 'validation.evidence-too-large' | 'validation.evidence-unavailable' | 'workflow.invalid-event' | 'workflow.stale' | 'workflow.cancelled' | 'workflow.failed' | 'workflow.presentation-pending' | 'timeout' | 'unexpected';
export declare const APPLICATION_ERROR_RECOVERY_IDS: readonly ["comment-command-length", "comment-command-name-missing", "comment-command-name-unknown", "comment-command-argument-count", "comment-command-arguments-unexpected", "comment-command-arguments-missing", "comment-command-finding-quoting", "comment-command-review-format", "comment-command-review-effort", "comment-command-review-boolean", "comment-command-review-option", "comment-command-sync-option", "comment-command-sync-parent", "pull-request-link-restored", "pull-request-link-base-retained", "pull-request-link-reference-retained", "pull-request-link-base-and-reference-retained", "managed-branch-enrichment-failed", "inactivity-explanation-failed", "bugbot-review-blocks-pending", "branch-sync-agent-disabled", "branch-sync-fixer-unavailable", "branch-sync-resolution-invalid", "branch-sync-verification-failed", "branch-sync-catalog-incompatible", "branch-sync-workflow-write-required", "branch-sync-publication-failed", "sdd-draft-size-exceeded", "sdd-catalog-unsupported-profile", "sdd-catalog-format-invalid", "sdd-catalog-missing-trusted-source", "sdd-source-context-unavailable", "sdd-draft-format-invalid", "sdd-draft-case-identity-invalid", "sdd-draft-case-budget-invalid", "sdd-draft-requirement-mapping-invalid", "sdd-draft-repository-path-invalid", "deployment-publication-context-missing", "workspace-changes-rejected", "closed-issue-reconciliation-failed", "approval-evidence-read-failed", "change-size-reconciliation-failed", "issue-workflow-admission-blocked", "progress-binary-evidence-unavailable", "progress-inventory-incomplete", "bugbot-review-incomplete", "progress-result-contract-invalid", "progress-partition-length-invalid", "progress-assessment-capacity-exceeded", "progress-scope-clause-limit", "progress-completion-recovery-exhausted", "stored-configuration-schema-missing", "stored-configuration-schema-unsupported", "stored-configuration-invalid"];
export declare const APPLICATION_ERROR_RECOVERY_IDS: readonly ["comment-command-length", "comment-command-name-missing", "comment-command-name-unknown", "comment-command-argument-count", "comment-command-arguments-unexpected", "comment-command-arguments-missing", "comment-command-finding-quoting", "comment-command-review-format", "comment-command-review-effort", "comment-command-review-boolean", "comment-command-review-option", "comment-command-sync-option", "comment-command-sync-parent", "pull-request-link-restored", "pull-request-link-base-retained", "pull-request-link-reference-retained", "pull-request-link-base-and-reference-retained", "managed-branch-enrichment-failed", "inactivity-explanation-failed", "bugbot-review-blocks-pending", "branch-sync-agent-disabled", "branch-sync-fixer-unavailable", "branch-sync-resolution-invalid", "branch-sync-verification-failed", "branch-sync-catalog-incompatible", "branch-sync-workflow-write-required", "branch-sync-publication-failed", "sdd-draft-size-exceeded", "sdd-catalog-unsupported-profile", "sdd-catalog-format-invalid", "sdd-catalog-missing-trusted-source", "sdd-source-context-unavailable", "sdd-draft-format-invalid", "sdd-draft-case-identity-invalid", "sdd-draft-case-budget-invalid", "sdd-draft-requirement-mapping-invalid", "sdd-draft-repository-path-invalid", "deployment-publication-context-missing", "workspace-changes-rejected", "closed-issue-reconciliation-failed", "approval-evidence-read-failed", "change-size-reconciliation-failed", "issue-assignment-failed", "issue-assignment-count-invalid", "issue-workflow-admission-blocked", "progress-binary-evidence-unavailable", "progress-inventory-incomplete", "bugbot-review-incomplete", "progress-result-contract-invalid", "progress-partition-length-invalid", "progress-assessment-capacity-exceeded", "progress-scope-clause-limit", "progress-completion-recovery-exhausted", "stored-configuration-schema-missing", "stored-configuration-schema-unsupported", "stored-configuration-invalid"];
export type ApplicationErrorRecoveryId = typeof APPLICATION_ERROR_RECOVERY_IDS[number];
interface ApplicationErrorRecoveryVariables extends Readonly<Record<CopilotCommandValidationReason, Readonly<{
command: CopilotCommandName;
Expand All @@ -39,6 +40,8 @@ interface ApplicationErrorRecoveryVariables extends Readonly<Record<CopilotComma
readonly 'closed-issue-reconciliation-failed': ClosedIssueReconciliationFacts;
readonly 'approval-evidence-read-failed': ApprovalEvidenceDiagnostic;
readonly 'change-size-reconciliation-failed': ChangeSizeReconciliationFacts;
readonly 'issue-assignment-failed': IssueAssignmentDiagnostic;
readonly 'issue-assignment-count-invalid': Readonly<Record<string, never>>;
readonly 'issue-workflow-admission-blocked': IssueWorkflowDiagnosticFacts;
readonly 'progress-binary-evidence-unavailable': ProgressBinaryEvidenceFacts;
readonly 'progress-inventory-incomplete': ProgressInventoryDiagnostic;
Expand Down
19 changes: 19 additions & 0 deletions build/api/src/domain/issue_assignment_diagnostic.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export declare const ASSIGNMENT_STAGES: readonly ["read-assignees", "lookup-members", "select-members", "assign-creator", "assign-members"];
export declare const ASSIGNMENT_OPERATIONS: readonly ["read-assignees", "list-teams", "list-team-members", "add-assignees", "initialize-client", "unavailable"];
export type AssignmentStage = typeof ASSIGNMENT_STAGES[number];
export type AssignmentOperation = typeof ASSIGNMENT_OPERATIONS[number];
/** Counts describe only this assignment attempt; other lifecycle results remain independent. */
export interface IssueAssignmentDiagnostic {
readonly targetNumber: number;
readonly desiredCount: number;
readonly stage: AssignmentStage;
readonly operation: AssignmentOperation;
readonly providerStatus: string;
readonly assigneeRead: 'verified' | 'unavailable';
readonly observedAssignees: number | 'unavailable';
readonly confirmedAssignments: number;
readonly remainingAssignments: number | 'unavailable';
readonly mutation: 'not-attempted' | 'unverified' | 'verified';
}
export declare function isAssignmentProviderStatus(value: unknown): value is string;
export declare function isIssueAssignmentDiagnostic(value: Readonly<Record<string, unknown>>): boolean;
Loading
Loading