Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1055 +/- ##
==========================================
+ Coverage 71.21% 71.42% +0.20%
==========================================
Files 178 178
Lines 12548 12587 +39
==========================================
+ Hits 8936 8990 +54
+ Misses 3220 3209 -11
+ Partials 392 388 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reintroduces the machinery driver for the queue package to allow continued usage of the previous driver alongside the new Redis driver, thereby mitigating break-changes for users upgrading to v1.17. Key changes include
- Adding and integrating the new machinery driver (including logging enhancements)
- Updating DriverCreator and PendingJob implementations to support the additional log dependency
- Enhancing configuration and test coverage for both driver and chaining functionality
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| queue/worker.go | Updated driver creator usage and conditional branching for machinery |
| queue/pending_job*.go | Adjusted constructor parameters to accept log dependency |
| queue/driver_machinery*.go | Refactored driver implementation and added chain support |
| queue/driver_creator*.go | Extended driver creator to support machinery driver creation |
| queue/application.go | Updated job submission methods to include log dependency |
| contracts/queue/driver.go | Added new DriverMachinery constant |
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.
📑 Description
Closes goravel/goravel#651
Previoushly, we ddin't want to push task to the machinery driver any more, only pop old tasks from the machinery driver and push new tasks to the new redis driver. But if so, it's a break-change for user, if there are any issue in the new redis driver, it's not good for users.
So in this PR, I added the machinery driver back, let user can continous use the machinery driver, they can swith the driver to redis in v1.17.
This pull request introduces a new
machinerydriver for the queue package, along with significant updates to theMachineryimplementation and its integration. It also includes updates to theDriverCreatorandPendingJobclasses to support the new driver and improve logging capabilities. The changes are accompanied by comprehensive tests for the new functionality.New Driver Implementation and Integration:
machinerydriver constant to thequeue/driver.gofile. ([contracts/queue/driver.goR6](https://github.com/goravel/framework/pull/1055/files#diff-74bbb8b0d13cc6315ecbf19d7e06d4e345c020d2065533d5341590c0a81c493aR6))Machinerydriver inqueue/driver_machinery.go, including methods for pushing tasks, running workers, and handling task chains. Simplified the initialization by dynamically creating the server configuration and broker/queue setup. ([[1]](https://github.com/goravel/framework/pull/1055/files#diff-5ffcad5fdc36c9ed9f2960478a6673b66e07faaf1e586446fab5b9bdce62c58aL8-R28),[[2]](https://github.com/goravel/framework/pull/1055/files#diff-5ffcad5fdc36c9ed9f2960478a6673b66e07faaf1e586446fab5b9bdce62c58aL44-L60),[[3]](https://github.com/goravel/framework/pull/1055/files#diff-5ffcad5fdc36c9ed9f2960478a6673b66e07faaf1e586446fab5b9bdce62c58aL69-R107),[[4]](https://github.com/goravel/framework/pull/1055/files#diff-5ffcad5fdc36c9ed9f2960478a6673b66e07faaf1e586446fab5b9bdce62c58aL121-R165))Updates to DriverCreator:
DriverCreatorto include alogdependency and support the newmachinerydriver. ([[1]](https://github.com/goravel/framework/pull/1055/files#diff-96facd005dd2e2be2900606a7b0b4395a8c9769c7f4f3e46c8ff8d60c39d6adeR6),[[2]](https://github.com/goravel/framework/pull/1055/files#diff-96facd005dd2e2be2900606a7b0b4395a8c9769c7f4f3e46c8ff8d60c39d6adeR16-R25),[[3]](https://github.com/goravel/framework/pull/1055/files#diff-96facd005dd2e2be2900606a7b0b4395a8c9769c7f4f3e46c8ff8d60c39d6adeR41-R42))DriverCreatorTestSuiteto include tests for themachinerydriver. ([[1]](https://github.com/goravel/framework/pull/1055/files#diff-36597f12e55c9723a3d81464173012d57487b6411d43c2d85cb085df070fbbb7L42-R42),[[2]](https://github.com/goravel/framework/pull/1055/files#diff-36597f12e55c9723a3d81464173012d57487b6411d43c2d85cb085df070fbbb7R90-R105))Logging Enhancements:
logas a dependency toPendingJoband its associatedNewPendingJobconstructor to improve logging capabilities. ([[1]](https://github.com/goravel/framework/pull/1055/files#diff-6cfb98ddf9021590d4029ab469f40e58403d7a929bf8874001736ddc2e10d319R9),[[2]](https://github.com/goravel/framework/pull/1055/files#diff-6cfb98ddf9021590d4029ab469f40e58403d7a929bf8874001736ddc2e10d319R28),[[3]](https://github.com/goravel/framework/pull/1055/files#diff-6cfb98ddf9021590d4029ab469f40e58403d7a929bf8874001736ddc2e10d319L38-R40))Machinerydriver for debugging, informational messages, and error handling. ([[1]](https://github.com/goravel/framework/pull/1055/files#diff-5ffcad5fdc36c9ed9f2960478a6673b66e07faaf1e586446fab5b9bdce62c58aL8-R28),[[2]](https://github.com/goravel/framework/pull/1055/files#diff-5ffcad5fdc36c9ed9f2960478a6673b66e07faaf1e586446fab5b9bdce62c58aL69-R107))Configuration Improvements:
queue/application.goto dynamically fetch queue and concurrency settings from the configuration file. ([queue/application.goL68-R73](https://github.com/goravel/framework/pull/1055/files#diff-34aafc02eb2c7a5ca85c1a4a79bb1f8e58711850cc764d4fc58e96401b397bb3L68-R73))Test Coverage:
Machinerydriver inqueue/driver_machinery_test.go, including tests for task pushing, running workers, handling delays, and task chains. ([[1]](https://github.com/goravel/framework/pull/1055/files#diff-427d61adc322d75e940292154357e58dfeb4c9bfcabcb445b9ef43584b786b4eR4-R24),[[2]](https://github.com/goravel/framework/pull/1055/files#diff-427d61adc322d75e940292154357e58dfeb4c9bfcabcb445b9ef43584b786b4eL38-R239))✅ Checks