diff --git a/lib/services/integration-service.ts b/lib/services/integration-service.ts index f172f857..9972fc1d 100644 --- a/lib/services/integration-service.ts +++ b/lib/services/integration-service.ts @@ -235,7 +235,7 @@ export class IntegrationService { * @param rocketChatChannelId The Rocket.Chat channel ID to delete * @param giteaRepositoryUrl The Gitea repository URL to extract owner/repo from for deletion */ - public async rollbackIntegrations( + private async rollbackIntegrations( leantimeProjectId?: number, outlineCollectionId?: string, rocketChatChannelId?: string, @@ -322,4 +322,28 @@ export class IntegrationService { } } catch (giteaError) { console.error('Error during Gitea rollback:', giteaError); - console.log(` \ No newline at end of file + console.log(`⚠️ Note: Gitea repository at ${giteaRepositoryUrl} may need to be deleted manually`); + } + } else { + console.log('No Gitea repository was created, skipping rollback'); + // Mark as successful since there's nothing to delete + rollbackStatuses.gitea = true; + } + + // Provide a summary of rollback operations + console.log('Rollback summary:', JSON.stringify(rollbackStatuses)); + + // If any rollbacks failed, provide a note + if (!rollbackStatuses.leantime || !rollbackStatuses.outline || !rollbackStatuses.rocketchat || !rollbackStatuses.gitea) { + console.log('⚠️ Some resources may need to be deleted manually.'); + } + } catch (error) { + console.error('Error during rollback:', error); + console.log('⚠️ Resources may need to be deleted manually:'); + if (leantimeProjectId) console.log(`- Leantime project: ${leantimeProjectId}`); + if (outlineCollectionId) console.log(`- Outline collection: ${outlineCollectionId}`); + if (rocketChatChannelId) console.log(`- Rocket.Chat channel: ${rocketChatChannelId}`); + if (giteaRepositoryUrl) console.log(`- Gitea repository: ${giteaRepositoryUrl}`); + } + } +} \ No newline at end of file