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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
7e097e3
Update golangci-lint config
Jakob3xD Jul 21, 2023
fcfebeb
opensearch: Add type Request
Jakob3xD May 10, 2023
a0c6675
opensearch: Add type Response
Jakob3xD May 10, 2023
bf2d0a2
opensearch: Remove test for ElasticearchURL env
Jakob3xD May 10, 2023
4b157fa
opensearch: add Do() func to client, remove elastic url env, remove A…
Jakob3xD May 10, 2023
538a712
opensearch.go: remove init func, add err vars, solve linting complains
Jakob3xD Jul 26, 2023
d2bc6ec
go: Update to 1.20
Jakob3xD May 10, 2023
ed84c1e
opensearch: Add BuildRequest function
Jakob3xD Jun 11, 2023
161c805
opensearchapi: Remove all old api files
Jakob3xD Jun 23, 2023
92cafac
opensearchapi: Add api,error and inspect file
Jakob3xD Jul 19, 2023
1d469d6
opensearchapi: Add internal package
Jakob3xD Jul 27, 2023
b60390b
opensearchapi: add catClient
Jakob3xD Jul 19, 2023
45eb315
opensearchapi: Add Bulk
Jakob3xD Jun 23, 2023
339178e
opensearchapi: Add Info
Jakob3xD Jun 23, 2023
89a4b86
opensearchapi: Add Index
Jakob3xD Jun 23, 2023
1cd5af7
opensearchapi: Add Search
Jakob3xD Jun 23, 2023
9ce341d
opensearchapi: Add indices create,delete,exists
Jakob3xD Jul 4, 2023
c752b28
opensearchapi: Add missing indices endpoints
Jakob3xD Sep 7, 2023
2fbfbc2
opensearchapi: add nodes client
Jakob3xD Jul 10, 2023
72d2198
opensearchutil: Adjust bulk_indexer to new opensearchapi functions
Jakob3xD Jul 4, 2023
c956859
tests: Adjust to new openearchapi client and functions
Jakob3xD Jul 4, 2023
cc6d9bb
DEVELOPDER_GUID: Update links and go version
Jakob3xD Jul 20, 2023
a4bc434
internal: Remove build
Jakob3xD Jul 21, 2023
d631ed8
opensearchutil: Solve linting complains
Jakob3xD Jul 26, 2023
df78fae
internal: Solve linting complains
Jakob3xD Jul 26, 2023
7d3784b
opensearch: Solve linting complains
Jakob3xD Jul 26, 2023
9702cf9
Update USER_GUIDE
Jakob3xD Jul 28, 2023
e39d30a
signer: Add missing comment to SignRequest func
Jakob3xD Jul 31, 2023
07f4888
opensearchapi: Add cluster client
Jakob3xD Aug 10, 2023
7e4a3d4
opensearchapi: init sub clients of indices
Jakob3xD Sep 7, 2023
87e1217
opensearchapi: add dangling client and functions
Jakob3xD Sep 13, 2023
20290d9
opensearchapi: add script client and functions
Jakob3xD Sep 13, 2023
a7d311e
opensearchapi: add dangling and skipt client to root client
Jakob3xD Sep 13, 2023
9d34331
opensearchapi: add document client
Jakob3xD Sep 13, 2023
c02d164
opensearchapi: add documentClient to rootClient
Jakob3xD Sep 19, 2023
a30d160
opensearchapi: add component template client
Jakob3xD Sep 19, 2023
a2e9320
opensearchapi: add index template client
Jakob3xD Sep 19, 2023
5706aee
opensearchapi: add datastream client
Jakob3xD Sep 19, 2023
328517e
opensearchapi: add indexTemplate,componentTemplate,dataStream clinets…
Jakob3xD Sep 19, 2023
56eb3ff
opensearchapi: add template client
Jakob3xD Sep 20, 2023
455cdb9
opensearchapi: add template client to root client
Jakob3xD Sep 20, 2023
ca04199
opensearchapi: add aliases to root client
Jakob3xD Sep 20, 2023
28585d4
opensearchapi: add ping function to root client
Jakob3xD Sep 21, 2023
9d1f5b6
opensearchapi: add pointInTimeClient
Jakob3xD Sep 21, 2023
9cd2f1a
opensearchapi: add pointInTimeClient to rootClient
Jakob3xD Sep 21, 2023
f08fb7b
opensearchapi: add ingestClient
Jakob3xD Sep 22, 2023
4674dba
opensearchapi: add ingestClient to rootClient
Jakob3xD Sep 22, 2023
0649f18
opensearchapi: Add reindex funtion to rootClient
Jakob3xD Sep 28, 2023
d305d08
opensearchapi: Add tasksClient
Jakob3xD Sep 28, 2023
a368370
opensearchapi: add tasksClient to rootClient
Jakob3xD Sep 28, 2023
f57f7a9
opensearchapi: add mget function to rootClient
Jakob3xD Sep 29, 2023
1b3375a
opensearchapi: add msearch function to rootClient
Jakob3xD Sep 29, 2023
7788dbe
opensearchapi: add msearch template function to rootClient
Jakob3xD Sep 29, 2023
13cccff
opensearchapi: add mtermvercors function to rootClient
Jakob3xD Oct 10, 2023
fa48793
opensearchapi: add rank_eval function to rootClient
Jakob3xD Oct 10, 2023
6a1c9b7
opensearchapi: add reindex rethrottle function to rootClient
Jakob3xD Oct 11, 2023
a6c12b6
opensearchapi: add render search template function to rootClient
Jakob3xD Oct 12, 2023
5030aaf
opensearchapi: add scrollClient
Jakob3xD Oct 13, 2023
4c37d6c
opensearchapi: add scrollClient to rootClient
Jakob3xD Oct 13, 2023
7c0c08e
opensearchapi: add ResponseShards struct
Jakob3xD Oct 13, 2023
ba53970
Makefile: Update golangci-lint version
Jakob3xD Oct 25, 2023
2f4e556
opensearchtransport: solve linting complains
Jakob3xD Oct 25, 2023
09dbccd
signer: solve linting complains
Jakob3xD Oct 25, 2023
72a3165
opensearchapi: add _search_shards function to rootClient
Jakob3xD Oct 25, 2023
471eb90
opensearchapi: add search/template function to rootClient
Jakob3xD Oct 25, 2023
e9fa4a1
opensearchapi: add snapshotClient
Jakob3xD Oct 26, 2023
c2f0a90
opensearchapi: add snapshotClient to rootClient
Jakob3xD Oct 26, 2023
0a10255
opensearchapi: add termvactor function to rootClient
Jakob3xD Oct 26, 2023
5234fb2
opensearchapi: add update function to rootClient
Jakob3xD Oct 27, 2023
34a8b1f
opensearchapi: add update_by_query function to rootClient
Jakob3xD Nov 3, 2023
7ab0c61
opensearchapi: add UpdateByQueryRethrottle function to rootClient
Jakob3xD Nov 6, 2023
0ca5bd0
guids: updated to new opensearchapi functions
Jakob3xD Nov 9, 2023
b60573d
changelog: add changes
Jakob3xD Nov 9, 2023
8605077
workflows: Skip json compare for integ test against unreleased opense…
Jakob3xD Nov 10, 2023
f5c9743
opensearchapi: update license header
Jakob3xD Nov 14, 2023
a2343e1
github: update license header txt
Jakob3xD Nov 15, 2023
0993615
github: remove govulncheck workflow
Jakob3xD Nov 15, 2023
cc1095a
UPGRADING: add differences of 3.0.0 release
Jakob3xD Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .github/license-header.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@
// The OpenSearch Contributors require contributions made to
// this file be licensed under the Apache-2.0 license or a
// compatible open source license.
//
// Modifications Copyright OpenSearch Contributors. See
// GitHub history for details.
14 changes: 0 additions & 14 deletions .github/workflows/govulncheck.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/test-integration-unreleased.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
- name: Integration test
working-directory: go-client
run: make test-integ race=true
env:
OPENSEARCH_GO_SKIP_JSON_COMPARE: true
dblock marked this conversation as resolved.
Show resolved Hide resolved

