-
Notifications
You must be signed in to change notification settings - Fork 107
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
SnapshotDeleteRequest use []string instead of string #237
SnapshotDeleteRequest use []string instead of string #237
Conversation
aba54d3
to
51631fc
Compare
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.
Thank you for this fix @Jakob3xD! Can you also add a test for the same?
@VachaShah Are there any existing tests I can orientate on that handle snapshots or maybe something else, so I can see how you want the tests to look like and what structure they should have? |
@Jakob3xD All the API tests currently exist in opensearchapi_integration_test.go. |
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.
This is a breaking change for the client. Can we avoid it and have both versions of string
and string[]
and implement the former using the latter everywhere one may want to pass a single item?
This is a breaking change but only because this was wrong in the first place. I should have opened my issue as bug and not as feature. IMO it is also easier to convert a string to []string by just doing |
@Jakob3xD You're right, still before I merge, is there a way to make the change backwards compatible? Does it make any sense to have two fields Rebase please, I'm ok merging this otherwise. Do we have the same problem elsewhere? |
51631fc
to
d08fffd
Compare
@dblock IMO it does not make sense to have both fields as it add unneeded overhead. I did't find more problems with wrong types. @VachaShah to add integration tests for snapshots, I need to create a snapshot repository which would require setting path.repo in Opensearch and I am not sure how this is done in the github workflows. If you can help me enabling this in the CI I would add integration tests for:
|
Thanks @Jakob3xD for hanging in here with me. FYI, I am not trying to be difficult, I just want to make sure we are doing the right thing.
|
I understand your point. It wouldn´t make sens to do a mayor release for this. Maybe we keep this PR back until the next mayor release? As sad I am happy to write the tests. The only thing I need help with is setting the path.repo in the Opensearch config so I can create the snapshot repository. |
Sure, but what's the reason not to add a backwards compatible version, and marking the wrong interface deprecated?
I am not sure how this works, give something a try and we'll help you when you get blocked? |
Today, people might be sending in a comma-joined string like Maybe we create a v3 branch of the client today and add this there, while marking the current type declaration as deprecated in the v2 client. I kind of agree with @Jakob3xD that adding an alternative function with the new type is a bit of overhead. We would carry around |
Hi @Jakob3xD sorry for the delay! As @dblock mentioned, atleast unit testing would be good to add where it mocks the server. For integration tests, how about adding the path.repo to the docker file which spins up OpenSearch cluster in the CI? |
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
5cc4697
to
1921267
Compare
@VachaShah I added some integration tests for Snapshot functions and added the setting to the docker file. |
Assuming the new integration tests work, I think we should make this as a breaking change and take #246 along the way and major increment the client version. I don't think we need to maintain and continue releasing the old line either. |
I think we should introduce an UPGRADING.md in this project similar to https://github.com/opensearch-project/opensearch-py/blob/main/UPGRADING.md that will spell breaking changes. Want to add one as part of this PR @Jakob3xD? |
The integration test with unrelased Opensearch fails, as the path setting is missing. If i see it correctly it builds opensearch from source and starts without any given settings. The normal Integration tests with docker works fine. Should I try adding the setting to the workflow https://github.com/opensearch-project/opensearch-go/blob/main/.github/workflows/test-integration-unreleased.yml#L52 ? @dblock Yes, I will add the file. |
Yes, do whatever you need to do to get a green build! |
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
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 think we need to also add 3.0 to https://github.com/opensearch-project/opensearch-go/blob/main/COMPATIBILITY.md.
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 am good with this change!
@wbeckler This is the first time we're diverging a client version per semver with the server. Any concerns?
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
ce93e58
to
0a333d7
Compare
@Jakob3xD looks like integration tests are failing :( care to take a look please? |
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
9b51d13
to
8825feb
Compare
opensearch-project#237 Signed-off-by: Vacha Shah <vachshah@amazon.com>
opensearch-project#237 Signed-off-by: Vacha Shah <vachshah@amazon.com>
#322) * Revert "Draft: Add Err() function to Response for detailed errors (#246)" This reverts commit 8d3cf4d. Signed-off-by: Vacha Shah <vachshah@amazon.com> * Fixing PIT APIs introduced in PR #253 since they use response.Err() Signed-off-by: Vacha Shah <vachshah@amazon.com> * Removing opensearchapi.Error usage from snapshot tests introduced in PR #237 Signed-off-by: Vacha Shah <vachshah@amazon.com> * Resolve Changelog conflicts Signed-off-by: Vacha Shah <vachshah@amazon.com> --------- Signed-off-by: Vacha Shah <vachshah@amazon.com>
opensearch-project#322) * Revert "Draft: Add Err() function to Response for detailed errors (opensearch-project#246)" This reverts commit 8d3cf4d. Signed-off-by: Vacha Shah <vachshah@amazon.com> * Fixing PIT APIs introduced in PR opensearch-project#253 since they use response.Err() Signed-off-by: Vacha Shah <vachshah@amazon.com> * Removing opensearchapi.Error usage from snapshot tests introduced in PR opensearch-project#237 Signed-off-by: Vacha Shah <vachshah@amazon.com> * Resolve Changelog conflicts Signed-off-by: Vacha Shah <vachshah@amazon.com> --------- Signed-off-by: Vacha Shah <vachshah@amazon.com>
#322) (#384) * Revert "Draft: Add Err() function to Response for detailed errors (#246)" This reverts commit 8d3cf4d. * Fixing PIT APIs introduced in PR #253 since they use response.Err() * Removing opensearchapi.Error usage from snapshot tests introduced in PR #237 * Resolve Changelog conflicts --------- Signed-off-by: Vacha Shah <vachshah@amazon.com>
Description
SnapshotDeleteRequest use []string instead of string
Issues Resolved
Closes 236
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.