-
Notifications
You must be signed in to change notification settings - Fork 66
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
Adding max http response string length as a setting, and capping http… #876
Conversation
… response string based on that setting (manual backport to 2.x) Signed-off-by: Dennis Toepker <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #876 +/- ##
=========================================
Coverage 66.85% 66.85%
Complexity 263 263
=========================================
Files 39 39
Lines 1738 1738
Branches 165 165
=========================================
Hits 1162 1162
Misses 453 453
Partials 123 123
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
notifications/core/src/main/kotlin/org/opensearch/notifications/core/setting/PluginSettings.kt
Outdated
Show resolved
Hide resolved
} | ||
buf.setLength(minOf(buf.length, maxResultLength)) | ||
return buf | ||
} |
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.
can we move this truncate logic to a util class like EntityUtils
?
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.
If we do let's keep it as a backlog item
Signed-off-by: Dennis Toepker <[email protected]>
#876) * Adding max http response string length as a setting, and capping http response string based on that setting (manual backport to 2.x) Signed-off-by: Dennis Toepker <[email protected]> * misc fix in plugin settings Signed-off-by: Dennis Toepker <[email protected]> --------- Signed-off-by: Dennis Toepker <[email protected]> Co-authored-by: Dennis Toepker <[email protected]> Co-authored-by: Hailong Cui <[email protected]> (cherry picked from commit 9feaf33)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.9 2.9
# Navigate to the new working tree
cd .worktrees/backport-2.9
# Create a new branch
git switch --create backport/backport-876-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9feaf33e0c430f442d91fd1b37a7a8bb137e95bd
# Push it to GitHub
git push --set-upstream origin backport/backport-876-to-2.9
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.9 Then, create a pull request where the |
#876) * Adding max http response string length as a setting, and capping http response string based on that setting (manual backport to 2.x) Signed-off-by: Dennis Toepker <[email protected]> * misc fix in plugin settings Signed-off-by: Dennis Toepker <[email protected]> --------- Signed-off-by: Dennis Toepker <[email protected]> Co-authored-by: Dennis Toepker <[email protected]> Co-authored-by: Hailong Cui <[email protected]> (cherry picked from commit 9feaf33)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.7 2.7
# Navigate to the new working tree
cd .worktrees/backport-2.7
# Create a new branch
git switch --create backport/backport-876-to-2.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9feaf33e0c430f442d91fd1b37a7a8bb137e95bd
# Push it to GitHub
git push --set-upstream origin backport/backport-876-to-2.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.7 Then, create a pull request where the |
#876) * Adding max http response string length as a setting, and capping http response string based on that setting (manual backport to 2.x) Signed-off-by: Dennis Toepker <[email protected]> * misc fix in plugin settings Signed-off-by: Dennis Toepker <[email protected]> --------- Signed-off-by: Dennis Toepker <[email protected]> Co-authored-by: Dennis Toepker <[email protected]> Co-authored-by: Hailong Cui <[email protected]> (cherry picked from commit 9feaf33)
Adding max http response string length as a setting, and capping http response string based on that setting
Description
This is a 2.x version of the following change merged to main/3.0: #861. 2.x did not have all the necessary libraries that this change needed, so they were reimplemented for the purposes of working on older versions.
Issues Resolved
Please refer to #861
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.