edsger 0.10.1 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -110,7 +110,7 @@ export async function checkApprovalBeforePhaseExecution(featureId, verbose = fal
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
|
-
* Create an approval request
|
|
113
|
+
* Create an approval request (emails are sent automatically by the MCP handler)
|
|
114
114
|
* This is for the CURRENT status, not the next status
|
|
115
115
|
*/
|
|
116
116
|
async function createApprovalRequestWithEmail(featureId, productId, currentStatus, verbose = false) {
|
|
@@ -121,6 +121,7 @@ async function createApprovalRequestWithEmail(featureId, productId, currentStatu
|
|
|
121
121
|
// Create approval request via MCP endpoint
|
|
122
122
|
// Note: We're requesting approval for the current status
|
|
123
123
|
// The approval is asking: "Can we proceed from this status?"
|
|
124
|
+
// Email notifications are sent automatically by the MCP handler
|
|
124
125
|
const result = (await callMcpEndpoint('approvals/create', {
|
|
125
126
|
feature_id: featureId,
|
|
126
127
|
requested_status: currentStatus,
|
|
@@ -133,30 +134,16 @@ async function createApprovalRequestWithEmail(featureId, productId, currentStatu
|
|
|
133
134
|
}
|
|
134
135
|
if (verbose) {
|
|
135
136
|
logInfo(`✅ Approval request created: ${approvalId}`);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
logInfo(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
approval_id: approvalId,
|
|
144
|
-
}));
|
|
145
|
-
if (emailResult?.emails_sent) {
|
|
146
|
-
const sentCount = emailResult.emails_sent.filter((e) => e.status === 'sent').length;
|
|
147
|
-
if (verbose) {
|
|
148
|
-
logInfo(`✅ Sent approval emails to ${sentCount} assignee(s)`);
|
|
137
|
+
// Log email results if available
|
|
138
|
+
if (result?.emails_sent) {
|
|
139
|
+
const sentCount = result.emails_sent.filter((e) => e.status === 'sent').length;
|
|
140
|
+
const failedCount = result.emails_sent.filter((e) => e.status !== 'sent').length;
|
|
141
|
+
logInfo(`📧 Sent approval emails to ${sentCount} assignee(s)`);
|
|
142
|
+
if (failedCount > 0) {
|
|
143
|
+
logWarning(`⚠️ Failed to send ${failedCount} email(s)`);
|
|
149
144
|
}
|
|
150
145
|
}
|
|
151
146
|
}
|
|
152
|
-
catch (emailError) {
|
|
153
|
-
// Don't fail the whole process if email fails
|
|
154
|
-
const errorMessage = emailError instanceof Error ? emailError.message : String(emailError);
|
|
155
|
-
logWarning(`Failed to send approval emails: ${errorMessage}`);
|
|
156
|
-
if (verbose) {
|
|
157
|
-
logInfo('⚠️ Approval created but email notification failed');
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
147
|
return approvalId;
|
|
161
148
|
}
|
|
162
149
|
catch (error) {
|