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
29 changes: 29 additions & 0 deletions build/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5152,6 +5152,7 @@ var _ApplicationError_cause;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.ApplicationError = exports.APPLICATION_ERROR_METADATA = exports.APPLICATION_ERROR_RECOVERY_IDS = void 0;
exports.isApplicationErrorCorrelationId = isApplicationErrorCorrelationId;
const closed_issue_reconciliation_1 = __nccwpck_require__(1565);
const approval_evidence_diagnostic_1 = __nccwpck_require__(8205);
const branch_sync_validation_1 = __nccwpck_require__(981);
exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([
Expand All @@ -5168,6 +5169,7 @@ exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([
'sdd-draft-size-exceeded',
'sdd-draft-format-invalid',
'workspace-changes-rejected',
'closed-issue-reconciliation-failed',
'approval-evidence-read-failed',
]);
const PRESERVED_STATE = 'Existing persisted state and completed external effects were preserved.';
Expand Down Expand Up @@ -5360,6 +5362,7 @@ class ApplicationError extends Error {
exports.ApplicationError = ApplicationError;
_ApplicationError_cause = new WeakMap();
const RECOVERY_VARIABLE_KEYS = Object.freeze({
'closed-issue-reconciliation-failed': Object.freeze(['resultId', 'phase', 'state', 'reason', 'changed', 'remaining']),
'approval-evidence-read-failed': Object.freeze(['operation', 'reason', 'permission']),
'pull-request-link-restored': Object.freeze([]),
'pull-request-link-base-retained': Object.freeze([]),
Expand Down Expand Up @@ -5413,6 +5416,14 @@ function normalizeApplicationErrorRecovery(recovery) {
&& !branch_sync_validation_1.BRANCH_SYNC_VALIDATION_CODES.some(code => code === variables.validationCode)) {
throw new TypeError('Application error recovery synchronization validation code is invalid.');
}
if (recovery.id === 'closed-issue-reconciliation-failed'
&& (!closed_issue_reconciliation_1.CLOSED_ISSUE_RESULTS.some(value => value === variables.resultId)
|| !closed_issue_reconciliation_1.CLOSED_ISSUE_PHASES.some(value => value === variables.phase)
|| !['open', 'closed', 'unavailable'].includes(variables.state)
|| !closed_issue_reconciliation_1.CLOSED_ISSUE_REASONS.some(value => value === variables.reason)
|| ![variables.changed, variables.remaining].every(value => typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 && value <= 3000))) {
throw new TypeError('Closed issue reconciliation diagnostic is invalid.');
}
if (recovery.id === 'approval-evidence-read-failed'
&& (!Object.prototype.hasOwnProperty.call(approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_PERMISSIONS, variables.operation)
|| !approval_evidence_diagnostic_1.APPROVAL_EVIDENCE_REASONS.some(reason => reason === variables.reason)
Expand Down Expand Up @@ -5959,6 +5970,24 @@ function countActionableBugbotFindings(counts) {
}


/***/ }),

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


Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CLOSED_ISSUE_REASONS = exports.CLOSED_ISSUE_PHASES = exports.CLOSED_ISSUE_RESULTS = void 0;
exports.CLOSED_ISSUE_RESULTS = Object.freeze([
'ReconcileClosedIssueMetadataUseCase', 'CloseIssueAfterMergingUseCase', 'RetireBranchSyncUseCase', 'RetireProgressUseCase',
]);
exports.CLOSED_ISSUE_PHASES = Object.freeze([
'identity', 'read', 'native-fence', 'label-remove', 'label-add', 'metadata-verification',
'card-inventory', 'card-freshness', 'card-update', 'card-verification',
]);
exports.CLOSED_ISSUE_REASONS = Object.freeze(['completed', 'not_planned', 'duplicate', 'reopened', 'unknown', 'unavailable']);


/***/ }),

/***/ 8623:
Expand Down
4 changes: 3 additions & 1 deletion build/api/src/data/model/application_error.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { type ClosedIssueReconciliationFacts } from '../../domain/closed_issue_reconciliation';
import { type ApprovalEvidenceDiagnostic } from '../../domain/approval_evidence_diagnostic';
import { type BranchSyncValidationCode } from '../../domain/branch_sync_validation';
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 ["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", "sdd-draft-size-exceeded", "sdd-draft-format-invalid", "workspace-changes-rejected", "approval-evidence-read-failed"];
export declare const APPLICATION_ERROR_RECOVERY_IDS: readonly ["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", "sdd-draft-size-exceeded", "sdd-draft-format-invalid", "workspace-changes-rejected", "closed-issue-reconciliation-failed", "approval-evidence-read-failed"];
export type ApplicationErrorRecoveryId = typeof APPLICATION_ERROR_RECOVERY_IDS[number];
interface ApplicationErrorRecoveryVariables {
readonly 'closed-issue-reconciliation-failed': ClosedIssueReconciliationFacts;
readonly 'approval-evidence-read-failed': ApprovalEvidenceDiagnostic;
readonly 'pull-request-link-restored': Readonly<Record<string, never>>;
readonly 'pull-request-link-base-retained': Readonly<Record<string, never>>;
Expand Down
11 changes: 11 additions & 0 deletions build/api/src/domain/closed_issue_reconciliation.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export declare const CLOSED_ISSUE_RESULTS: readonly ["ReconcileClosedIssueMetadataUseCase", "CloseIssueAfterMergingUseCase", "RetireBranchSyncUseCase", "RetireProgressUseCase"];
export declare const CLOSED_ISSUE_PHASES: readonly ["identity", "read", "native-fence", "label-remove", "label-add", "metadata-verification", "card-inventory", "card-freshness", "card-update", "card-verification"];
export declare const CLOSED_ISSUE_REASONS: readonly ["completed", "not_planned", "duplicate", "reopened", "unknown", "unavailable"];
export type ClosedIssueReconciliationFacts = {
readonly resultId: typeof CLOSED_ISSUE_RESULTS[number];
readonly phase: typeof CLOSED_ISSUE_PHASES[number];
readonly state: 'open' | 'closed' | 'unavailable';
readonly reason: typeof CLOSED_ISSUE_REASONS[number];
readonly changed: number;
readonly remaining: number;
};
Loading
Loading