- name: Save server logs
if: failure()
Expand Down
25 changes: 18 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
run:
timeout: 10m
modules-download-mode: readonly
issues-exit-code: 0

linters-settings:
errcheck:
Expand Down Expand Up @@ -37,11 +36,21 @@ linters-settings:
check-exported: true
misspell:
locale: US
ignore-words: expect
ignore-words:
- expect
- cancelled
prealloc:
simple: true
range-loops: true
for-loops: false
revive:
rules:
- name: exported
severity: error
disabled: false
arguments:
- "checkPrivateReceivers"
- "sayRepetitiveInsteadOfStutters"

linters:
disable-all: true
Expand Down Expand Up @@ -76,7 +85,6 @@ linters:
- gofumpt
- goheader
- goimports
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
Expand Down Expand Up @@ -124,16 +132,18 @@ linters:
- zerologlint

issues:
include:
- EXC0012
- EXC0014
exclude-rules:
- path: _test\.go
- path: (_test\.go|opensearchapi/internal)
linters:
- cyclop
- dupl
- errcheck
- gochecknoglobals
- gochecknoinits
- goconst
- gomnd
- noctx
- linters:
- gosec
Expand All @@ -149,16 +159,17 @@ issues:
path: _test\.go
- linters:
- goconst
text: "string `true` has"
path: opensearchapi\/api_
- linters:
- errcheck
text: "Error return value of `debugLogger.Logf` is not checked"
- linters:
- errcheck
- gomnd
- gochecknoglobals
path: opensearchtransport\/logger\.go
- linters:
- nestif
path: opensearchtransport/opensearchtransport.go
- linters:
- dupl
path: (-params\.go|api_indices|api_dangling\.go|api_point_in_time\.go|rethrottle\.go|api_cat-.*\.go)
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Adds `Err()` function to Response for detailed errors ([#246](https://github.com/opensearch-project/opensearch-go/pull/246))
- Adds golangci-lint as code analysis tool ([#313](https://github.com/opensearch-project/opensearch-go/pull/313))
- Adds govulncheck to check for go vulnerablities ([#405](https://github.com/opensearch-project/opensearch-go/pull/405))
- Adds opensearchapi with new client and function structure ([#421](https://github.com/opensearch-project/opensearch-go/pull/421))
- Adds integration tests for all opensearchapi functions ([#421](https://github.com/opensearch-project/opensearch-go/pull/421))

### Changed

Expand All @@ -27,18 +29,25 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Updated Developer guide to include docker build instructions ([#385](https://github.com/opensearch-project/opensearch-go/pull/385))
- Test against version 2.9.0,2.10.0, run tests in all branches, change intergration tests to wait for OpenSearch to start ([#392](https://github.com/opensearch-project/opensearch-go/pull/392))
- Makefile: use docker golangci-lint, run integration test on `.` folder, change coverage generation ([#392](https://github.com/opensearch-project/opensearch-go/pull/392))
- golangci-lint: update rules and fail when issues are found ([#421](https://github.com/opensearch-project/opensearch-go/pull/421))
- go: update to golang version 1.20 ([#421](https://github.com/opensearch-project/opensearch-go/pull/421))
- guids: updated to work for the new opensearchapi ([#421](https://github.com/opensearch-project/opensearch-go/pull/421))
- Test adjusted to new opensearchapi functions and structs ([#421](https://github.com/opensearch-project/opensearch-go/pull/421))

### Deprecated

- Deprecate legacy API /_template ([#390](https://github.com/opensearch-project/opensearch-go/pull/390))

### Removed

- Removes all old opensearchapi functions ([#421](https://github.com/opensearch-project/opensearch-go/pull/421))
- Removes /internal/build code and folders ([#421](https://github.com/opensearch-project/opensearch-go/pull/421))

### Fixed

- Corrects AWSv4 signature on DataStream Stats with no index name specified ([#338](https://github.com/opensearch-project/opensearch-go/pull/338))
- Fixed GetSourceRequest `Source` field and deprecated the `Source` parameter ([#402](https://github.com/opensearch-project/opensearch-go/pull/402))

### Security

[Unreleased]: https://github.com/opensearch-project/opensearch-go/compare/v2.3.0...HEAD
[Unreleased]: https://github.com/opensearch-project/opensearch-go/compare/v2.3.0...HEAD
6 changes: 3 additions & 3 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ Fork [opensearch-project/opensearch-go](https://github.com/opensearch-project/op

### Install Prerequisites

#### Go 1.15
#### Go 1.20

OpenSearch Go Client builds using [Go](https://golang.org/doc/install) 1.15 at a minimum.
OpenSearch Go Client builds using [Go](https://go.dev/doc/install) 1.20 at a minimum.

#### Docker

[Docker](https://docs.docker.com/install/) is required for building some OpenSearch artifacts and executing integration tests.
[Docker](https://docs.docker.com/get-docker/) is required for building some OpenSearch artifacts and executing integration tests.

#### Windows

Expand Down
8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ lint: ## Run lint on the package
@printf "\033[2m→ Running lint...\033[0m\n"
go vet github.com/opensearch-project/opensearch-go/...
go list github.com/opensearch-project/opensearch-go/... | 'grep' -v internal | xargs golint -set_exit_status
@{ \
set -e ; \
trap "test -d ../../../.git && git checkout --quiet go.mod" INT TERM EXIT; \
echo "cd internal/build/ && go vet ./..."; \
cd "internal/build/" && go mod tidy && go mod download && go vet ./...; \
}

package := "prettier"
lint.markdown:
Expand Down Expand Up @@ -218,7 +212,7 @@ cluster.clean: ## Remove unused Docker volumes and networks
docker system prune --volumes --force

linters:
docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/v1.53.3:/root/.cache -w /app golangci/golangci-lint:v1.53.3 golangci-lint run --timeout=5m
docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/v1.54.2:/root/.cache -w /app golangci/golangci-lint:v1.54.2 golangci-lint run --timeout=5m

workflow: ## Run all github workflow commands here sequentially

Expand Down
Loading
Loading