You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update `opensearch-go` to use `v5`-native APIs and deprecate v4 primitives.
The previously-previewed generated client is promoted to the canonical
`opensearchapi/` package, the module path moves to `/v5`, and intelligent
request routing plus partial-failure error reporting become the defaults.
### Breaking changes
- **Module path** is now `github.com/opensearch-project/opensearch-go/v5`.
Update import paths from `/v4` to `/v5`; the in-source `opensearchapi.X`
qualifier is unchanged.
- **Canonical `opensearchapi/` is code-generated** by `cmd/osgen` from the
OpenSearch API specification, replacing the hand-written v4 package
(formerly previewed at `v5preview/opensearchapi/`). Field-level deltas
(`DocumentID` -> `ID`, optional `Params` becoming `*Params`, shared params
moving into embedded `TimeoutParams`/`DebugParams`, `BulkResp.Items` becoming
`[]BulkItem`) are documented in `opensearchapi/MIGRATING.md`.
- **Plugin import paths** move to `github.com/opensearch-project/opensearch-go/v5/plugins/<name>`;
generated clients cover all 25 plugins.
- **Default Router is on** unless `OPENSEARCH_GO_ROUTER=false`. In v4 the router
was opt-in.
- **Partial-failure errors are reported by default** (`Config.Errors == nil`
resolves to `errmask.Empty`). Set `errmask.New(errmask.All)` or
`OPENSEARCH_GO_ERROR_MASK` to restore v4-style masking.
### Highlights
- Group document operations under `client.Doc` and point-in-time operations
under `client.PIT`; `client.Document`/`client.PointInTime` remain as aliases.
The indices sub-client is `client.Index` (with `client.Indices`/`Indexes`
aliases). Thin v4-compat forwarders keep top-level `client.Bulk`/`MGet`/`Update`
working.
- Generate query parameters whose value `0` is meaningful (`if_seq_no`/
`if_primary_term` on `delete`/`index`/`update` and the plugin policy writes,
plus `size` on `search`) as `*int` so a deliberate `0` reaches the wire.
- Treat OpenSearch plugin acronyms (ISM/KNN/LTR/ML/PPL/SM/UBI/WLM) as
initialisms so generated identifiers are all-uppercase per Go convention.
- Transport/signer correctness from #859: close error-response bodies, classify
`Perform` body-read errors via a sentinel, drain bodies on raw `RoundTrip`
paths, and close request bodies on signer read errors. `Client.Do` buffers
response payloads into `rawBody` and `Response.String()` is non-consuming.
- Add a `build-samples` Makefile target and CI job so `_samples/*.go` (excluded
from `go build ./...`) can no longer break silently.
### Docs
Migration guidance in `opensearchapi/MIGRATING.md`, `UPGRADING.md`, and the
`guides/` tree; a copy-paste least-privilege cluster role for routing and
discovery in `guides/security.md`.
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](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).
0 commit comments