Skip to content
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

Feature: Idiomatic lib #421

Merged
merged 78 commits into from
Nov 18, 2023
Merged

Feature: Idiomatic lib #421

merged 78 commits into from
Nov 18, 2023

Conversation

Jakob3xD
Copy link
Collaborator

@Jakob3xD Jakob3xD commented Nov 9, 2023

Description

  • Adds opensearchapi with new client and function structure
  • Adds integration tests for all opensearchapi functions
  • golangci-lint: update rules and fail when issues are found
  • go: update to golang version 1.20
  • guids: updated to work for the new opensearchapi
  • Test adjusted to new opensearchapi functions and structs
  • Removes all old opensearchapi functions
  • Removes /internal/build code and folders

Issues Resolved

Closes #65

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.

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
…PI type from client

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
…arch

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
dblock
dblock previously approved these changes Nov 16, 2023
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have some nits in UPGRADING, otherwise looks good.

@VachaShah @Xtansia merge?

@@ -46,6 +50,148 @@ reqSnapshots := &opensearchapi.SnapshotDeleteRequest{
Snapshot: sliceSnapshotsToDelete,
```

## Upgrading to >= 3.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably reverse-order them, newest version on top.

UPGRADING.md Outdated
@@ -46,6 +50,148 @@ reqSnapshots := &opensearchapi.SnapshotDeleteRequest{
Snapshot: sliceSnapshotsToDelete,
```

## Upgrading to >= 3.0.0

Version 3.0.0 contains a large restructure of the lib braking all existing implementations.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: breaking

Keep it short?

"Version 3.0 is a major refactor of the client."

UPGRADING.md Outdated

Version 3.0.0 contains a large restructure of the lib braking all existing implementations.

### Client creation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize Titles?

VachaShah
VachaShah previously approved these changes Nov 16, 2023
Copy link
Collaborator

@VachaShah VachaShah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with merging this, @Jakob3xD the version increment will happen in an upcoming PR?

// IndicesCreateReq represents possible options for the index create request
type IndicesCreateReq struct {
Index string
Body io.Reader

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be much more useful if there was a defined struct for the body instead of a generic io.Reader.
Same applies for all other Request structs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it would be useful but this is not my goal with this PR and would make it even more complex to review. I want to make the basic refactor of the lib to the named issue. You could open an issue for that request so we can work on that in the future.

MinCompatibleShardNode string
Preference string
PreFilterShardSize *int
Query string

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if Query can also be defined as a struct instead of leaving it as a string. One possible inspiration could be this one: https://github.com/mottaquikarim/esquerydsl/blob/master/esquerydsl.go

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not my goal for this PR. What you want would be more related to #184 otherwise feel free to open an issue for your request.

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
@Jakob3xD
Copy link
Collaborator Author

I am fine with merging this, @Jakob3xD the version increment will happen in an upcoming PR?

I am not familiar with how the release process works and how the branch creation stuff works.
I would suggest to make the version bump in an separate PR.

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to merge this so we can move forward.

@dblock
Copy link
Member

dblock commented Nov 18, 2023

I am fine with merging this, @Jakob3xD the version increment will happen in an upcoming PR?

I am not familiar with how the release process works and how the branch creation stuff works. I would suggest to make the version bump in an separate PR.

Generally the first change that requires a version bump carries the version bump. In this case this is a major breaking change so we should be incrementing the version. We don't want to increment the version right before the release, because the code is already at the next version. It's fine though, make that change later.

@dblock dblock merged commit 9d56cba into main Nov 18, 2023
87 of 88 checks passed
@dblock dblock deleted the feature/idiomatic branch November 18, 2023 13:41
@dblock
Copy link
Member

dblock commented Nov 18, 2023

Now that it's merged, what's the delta between this code and a major next release @Jakob3xD? Open issues/make PRs! And massive THANK YOU this is a lot of solid work.

@henvic
Copy link
Contributor

henvic commented Nov 22, 2023

Thank you! That's excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants