-
Notifications
You must be signed in to change notification settings - Fork 138
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
fix breaking changes in config index fields #2882
Conversation
Signed-off-by: Bhavana Ramaram <[email protected]>
@@ -42,55 +42,93 @@ public class MLConfig implements ToXContentObject, Writeable { | |||
@Setter | |||
private String type; | |||
|
|||
@Setter | |||
private String configType; |
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.
Add some comment like this is a new field to replace type
field ?
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeOptionalString(type); | ||
out.writeOptionalString(configType); |
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.
Should we consider OS versions ?
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.
Yeah I think so. There are going to be like completely new fields now. Not replacing the old ones
Signed-off-by: Bhavana Ramaram <[email protected]>
out.writeBoolean(false); | ||
} | ||
} | ||
out.writeOptionalInstant(lastUpdatedTime); |
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.
Why not add this new field to if block above?
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.
sure, missed it somehow
Signed-off-by: Bhavana Ramaram <[email protected]>
if (type != null) { | ||
builder.field(CONFIG_TYPE_FIELD, type); | ||
builder.field(TYPE_FIELD, type); | ||
} | ||
if (configType != null) { | ||
builder.field(CONFIG_TYPE_FIELD, configType); | ||
} | ||
if (configuration != null) { | ||
builder.field(ML_CONFIGURATION_FIELD, configuration); | ||
builder.field(CONFIGURATION_FIELD, configuration); | ||
} | ||
if (mlConfiguration != null) { | ||
builder.field(ML_CONFIGURATION_FIELD, mlConfiguration); |
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.
What happens when ml_configuration
and configuration
are both populated. Same with config_type
and config
? Will this cause any issues in the plugin?
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.
No there wouldn't be any issue but both will be shown in the response.
} | ||
|
||
public MLConfig(StreamInput input) throws IOException { | ||
Version streamInputVersion = input.getVersion(); |
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.
Shouldn't this be optional since it was not there in previous versions for upgrades?
} | ||
|
||
public MLConfig(StreamInput input) throws IOException { | ||
Version streamInputVersion = input.getVersion(); |
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.
Shouldn't this be optional since it was not there in previous versions for upgrades?
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.
I didn't quite get it. This is only to ensure these new fields can be used only on domains starting from 2.15
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.
Oh nevermind, I had made some confusion with the parse function. There should be no issues here.
} | ||
|
||
public MLConfig(StreamInput input) throws IOException { | ||
Version streamInputVersion = input.getVersion(); |
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.
Oh nevermind, I had made some confusion with the parse function. There should be no issues here.
* fix breaking changes in config index fields Signed-off-by: Bhavana Ramaram <[email protected]> (cherry picked from commit cc402b3)
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.15 2.15
# Navigate to the new working tree
cd .worktrees/backport-2.15
# Create a new branch
git switch --create backport/backport-2882-to-2.15
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 cc402b30d317f0830f9baccdf57c1a663f54a538
# Push it to GitHub
git push --set-upstream origin backport/backport-2882-to-2.15
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.15 Then, 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-2.16 2.16
# Navigate to the new working tree
cd .worktrees/backport-2.16
# Create a new branch
git switch --create backport/backport-2882-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 cc402b30d317f0830f9baccdf57c1a663f54a538
# Push it to GitHub
git push --set-upstream origin backport/backport-2882-to-2.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.16 Then, create a pull request where the |
* fix breaking changes in config index fields Signed-off-by: Bhavana Ramaram <[email protected]> (cherry picked from commit cc402b3)
builder.field(TYPE_FIELD, type); | ||
} | ||
if (configType != null) { | ||
builder.field(CONFIG_TYPE_FIELD, configType); |
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 (configType != null || type != null) {
builder.field(TYPE_FIELD, configType == null ? type : configType);
}
* fix breaking changes in config index fields Signed-off-by: Bhavana Ramaram <[email protected]> (cherry picked from commit cc402b3) Co-authored-by: Bhavana Ramaram <[email protected]>
* fix breaking changes in config index fields Signed-off-by: Bhavana Ramaram <[email protected]> (cherry picked from commit cc402b3) Co-authored-by: Bhavana Ramaram <[email protected]>
Description
fix breaking changes in config index fields
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff
.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.