feat: revert workflow|

This commit is contained in:
Nevo David 2026-03-22 10:12:02 +07:00
parent cb8560e183
commit 40c443ba96

View file

@ -1,5 +1,4 @@
import { PostActivity } from '@gitroom/orchestrator/activities/post.activity';
import * as Sentry from '@sentry/node';
import {
ActivityFailure,
ApplicationFailure,
@ -172,14 +171,6 @@ export async function postWorkflowV101({
postsResults[i].releaseURL
);
if (i === 0) {
try {
const latency = Date.now() - startTime.getTime();
Sentry.metrics.count('posts.published.success', 1, { attributes: { provider: post.integration?.providerIdentifier } } as any);
Sentry.metrics.distribution('posts.publish_latency_ms', latency, { attributes: { provider: post.integration?.providerIdentifier } } as any);
} catch (e) {}
}
if (i === 0) {
// send notification on a sucessful post
await inAppNotification(
@ -216,16 +207,6 @@ export async function postWorkflowV101({
// for other errors, change state and inform the user if needed
await changeState(postsList[0].id, 'ERROR', err, postsList);
try {
const cause = (err as any)?.cause;
const failure_reason = (cause && (cause as any).type) || (err as any)?.message || 'unknown';
Sentry.metrics.count('posts.published.failure', 1, { attributes: { provider: post.integration?.providerIdentifier, failure_reason } } as any);
} catch (e) {}
try {
const cause = (err as any)?.cause;
const reason = (cause && (cause as any).type) || (err as any)?.message || 'unknown';
Sentry.metrics.count('task_failures_by_reason', 1, { attributes: { reason } } as any);
} catch (e) {}
// specific case for bad body errors
if (
@ -252,13 +233,6 @@ export async function postWorkflowV101({
if (postsResults.length === before) {
// all retries exhausted without success
try {
Sentry.metrics.count('temporal.retry_exhausted', 1, { attributes: { workflow: 'postWorkflowV101' } } as any);
} catch (e) {}
try {
Sentry.metrics.count('posts.published.failure', 1, { attributes: { provider: post.integration?.providerIdentifier, failure_reason: 'retry_exhausted' } } as any);
} catch (e) {}
return false;
}
}