-
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
[Backport 2.x] populate time fields for connectors on return (#2922) #3035
Merged
dhrubo-os
merged 1 commit into
opensearch-project:2.x
from
brianf-aws:backport/backport-2922-to-2.x
Oct 3, 2024
Merged
[Backport 2.x] populate time fields for connectors on return (#2922) #3035
dhrubo-os
merged 1 commit into
opensearch-project:2.x
from
brianf-aws:backport/backport-2922-to-2.x
Oct 3, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* populate time fields for connectors on return fixes opensearch-project#2890 Currently any class that extends the AbstractConnector class has the fields createdTime and lastUpdatedTime set to null. The solution was instantiating the fields in the constructor of the AbstractConnector class, as well updating it within the HTTPConnector class whenever an update happens. Many tests were modified to catch the time fields being populated as such there will be many differences on the string in order to get around the timing issue when doing tests. Signed-off-by: Brian Flores <[email protected]> * fixes backward compatability issues with old connectors fixes opensearch-project#2890 when applying a code change like this previous connectors would have a weird bug where upon calling GET on them would change the timestamp. In this commit, it remains the old connectors without time fields while new ones have time fields, newer connectors will have correct and updated Timestamp. Manual testing was done on a local cluster and two unit tests were done to inspect the time changes on creation and update Signed-off-by: Brian Flores <[email protected]> * fix failing MLRegisterModelInutTest.testToXContent tests Originally this commit was cherry picked from the 2.x branch and as such code changes affected the new build that werent caught on the previous commit 8c006de. Reformatted tests that were failing as the behavior implemented in previous commits was to not display time fields if a connector does not have them in the first place. gradlew build was done to assure the tests passed Signed-off-by: Brian Flores <[email protected]> * Reverts back model tests that were modified incorrectly by connector change When creating a code change to the connector it propagated the new change of the object that affected many UTs, but after changing the logic of indexing the new connector, change the old changes for the unit test involving models with connectors had to be reverted back. UTs specifically for the indexed connectors have been created in UpdateConnectorTransportActionTests were done to capture this Signed-off-by: Brian Flores <[email protected]> * Adds lastUpdateTime to Old Connectors Previoulsy we didnt consider the old connectors to have time fields at all, But given offline discussion if we add time fields to old connectors users could get more information moving forward without breaking any backward features. The solution to this was setting the last updated time in the update connector api; now moving forward any connector gets attached a last updated time field. I updated the testUpdateConnectorDoesNotUpdateHTTPCOnnectorTimeFields method to check that lastUpdateTime has a timestamp but that createdTime has no time field. Signed-off-by: Brian Flores <[email protected]> * Fixes wildcard import in UpdateConnectorTransportActionTests Signed-off-by: Brian Flores <[email protected]> --------- Signed-off-by: Brian Flores <[email protected]> (cherry picked from commit 88eaefd)
brianf-aws
requested review from
b4sjoo,
dhrubo-os,
jngz-es,
model-collapse,
rbhavna,
ylwu-amzn,
zane-neo,
Zhangxunmt,
austintlee,
HenryL27 and
sam-herman
as code owners
October 2, 2024 00:18
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 00:19 — with
GitHub Actions
Inactive
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 00:19 — with
GitHub Actions
Inactive
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 00:19 — with
GitHub Actions
Inactive
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 00:19 — with
GitHub Actions
Inactive
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 00:19 — with
GitHub Actions
Inactive
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 00:19 — with
GitHub Actions
Inactive
mingshl
approved these changes
Oct 2, 2024
jngz-es
approved these changes
Oct 2, 2024
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 18:10 — with
GitHub Actions
Inactive
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 18:10 — with
GitHub Actions
Inactive
brianf-aws
temporarily deployed
to
ml-commons-cicd-env-require-approval
October 2, 2024 18:10 — with
GitHub Actions
Inactive
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Manual backport due to conflict #2922 (The commit that caused the backport merge conflict)
Related Issues
Resolves #2890 (the initial PR that brought up the bug)
Testing
./gradlew build
passes on thebackport/backport-2922-to-2.x
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.