Set order of tenant_template to the highest to avoid being overridden by custom templates#1247
Conversation
…plates Signed-off-by: Chang Liu <lc12251109@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1247 +/- ##
=======================================
Coverage 71.78% 71.78%
=======================================
Files 88 88
Lines 2027 2027
Branches 269 269
=======================================
Hits 1455 1455
Misses 509 509
Partials 63 63 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
@cliu123 Thank you for adding this PR. Two quick things:
- Can you create a global constant for the order? (too bad javascript doesn't have a built-in for Java's Integer.MAX_VALUE)
- Can you add a test showing that
tenant_templateis not overridden in both scenarios where order is equal and is less than 2147483647?
Signed-off-by: Chang Liu <lc12251109@gmail.com>
👍 Done
As I replied to the other comment, the template and order are parts of OpenSearch core. security-dashboards-plugin only calls the API to create template. So the definition of template and order, and how it gets overridden are defined by OpenSearch core. There's no need to test OpenSearch core functionality in plugins(would be duplicate effort). |
Thanks for the review! All the comments have been resolved.
|
Thanks for the work, @cliu123 ! @DarshitChanpura just double-checking that you had a chance to re-review after the latest change as the last commit addressed them, even though you didn't formally re-approve. Thanks! |
|
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-opendistro-1.12 opendistro-1.12
# Navigate to the new working tree
cd .worktrees/backport-opendistro-1.12
# Create a new branch
git switch --create backport/backport-1247-to-opendistro-1.12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dcf75c49543997e0e85dde9be314d5df81e60491
# Push it to GitHub
git push --set-upstream origin backport/backport-1247-to-opendistro-1.12
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-opendistro-1.12Then, create a pull request where the |
|
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-opendistro-1.11 opendistro-1.11
# Navigate to the new working tree
cd .worktrees/backport-opendistro-1.11
# Create a new branch
git switch --create backport/backport-1247-to-opendistro-1.11
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dcf75c49543997e0e85dde9be314d5df81e60491
# Push it to GitHub
git push --set-upstream origin backport/backport-1247-to-opendistro-1.11
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-opendistro-1.11Then, create a pull request where the |
|
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-opendistro-1.13 opendistro-1.13
# Navigate to the new working tree
cd .worktrees/backport-opendistro-1.13
# Create a new branch
git switch --create backport/backport-1247-to-opendistro-1.13
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dcf75c49543997e0e85dde9be314d5df81e60491
# Push it to GitHub
git push --set-upstream origin backport/backport-1247-to-opendistro-1.13
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-opendistro-1.13Then, create a pull request where the |
… by custom templates (opensearch-project#1247) Signed-off-by: Chang Liu <lc12251109@gmail.com>
… by custom templates (opensearch-project#1247) Signed-off-by: Chang Liu <lc12251109@gmail.com>
… by custom templates (opensearch-project#1247) (opensearch-project#1270) Signed-off-by: Chang Liu <lc12251109@gmail.com>
Signed-off-by: Chang Liu lc12251109@gmail.com
Description
The issue description of #1246 explains the issue to be resolved.
The PR title described the approach to fix the issue.
Category
Bug fix
Issues Resolved
#1246
Testing
UTs and ITs
Check List
Screenshots
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.