-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: new JOBS API #142
Conversation
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
WalkthroughThis update primarily involves version upgrades and type modifications across various components of the RoadRunner server, focusing on transitioning from version 4 to version 5 for multiple dependencies and improving the type handling for specific configurations and methods. The changes enhance compatibility, update dependencies, and refine type consistency within the system. Changes
Poem
Tip AI model upgrade
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (4)
go.sum
is excluded by!**/*.sum
go.work.sum
is excluded by!**/*.sum
tests/go.sum
is excluded by!**/*.sum
tests/php_test_files/composer.lock
is excluded by!**/*.lock
Files selected for processing (21)
- .githooks/pre-commit (1 hunks)
- .github/workflows/linters.yml (1 hunks)
- .github/workflows/linux.yml (2 hunks)
- .github/workflows/linux_durability.yml (2 hunks)
- .gitignore (1 hunks)
- .golangci.yml (3 hunks)
- amqpjobs/driver.go (1 hunks)
- amqpjobs/item.go (8 hunks)
- githooks-installer.sh (1 hunks)
- go.mod (1 hunks)
- plugin.go (1 hunks)
- tests/go.mod (2 hunks)
- tests/jobs_amqp_test.go (6 hunks)
- tests/php_test_files/jobs/jobs_create_memory.php (1 hunks)
- tests/php_test_files/jobs/jobs_err.php (1 hunks)
- tests/php_test_files/jobs/jobs_ok.php (1 hunks)
- tests/php_test_files/jobs/jobs_ok_pq.php (1 hunks)
- tests/php_test_files/jobs/jobs_ok_queue_name_exist.php (1 hunks)
- tests/php_test_files/jobs/jobs_ok_sleep1.php (1 hunks)
- tests/php_test_files/jobs/jobs_ok_slow.php (1 hunks)
- tests/php_test_files/jobs/jobs_ok_slow_rand.php (2 hunks)
Files skipped from review due to trivial changes (14)
- .githooks/pre-commit
- .github/workflows/linters.yml
- .github/workflows/linux.yml
- .gitignore
- .golangci.yml
- githooks-installer.sh
- go.mod
- tests/go.mod
- tests/jobs_amqp_test.go
- tests/php_test_files/jobs/jobs_create_memory.php
- tests/php_test_files/jobs/jobs_ok_queue_name_exist.php
- tests/php_test_files/jobs/jobs_ok_sleep1.php
- tests/php_test_files/jobs/jobs_ok_slow.php
- tests/php_test_files/jobs/jobs_ok_slow_rand.php
Additional comments not posted (18)
tests/php_test_files/jobs/jobs_ok.php (3)
13-13
: Consistent use of double quotes for string literals.
20-20
: Updated method call toack()
.This change aligns with the PR's objective to standardize task acknowledgment methods across the codebase.
22-22
: Proper error logging.Using the
error
method to log exceptions is a good practice, ensuring that all errors are captured and logged appropriately.tests/php_test_files/jobs/jobs_ok_pq.php (4)
13-13
: Consistent use of double quotes for string literals.
20-20
: Introduce simulated delay usingsleep(15)
.Consider adding a comment explaining the purpose of this delay if it's specifically for testing scenarios.
21-21
: Updated method call toack()
.This change aligns with the PR's objective to standardize task acknowledgment methods across the codebase.
[APPROved]
23-23
: Proper error logging.Using the
error
method to log exceptions is a good practice, ensuring that all errors are captured and logged appropriately.tests/php_test_files/jobs/jobs_err.php (3)
13-13
: Consistent use of double quotes for string literals.
21-21
: Introduced retry logic with delay.This robust pattern allows tasks to be retried with a delay, improving the resilience of the job handling system.
Also applies to: 26-29
32-32
: Proper error logging.Using the
error
method to log exceptions is a good practice, ensuring that all errors are captured and logged appropriately.plugin.go (1)
6-6
: Updated import paths to reflect new API version.This change is necessary to align with the updated version of the jobs API, ensuring compatibility.
.github/workflows/linux_durability.yml (1)
20-22
: Updated testing matrix to use the latest versions.Updating the PHP, Go, and OS versions in the matrix ensures that the tests are run against the latest environments, which is crucial for maintaining compatibility and catching potential issues early.
amqpjobs/item.go (5)
6-6
: Approved: Import adjustments and namespace changes.The addition of
"maps"
and update to thejobs
package version are aligned with the changes described in the PR summary and AI-generated summaries, indicating an API upgrade.Also applies to: 13-13
45-45
: Approved: Change ofDelay
field type.Changing the
Delay
field fromint64
toint
simplifies interactions and is consistent with the method adjustments in the same file.
135-152
: Approved: Enhancements toNackWithOptions
method.The method now supports conditional requeueing with or without delay, enhancing its flexibility in job handling. The implementation logic correctly handles different scenarios based on the
requeue
anddelay
parameters.
Line range hint
165-193
: Approved: Updates toRequeue
method.The method now accepts an
int
for thedelay
, aligning with other changes in the file. The use of themaps.Copy
function to manage headers during requeueing is a robust enhancement, ensuring headers are correctly transferred or merged.
244-244
: Approved: Consistent type casting infromJob
method.The casting of the
Delay
field toint
is consistent with its new declaration in theOptions
struct, ensuring type safety and alignment across the application.amqpjobs/driver.go (1)
16-16
: Approved: Namespace update in import statement.The update to the
jobs
package version aligns with the changes described in the PR summary and AI-generated summaries, indicating an API upgrade.
Signed-off-by: Valery Piashchynski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- amqpjobs/item.go (8 hunks)
Files skipped from review as they are similar to previous changes (1)
- amqpjobs/item.go
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (4)
go.sum
is excluded by!**/*.sum
go.work
is excluded by!**/*.work
go.work.sum
is excluded by!**/*.sum
tests/go.sum
is excluded by!**/*.sum
Files selected for processing (8)
- amqpjobs/driver.go (9 hunks)
- amqpjobs/listener.go (1 hunks)
- amqpjobs/redial.go (3 hunks)
- go.mod (2 hunks)
- plugin.go (3 hunks)
- tests/go.mod (4 hunks)
- tests/jobs_amqp_test.go (7 hunks)
- tests/php_test_files/jobs/jobs_err.php (1 hunks)
Files skipped from review due to trivial changes (1)
- amqpjobs/listener.go
Files skipped from review as they are similar to previous changes (5)
- amqpjobs/driver.go
- plugin.go
- tests/go.mod
- tests/jobs_amqp_test.go
- tests/php_test_files/jobs/jobs_err.php
Additional comments not posted (4)
go.mod (2)
10-18
: LGTM! Dependency updates are approved.The updates to
github.com/roadrunner-server/api/v4
and other related packages look good.
3-3
: Verify Go version compatibility.Ensure that Go 1.22.5 is compatible with the project's requirements and all dependencies.
Verification successful
Verify Go version compatibility.
The Go version 1.22.5 is consistently specified across the project's configuration files (
go.mod
,go.work
,tests/go.mod
), indicating intended compatibility. No issues were found related to this version update.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify Go version compatibility. # Test: Check the current Go version and ensure compatibility with the project. go versionLength of output: 82
Script:
#!/bin/bash # Search for Go version requirements in the project documentation and configuration files rg -i 'go\s+1\.\d+' README.md docs/ .github/ # Check the go.mod file for any version constraints rg -i 'go\s+1\.\d+' go.modLength of output: 131
Script:
#!/bin/bash # Search for issues, pull requests, or discussions mentioning Go version 1.22.5 gh issue list --search "Go 1.22.5" gh pr list --search "Go 1.22.5" gh discussion list --search "Go 1.22.5"Length of output: 467
Script:
#!/bin/bash # Search the entire codebase for any references to Go versions rg -i 'go\s+1\.\d+'Length of output: 79
amqpjobs/redial.go (2)
15-16
: LGTM! New constantrestartStr
is approved.The addition of the
restartStr
constant for pipeline operation is approved.
325-327
: Verify event dispatch for pipeline recreation.Ensure that the event dispatch to recreate the pipeline upon backoff operation failure is functioning correctly.
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
Signed-off-by: Valery Piashchynski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (3)
go.sum
is excluded by!**/*.sum
go.work.sum
is excluded by!**/*.sum
tests/go.sum
is excluded by!**/*.sum
Files selected for processing (9)
- amqpjobs/config.go (1 hunks)
- amqpjobs/driver.go (10 hunks)
- amqpjobs/item.go (10 hunks)
- go.mod (2 hunks)
- plugin.go (3 hunks)
- tests/go.mod (4 hunks)
- tests/jobs_amqp_durability_test.go (1 hunks)
- tests/jobs_amqp_test.go (8 hunks)
- tests/pkgs.txt (1 hunks)
Files skipped from review due to trivial changes (2)
- amqpjobs/config.go
- tests/jobs_amqp_durability_test.go
Files skipped from review as they are similar to previous changes (6)
- amqpjobs/driver.go
- amqpjobs/item.go
- go.mod
- plugin.go
- tests/go.mod
- tests/jobs_amqp_test.go
Additional comments not posted (1)
tests/pkgs.txt (1)
1-1
: LGTM! Verify the correctness of the updated paths.The import paths for various
roadrunner-server
modules have been correctly updated tov5
.However, ensure that all updated paths are valid and correctly referenced in the codebase.
Reason for This PR
ref: roadrunner-server/roadrunner#1941
Description of Changes
NackWithOptions
method.License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]
git commit -s
).CHANGELOG.md
.Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores