-
Notifications
You must be signed in to change notification settings - Fork 93
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 EntityType to Comment Model #671
Conversation
Signed-off-by: Dennis Toepker <[email protected]>
Signed-off-by: Dennis Toepker <[email protected]>
content = content, | ||
createdTime = createdTime, | ||
lastUpdatedTime = null, | ||
user = user | ||
) | ||
|
||
enum class EntityType(val value: String) { |
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 intend for comments to be used by other plugins we shouldn't declared EntityType as an Enum as XYZPlugin might not accept "Alert" as a valid enum and Alerting plugin might not accept XYZ as an entity type so the enum is just overloaded and would end up causing more validations in each plugin irrespective of its presence here
… strings Signed-off-by: Dennis Toepker <[email protected]>
Signed-off-by: Dennis Toepker <[email protected]>
@@ -19,16 +19,17 @@ import java.time.Instant | |||
data class Comment( | |||
val id: String = NO_ID, |
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.
could you add Writeable & XContent tests for comment model?
https://github.com/opensearch-project/common-utils/blob/main/src/test/kotlin/org/opensearch/commons/alerting/model/WriteableTests.kt
https://github.com/opensearch-project/common-utils/blob/main/src/test/kotlin/org/opensearch/commons/alerting/model/XContentTests.kt
Signed-off-by: Dennis Toepker <[email protected]>
Signed-off-by: Dennis Toepker <[email protected]>
Signed-off-by: Dennis Toepker <[email protected]>
CIs blocked because job runners are unavailable, local build output:
|
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/common-utils/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/common-utils/backport-2.x
# Create a new branch
git switch --create backport-671-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 573cbf2241c1ccc018818b5940e141e6065d827e
# Push it to GitHub
git push --set-upstream origin backport-671-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/common-utils/backport-2.x Then, create a pull request where the |
* adding entityType to Comment model * updated tests * removing EntityType enum class, entity type in documents will just be strings * fixed unit tests * adding tests and release notes * moved comment test to WriteableTests * updated writeable test --------- Signed-off-by: Dennis Toepker <[email protected]> Co-authored-by: Dennis Toepker <[email protected]>
* adding entityType to Comment model * updated tests * removing EntityType enum class, entity type in documents will just be strings * fixed unit tests * adding tests and release notes * moved comment test to WriteableTests * updated writeable test --------- Signed-off-by: Dennis Toepker <[email protected]> Co-authored-by: Dennis Toepker <[email protected]> (cherry picked from commit 841fd4d) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* adding entityType to Comment model * updated tests * removing EntityType enum class, entity type in documents will just be strings * fixed unit tests * adding tests and release notes * moved comment test to WriteableTests * updated writeable test --------- (cherry picked from commit 841fd4d) Signed-off-by: Dennis Toepker <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Dennis Toepker <[email protected]>
Description
This is an extension to the following PR: #663
Issues Resolved
[List any issues this PR will resolve]
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.