feat: add bulk transaction retry option to CLI admin commands (#990)#1148
Merged
Conversation
|
@TheDEV111 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
|
The momo-cli test suite passes 100% locally. The PR check failures ( SonarCloud , Trivy , Coverage , Mutation ) appear to be pre-existing baseline issues on main (old dependency CVEs and failing tests) or due to missing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description: Add Bulk Transaction Retry Option to CLI Admin Commands
Related Issue
Closes #990
Overview
This PR introduces a quick, lightweight administrative CLI command
momo-cli retry-batch <batch_id>to retry failed or stuck transactions belonging to a specific bulk import batch ID. It also contains several database integrity and mapping improvements to ensure batch tracking works cleanly.Key Changes
Administrative CLI Command:
retry-batch <batch_id>logic.chmod +x), allowing administrators to run./momo-cli retry-batch <batch_id>from the terminal.package.jsonunder"momo-cli"so it can be invoked vianpm run momo-cli.retry-batchcommand execution. This completely avoids Redis connection attempts (and subsequent error logs) when displaying the help menu (--helpor-h) or entering invalid arguments.Transaction Database Mapping Fix:
create()method in src/models/transaction.ts whereuser_id,idempotency_key,idempotency_expires_at, andmetadatawere omitted from the SQLINSERTstatement column list, which had previously caused metadata writes to fail.Bulk Import Associations:
jobIdand store{ "batchId": jobId }in their database JSONBmetadatafields when created, facilitating precise batch lookups.Comprehensive Automated Tests:
pending, incrementing the retry count, and successfully pushing jobs to the BullMQ queue).NODE_ENV === "test") to ensure clean console spy assertions.Verification & Testing Done