-
Notifications
You must be signed in to change notification settings - Fork 16
Adjust documentation to match errors found via schema updates and new SQS parameters #29
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
Conversation
Typo on protobuf
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes involve modifications to multiple files, including Changes
Possibly related PRs
Suggested labels
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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
🧹 Outside diff range and nitpick comments (3)
queues/sqs.md (3)
242-244
: Enhance documentation for skip_queue_declaration parameter.Consider adding more context about when to use this option and potential implications. For example:
- When to use it (e.g., in production environments where queues are pre-provisioned)
- What happens if the queue doesn't exist and this option is enabled
- Performance implications
206-211
: Add practical example for retain_failed_jobs with dead-letter queue configuration.The documentation would benefit from a concrete example showing how to configure a dead-letter queue with
retain_failed_jobs
. Consider adding a configuration example that demonstrates:
- Setting up a dead-letter queue
- Configuring maximum receive count
- Showing the complete YAML configuration
Would you like me to provide a sample configuration example?
Line range hint
262-276
: Enhance attributes documentation with explanations.While the example shows possible attributes, it would be more helpful to include:
- Brief explanation of each attribute's purpose
- Recommended values for common scenarios
- Impact of changing these values
For example:
attributes: # Controls the delay (0-900 seconds) before new messages become visible DelaySeconds: 0 # Maximum size of a message in bytes (1024-262144) MaximumMessageSize: 262144 # How long messages are retained (60-1209600 seconds) MessageRetentionPeriod: 345600 # Long polling wait time (0-20 seconds) ReceiveMessageWaitTimeSeconds: 0 # How long messages are hidden from other consumers VisibilityTimeout: 30
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- .gitbook.yaml (1 hunks)
- queues/sqs.md (3 hunks)
🧰 Additional context used
🪛 yamllint
.gitbook.yaml
[error] 5-5: no new line character at the end of file
(new-line-at-end-of-file)
🪛 Gitleaks
queues/sqs.md
91-91: Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.
(aws-access-token)
🔇 Additional comments (1)
queues/sqs.md (1)
91-93
: Replace example AWS credentials with clearer placeholder text.While the current credentials are marked as "EXAMPLE", it's better to use obvious placeholder text to prevent any possibility of misuse. Consider using placeholders like:
- key: ASIAIOSFODNN7EXAMPLE - secret: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY - session_token: AQoDYXdzEJr... + key: "<YOUR_AWS_ACCESS_KEY_ID>" + secret: "<YOUR_AWS_SECRET_ACCESS_KEY>" + session_token: "<YOUR_SESSION_TOKEN>" # optional; usually not required[security]
🧰 Tools
🪛 Gitleaks
91-91: Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.
(aws-access-token)
Adjust documentation to match errors found via schema updates
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: 4
🧹 Outside diff range and nitpick comments (7)
lab/logger.md (1)
98-98
: Highlight breaking change in output format configuration.The change from
output: stdout
tooutput: [ stdout ]
represents a breaking change in the configuration schema. Consider adding a migration note to help users update their existing configurations.Add a note like:
logs: output: [ stdout ] + # Note: The output format has changed from a string to an array format. + # Old format: output: stdout + # New format: output: [ stdout ]plugins/tcp.md (1)
63-67
: Add default value forread_buf_size
.The documentation for the new
read_buf_size
parameter clearly explains its purpose and usage. However, it would be helpful to specify the default value that RoadRunner uses when this optional parameter is not set.app-server/aws-lambda.md (4)
343-346
: Consider adding a note about logging configuration flexibility.While the current example shows a simple stderr output, it might be helpful to document that the array format supports multiple outputs and provide an example of a more complex logging setup.
Example addition:
logs: mode: production level: error encoding: json # Example of multiple outputs output: - stderr # Lambda logs to CloudWatch - file.log # Optional local file logging
Line range hint
1-100
: Consider enhancing the PHP worker example with more robust error handling.The current PHP worker example could benefit from more detailed error handling to help developers troubleshoot issues in the Lambda environment.
Consider adding this enhanced version:
<?php use Spiral\Goridge; use Spiral\RoadRunner; use Nyholm\Psr7\Response; ini_set('display_errors', 'stderr'); require __DIR__ . "/vendor/autoload.php"; $worker = RoadRunner\Worker::create(); $psr7 = new RoadRunner\Http\PSR7Worker( $worker, new \Nyholm\Psr7\Factory\Psr17Factory(), new \Nyholm\Psr7\Factory\Psr17Factory(), new \Nyholm\Psr7\Factory\Psr17Factory() ); while ($req = $psr7->waitRequest()) { try { // Log request details for debugging error_log(sprintf( 'Processing request: %s %s', $req->getMethod(), $req->getUri() )); $resp = new Response(); $resp->getBody()->write("hello world"); $psr7->respond($resp); } catch (\Throwable $e) { // Enhanced error logging error_log(sprintf( 'Error processing request: %s in %s:%d', $e->getMessage(), $e->getFile(), $e->getLine() )); // Return a structured error response $resp = new Response(500); $resp->getBody()->write(json_encode([ 'error' => 'Internal Server Error', 'message' => $e->getMessage() ])); $psr7->respond($resp); } }
Line range hint
200-300
: Consider improving error responses in the Lambda plugin.The current error responses in the Lambda plugin return empty bodies with 500 status codes. This could be enhanced to provide more meaningful error information.
Consider modifying the error responses to include more context:
// Example of a more informative error response return events.APIGatewayV2HTTPResponse{ StatusCode: 500, Body: json.Marshal(map[string]string{ "error": "Internal Server Error", "detail": err.Error(), }), Headers: map[string]string{ "Content-Type": "application/json", }, }, nil
Line range hint
344-400
: Consider expanding build instructions.The build instructions could be more detailed to help users understand the process better.
Consider adding these details to the build instructions:
# Build instructions with explanations # 1. Build the binary CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ -trimpath \ # Remove file system paths from binary -ldflags "-s" \ # Strip debug information -o bootstrap-amd64 main.go plugin.go # 2. Package the function zip main.zip bootstrap-amd64 handler.php vendor/* .rr.yaml # 3. (Optional) Test the package size du -h main.zip # Note: Ensure your package size is within Lambda limits (50 MB zipped, 250 MB unzipped)queues/sqs.md (1)
219-220
: Fix markdown formatting issues.There are several markdown formatting issues that affect readability:
- Missing blank lines around headings
- Trailing whitespace
Apply these formatting fixes:
- Add blank lines before and after headings
- Remove trailing whitespace after "queue."
Also applies to: 249-250, 264-266
🧰 Tools
🪛 Markdownlint
219-219: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (8)
- .gitbook.yaml (1 hunks)
- app-server/aws-lambda.md (1 hunks)
- lab/logger.md (2 hunks)
- plugins/tcp.md (2 hunks)
- queues/amqp.md (0 hunks)
- queues/beanstalk.md (0 hunks)
- queues/nats.md (0 hunks)
- queues/sqs.md (3 hunks)
💤 Files with no reviewable changes (3)
- queues/amqp.md
- queues/beanstalk.md
- queues/nats.md
🚧 Files skipped from review as they are similar to previous changes (1)
- .gitbook.yaml
🧰 Additional context used
🪛 LanguageTool
plugins/tcp.md
[uncategorized] ~119-~119: Loose punctuation mark.
Context: ...For the specified delimiter. -
pool`: Configuration for the PHP worker pool f...(UNLIKELY_OPENING_PUNCTUATION)
🪛 Gitleaks
queues/sqs.md
91-91: Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.
(aws-access-token)
🪛 Markdownlint
queues/sqs.md
266-266: Expected: 0 or 2; Actual: 1
Trailing spaces(MD009, no-trailing-spaces)
219-219: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
249-249: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
🔇 Additional comments (4)
lab/logger.md (2)
134-134
: LGTM: Channel-specific output format is consistent.The array format for channel-specific output configuration matches the new schema format shown in the earlier example.
Line range hint
98-134
: Verify configuration format consistency across documentation.Since this represents a schema change, let's ensure all related documentation files are updated consistently.
✅ Verification successful
ya?ml[\s\S]+?output:[\s\S]+?```' --type md
--- **Configuration format is consistently documented** Based on the search results, the array format for output configuration `output: [ ... ]` is consistently used across the documentation where output configuration is mentioned. We found three instances: - `lab/logger.md`: `output: [ stdout ]` and `output: [ http.log ]` - `app-server/aws-lambda.md`: `output: [ stderr ]` The other occurrences of "output" in the documentation are either: - Part of descriptive text - Different configuration keys (like `log_output`) - HTTP header configurations </details> <details> <summary>🏁 Scripts executed</summary> The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Search for any remaining instances of the old output format in documentation rg 'output:\s+\w+\.log\s*$' '*.md' # Search for new array format to verify consistent documentation rg 'output:\s*\[\s*\w+\.log\s*\]' '*.md'
Length of output: 169
Script:
#!/bin/bash # First, let's find all markdown files in the repository echo "=== Finding all markdown files ===" fd -e md # Then search for any output configuration patterns in these files echo -e "\n=== Searching for old single output format ===" rg -A 2 'output:' --type md # Look for array-style output configurations echo -e "\n=== Searching for array output format ===" rg -A 2 'output:\s*\[' --type md # Search for any yaml code blocks containing output configuration echo -e "\n=== Searching for yaml blocks with output configuration ===" rg 'Length of output: 3679
plugins/tcp.md (1)
Line range hint
1-24
: Documentation structure and clarity are excellent.The documentation is well-organized with:
- Clear explanation of the plugin's functionality
- Important warning about stateless workers
- Proper sectioning and formatting
app-server/aws-lambda.md (1)
344-344
: LGTM! The logging output format update is consistent.The change from string to array format for log output aligns with modern logging practices and maintains consistency across the documentation.
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: 1
🧹 Outside diff range and nitpick comments (3)
queues/sqs.md (3)
30-35
: Improve endpoint documentation formatting.
The endpoint documentation has a minor formatting issue with line breaks that could affect readability.
Apply this change:
# AWS SQS endpoint.
# This parameter *is only required* if your SQS endpoint is *not* hosted on the AWS infrastructure.
# Always leave this empty if your queue is on AWS SQS.
- # For ElasticMQ, the default is http://127.0.0.1:9324
+ # For ElasticMQ, the default is:
+ # http://127.0.0.1:9324
# Default: empty
endpoint: ""
235-241
: Fix grammar in polling configuration documentation.
There are subject-verb agreement issues in the polling configuration explanation.
Apply these changes:
- By default, SQS and RoadRunner is configured to use **short polling**.
+ By default, SQS and RoadRunner are configured to use **short polling**.
- make sure that your queue and RoadRunner is configured correctly.
+ make sure that your queue and RoadRunner are configured correctly.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~235-~235: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...Polling By default, SQS and RoadRunner is configured to use short polling. Pl...
(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
[uncategorized] ~238-~238: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...ake sure that your queue and RoadRunner is configured correctly. Long polling will...
(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
233-234
: Fix heading formatting.
Some headings are missing proper spacing which affects readability.
Add blank lines around headings:
+
### Short vs. Long Polling
+
...
+
{% hint style="info" %}
Attributes are only set if RoadRunner creates the queue. Attributes of existing queues are **not modified**.
{% endhint %}
+
Also applies to: 295-297
🧰 Tools
🪛 Markdownlint
233-233: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- queues/sqs.md (3 hunks)
🧰 Additional context used
🪛 LanguageTool
queues/sqs.md
[uncategorized] ~62-~62: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...% endcode %} #### AWS SQS in different region with dynamic IAM If you access your AW...
(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
[uncategorized] ~235-~235: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...Polling By default, SQS and RoadRunner is configured to use short polling. Pl...
(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
[uncategorized] ~238-~238: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...ake sure that your queue and RoadRunner is configured correctly. Long polling will...
(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
🪛 Gitleaks
queues/sqs.md
87-87: Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.
(aws-access-token)
🪛 Markdownlint
queues/sqs.md
280-280: Expected: 0 or 2; Actual: 1
Trailing spaces
(MD009, no-trailing-spaces)
233-233: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
🔇 Additional comments (2)
queues/sqs.md (2)
3-8
: LGTM! Clear and well-structured introduction.
The introduction effectively explains SQS and provides relevant documentation links. The self-hosting option with ElasticMQ is clearly presented.
164-175
: LGTM! Comprehensive FIFO queue documentation.
The FIFO queue section clearly explains the requirements and necessary configuration for maintaining message order.
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
🧹 Outside diff range and nitpick comments (2)
queues/sqs.md (2)
97-99
: Improve sentence clarity.The sentence could be more concise.
-If you self-host your SQS-compatible queue, only the endpoint is required. You may be required to provide a set key of -and secret in order to satisfy parameters of the AWS SQS SDK, which RoadRunner uses under the hood. +If you self-host your SQS-compatible queue, only the endpoint is required. However, you may need to provide a key and +secret to satisfy the AWS SQS SDK parameters that RoadRunner uses internally.🧰 Tools
🪛 LanguageTool
[style] ~98-~98: Consider a shorter alternative to avoid wordiness.
Context: ...ired to provide a set key of and secret in order to satisfy parameters of the AWS SQS SDK, ...(IN_ORDER_TO_PREMIUM)
175-175
: Fix trailing spaces.There are trailing spaces at the end of these lines.
-2. You should have `prefetch` set to `1` for the pipeline. If you fetch multiple messages at a time, RoadRunner may not +2. You should have `prefetch` set to `1` for the pipeline. If you fetch multiple messages at a time, RoadRunner may not -to configure for the queue. +to configure for the queue.Also applies to: 284-284
🧰 Tools
🪛 Markdownlint
175-175: Expected: 0 or 2; Actual: 1
Trailing spaces(MD009, no-trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
queues/sqs.md
(3 hunks)
🧰 Additional context used
📓 Learnings (1)
queues/sqs.md (1)
Learnt from: nickdnk
PR: roadrunner-server/docs#29
File: queues/sqs.md:18-24
Timestamp: 2024-10-29T15:01:07.731Z
Learning: When reviewing documentation in this project, do not warn about AWS API secrets and keys that are not valid formats or include `EXAMPLE` in the placeholders, as they are acceptable.
🪛 LanguageTool
queues/sqs.md
[style] ~98-~98: Consider a shorter alternative to avoid wordiness.
Context: ...ired to provide a set key of and secret in order to satisfy parameters of the AWS SQS SDK, ...
(IN_ORDER_TO_PREMIUM)
🪛 Gitleaks
queues/sqs.md
87-87: Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.
(aws-access-token)
🪛 Markdownlint
queues/sqs.md
175-175: Expected: 0 or 2; Actual: 1
Trailing spaces
(MD009, no-trailing-spaces)
284-284: Expected: 0 or 2; Actual: 1
Trailing spaces
(MD009, no-trailing-spaces)
237-237: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
🔇 Additional comments (4)
queues/sqs.md (4)
3-38
: LGTM! Clear and well-structured introduction and configuration.
The introduction and basic configuration sections have been improved with:
- Clear definition of SQS and its relationship to AWS
- Better explanation of self-hosting options
- Well-documented configuration parameters with defaults
40-94
: LGTM! Well-structured examples covering common scenarios.
The examples section effectively covers different deployment scenarios:
- Dynamic IAM in same region
- Dynamic IAM in different region
- External access with explicit credentials
- Self-hosted setup
🧰 Tools
🪛 Gitleaks
87-87: Identified a pattern that may indicate AWS credentials, risking unauthorized cloud resource access and data breaches on AWS platforms.
(aws-access-token)
167-278
: LGTM! Comprehensive FIFO queue and visibility timeout documentation.
The documentation effectively explains:
- FIFO queue requirements and configuration
- Visibility timeout implications
- Error handling options
🧰 Tools
🪛 Markdownlint
175-175: Expected: 0 or 2; Actual: 1
Trailing spaces
(MD009, no-trailing-spaces)
237-237: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
236-246
: LGTM! Clear explanation of polling options.
The warning about short vs. long polling is well-written and provides valuable guidance for cost optimization.
🧰 Tools
🪛 Markdownlint
237-237: Expected: 1; Actual: 0; Above
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
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.
LGTM, thanks @nickdnk 👍
This replaces these two PRs and combine them: #27 and #28
Assumes roadrunner-server/sqs#573 will be merged.
Summary by CodeRabbit
read_buf_size
for the TCP plugin.consume_all
option from AMQP, Beanstalk, and NATS driver documentation, focusing on structured job consumption..gitbook.yaml
for improved structure.