Skip to content

feat: [#651] add queue:retry command#1056

Merged
hwbrzzl merged 2 commits intomasterfrom
bowen/add-queue-retry-command
Jun 1, 2025
Merged

feat: [#651] add queue:retry command#1056
hwbrzzl merged 2 commits intomasterfrom
bowen/add-queue-retry-command

Conversation

@hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented May 31, 2025

📑 Description

image

This pull request introduces significant enhancements and refactoring to the queue system, including the addition of new functionality, error handling improvements, and code restructuring for better modularity. The most notable changes include the implementation of a Connection method in the queue interface, the addition of a QueueRetryCommand for retrying failed jobs, and the extraction of utility functions into a dedicated utils package.

New Features and Functionality:

  • Added a Connection method to the Queue interface, allowing retrieval of a driver instance by connection name. This includes corresponding implementations in queue/application.go and mocks in mocks/queue/Queue.go. [1] [2] [3]

  • Introduced the QueueRetryCommand in queue/console/queue_retry_command.go, enabling retry of failed queue jobs via a console command. This includes features such as retrying jobs by queue or UUID and handling errors during retries.

Error Handling Improvements:

  • Added new error messages in errors/list.go for better granularity when handling queue-related failures, such as QueueFailedJobNotFound, QueueFailedToDeleteFailedJob, and QueueNoRetryableJobsFound.

Code Refactoring:

  • Moved task-related utility functions (e.g., TaskToJson, JsonToTask, ConvertArgs) from the main queue package to a new utils package for better separation of concerns. This change impacts multiple files, including queue/driver_database.go, queue/driver_database_job.go, and their corresponding test files. [1] [2] [3] [4]

  • Renamed queue/utils.go to queue/utils/convert.go and updated all references accordingly. [1] [2]

Models and Data Handling:

  • Added Job and FailedJob structs in queue/models/job.go to encapsulate database representations of queue jobs. These models include helper methods for incrementing attempts and updating timestamps.

✅ Checks

  • Added test cases for my code

@codecov
Copy link

codecov bot commented May 31, 2025

Codecov Report

Attention: Patch coverage is 75.49669% with 37 lines in your changes missing coverage. Please review.

Project coverage is 71.23%. Comparing base (1d20e34) to head (ae55e7e).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
queue/console/queue_retry_command.go 80.00% 22 Missing and 1 partial ⚠️
queue/models/job.go 0.00% 8 Missing ⚠️
queue/driver_database.go 75.00% 2 Missing and 1 partial ⚠️
queue/application.go 0.00% 2 Missing ⚠️
queue/service_provider.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1056      +/-   ##
==========================================
- Coverage   71.39%   71.23%   -0.16%     
==========================================
  Files         178      180       +2     
  Lines       12587    12705     +118     
==========================================
+ Hits         8986     9051      +65     
- Misses       3212     3264      +52     
- Partials      389      390       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: f95d1af Previous: 1d20e34 Ratio
BenchmarkFile_ReadWrite 342772 ns/op 6186 B/op 97 allocs/op 203254 ns/op 6185 B/op 97 allocs/op 1.69
BenchmarkFile_ReadWrite - ns/op 342772 ns/op 203254 ns/op 1.69

This comment was automatically generated by workflow using github-action-benchmark.

@hwbrzzl hwbrzzl marked this pull request as ready for review June 1, 2025 03:13
@hwbrzzl hwbrzzl requested a review from a team as a code owner June 1, 2025 03:13
@hwbrzzl hwbrzzl merged commit 5d8859e into master Jun 1, 2025
13 of 14 checks passed
@hwbrzzl hwbrzzl deleted the bowen/add-queue-retry-command branch June 1, 2025 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant