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

Deprecate legacy API #390

Merged
merged 11 commits into from
Oct 16, 2023

Conversation

tannerjones4075
Copy link
Contributor

Description

Deprecated: uses a nonexistent legacy REST API (/_template). In OpenSearch v2.x the correct REST API is /_index_template, which is accessible by the correct method in the following location: opensearchapi/api.indices.put_index_template.go

Issues Resolved

Removing a legacy API that creates confusion among current use of the API

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.

@dblock
Copy link
Member

dblock commented Oct 10, 2023

Looks like some documentation changes came along that you didn't mean to?

If the API doesn't work (users get an error today if they call it?), you can delete it I think. This is why we need to be using a code generator from spec ... is this code generated by any chance?

@tannerjones4075
Copy link
Contributor Author

Are you referring to the code 27-31 for the unneeded documentation? I working on another issue to modify/create the generator #284. To my knowledge, this is not generated code. @VachaShah please correct me if I am wrong?

@VachaShah
Copy link
Collaborator

Are you referring to the code 27-31 for the unneeded documentation? I working on another issue to modify/create the generator #284. To my knowledge, this is not generated code. @VachaShah please correct me if I am wrong?

Yeah for the generator part, this code used to be generated before the fork but not anymore. @tannerjones4075 is working on getting the generator going so these kind of bugs don't crop up.

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 tried to make it clearer.

CHANGELOG.md Outdated Show resolved Hide resolved
opensearchapi/api.indices.put_template.go Outdated Show resolved Hide resolved
@tannerjones4075
Copy link
Contributor Author

@dblock or @VachaShah is this good to merge?

@dblock
Copy link
Member

dblock commented Oct 13, 2023

@dblock or @VachaShah is this good to merge?

No, you need to rebase this PR and it shouldn't include the unrelated docker documentation change, just the deprecated parts. Look at the GitHub diff to make sure you got the right things - let us know if you need help!

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
@dblock dblock changed the title Tannerjones4075 deprecate legacy API Deprecate legacy API Oct 13, 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.

Code LGTM.

Can you explain what "uses a nonexistent legacy REST API (/_template) correct REST API is /_index_template use IndicesPutSettings instead" actually means? When I read it, to me it sounds like these methods use something that doesn't work. What am I missing?

@tannerjones4075
Copy link
Contributor Author

Code LGTM.

Can you explain what "uses a nonexistent legacy REST API (/_template) correct REST API is /_index_template use IndicesPutSettings instead" actually means? When I read it, to me it sounds like these methods use something that doesn't work. What am I missing?

There is a legacy API that currently works but it creates confusion as there is a new API. Deprecating the legacy API that creates confusion among current user will and shift them to the new API. As @Jakob3xD explained that deprecation is correct.

@dblock
Copy link
Member

dblock commented Oct 13, 2023

I'm leaving this to @Jakob3xD to review/merge! Thanks.

Copy link
Collaborator

@Jakob3xD Jakob3xD left a comment

Choose a reason for hiding this comment

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

Can you also please update all the other template files.

  • opensearchapi/api.indices.get_template.go
  • opensearchapi/api.indices.exists_template.go
  • opensearchapi/api.indices.delete_template.go

CHANGELOG.md Outdated Show resolved Hide resolved
opensearchapi/api.indices.put_template.go Outdated Show resolved Hide resolved
tannerjones4075 and others added 5 commits October 16, 2023 07:27
Co-authored-by: Jakob <jakob.hahn@hetzner.com>
Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>
Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
@tannerjones4075
Copy link
Contributor Author

tannerjones4075 commented Oct 16, 2023

Can you also please update all the other template files.

  • opensearchapi/api.indices.get_template.go
  • opensearchapi/api.indices.exists_template.go
  • opensearchapi/api.indices.delete_template.go

I have added the deprecated statement to above locations.

…d back in IndicesExistsTemplate that was delete by mistake

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
@dblock dblock merged commit deb8f64 into opensearch-project:main Oct 16, 2023
47 checks passed
@tannerjones4075 tannerjones4075 deleted the deprecate_legacy_API branch October 16, 2023 17:45
VachaShah pushed a commit to VachaShah/opensearch-go that referenced this pull request Oct 19, 2023
* deprecated legacy REST API /_template

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* deprecated legacy REST API /_template

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* removed deprecated header at the top of the doc

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* added deprecated notes to the CHANGELOG.md

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Corrected deprecation statement

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Jakob <jakob.hahn@hetzner.com>
Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>

* Updated deprecated message on api.indices.put_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.exists_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.delete_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.get_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Updated deprecated message on api.indices.exists_template.go and added back in IndicesExistsTemplate that was delete by mistake

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

---------

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>
Co-authored-by: Jakob <jakob.hahn@hetzner.com>
VachaShah pushed a commit to VachaShah/opensearch-go that referenced this pull request Oct 19, 2023
* deprecated legacy REST API /_template

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* deprecated legacy REST API /_template

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* removed deprecated header at the top of the doc

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* added deprecated notes to the CHANGELOG.md

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Corrected deprecation statement

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Jakob <jakob.hahn@hetzner.com>
Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>

* Updated deprecated message on api.indices.put_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.exists_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.delete_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.get_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Updated deprecated message on api.indices.exists_template.go and added back in IndicesExistsTemplate that was delete by mistake

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

---------

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>
Co-authored-by: Jakob <jakob.hahn@hetzner.com>
Signed-off-by: Vacha Shah <vachshah@amazon.com>
dblock added a commit that referenced this pull request Oct 23, 2023
* tannerjones4075- update developer guide (#385)

* Updating DEVELOPER_GUIDE.md file to include docker build instructions

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Updating DEVELOPER_GUIDE.md file to include docker build instructions

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Updating DEVELOPER_GUIDE.md file and CHANGELOG

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Removed link from localhost:9200

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

---------

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Bump github.com/aws/aws-sdk-go from 1.45.20 to 1.45.24 (#387)

* Bump github.com/aws/aws-sdk-go from 1.45.20 to 1.45.24

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.20 to 1.45.24.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](aws/aws-sdk-go@v1.45.20...v1.45.24)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changelog

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>

* Bump github.com/aws/aws-sdk-go-v2 from 1.21.0 to 1.21.1 (#388)

* Bump github.com/aws/aws-sdk-go-v2 from 1.21.0 to 1.21.1

Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.21.0 to 1.21.1.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@v1.21.0...v1.21.1)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changelog

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>

* Bump github.com/aws/aws-sdk-go-v2/config from 1.18.43 to 1.18.44 (#389)

* Bump github.com/aws/aws-sdk-go-v2/config from 1.18.43 to 1.18.44

Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.43 to 1.18.44.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@config/v1.18.43...config/v1.18.44)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changelog

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>

* Bump golang.org/x/net from 0.7.0 to 0.17.0 (#391)

* Bump golang.org/x/net from 0.7.0 to 0.17.0

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.17.0.
- [Commits](golang/net@v0.7.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changelog

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>

* Update DEVELOPER_GUID, Add Coverage + go ling to Makefile, Run CI tests on all branches (#392)

* .github: run test workflows for all branches, test against 2.9,2.10

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

* Makefile: use docker golangci-lint, run integration test on `.` folder, change coverage generation

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

* Update DEVELOPER_GUIDE

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

---------

Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Updated linter version to 1.54.2 (#394)

* Updated linter version to 1.54.2

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Updated CHANGELOG.md

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Updated CHANGELOG.md

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Updated CHANGELOG.md - moved linter update to Dependencies Bumps

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

---------

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Daniel (dB.) Doubrovkine <dblock@dblock.org>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@dblock.org>
Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Deprecate legacy API (#390)

* deprecated legacy REST API /_template

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* deprecated legacy REST API /_template

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* removed deprecated header at the top of the doc

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* added deprecated notes to the CHANGELOG.md

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Corrected deprecation statement

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Update CHANGELOG.md

Co-authored-by: Jakob <jakob.hahn@hetzner.com>
Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>

* Updated deprecated message on api.indices.put_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.exists_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.delete_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Added deprecated message on api.indices.get_template.go

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

* Updated deprecated message on api.indices.exists_template.go and added back in IndicesExistsTemplate that was delete by mistake

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>

---------

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>
Co-authored-by: Jakob <jakob.hahn@hetzner.com>
Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Bump github.com/aws/aws-sdk-go-v2/config from 1.18.44 to 1.19.0 (#398)

* Bump github.com/aws/aws-sdk-go-v2/config from 1.18.44 to 1.19.0

Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.44 to 1.19.0.
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.19.0/CHANGELOG.md)
- [Commits](aws/aws-sdk-go-v2@config/v1.18.44...v1.19.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changelog

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>

* Bump github.com/aws/aws-sdk-go from 1.45.24 to 1.45.26 (#397)

* Bump github.com/aws/aws-sdk-go from 1.45.24 to 1.45.26

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.24 to 1.45.26.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](aws/aws-sdk-go@v1.45.24...v1.45.26)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update changelog

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>

* Bump client version to 2.4.0

Signed-off-by: Vacha Shah <vachshah@amazon.com>

---------

Signed-off-by: Tanner Jones <alltechguyblog@gmail.com>
Signed-off-by: Vacha Shah <vachshah@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Daniel (dB.) Doubrovkine <dblock@dblock.org>
Signed-off-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>
Co-authored-by: Tanner Jones <78619684+tannerjones4075@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jakob <jakob.hahn@hetzner.com>
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@dblock.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants