Skip to content

Commit a2705c6

Browse files
authored
Update to use /v2 Module (#99)
* Update to use /v2 * Update readme * Fixup coverage failure * Add tests for v1.2.2 * Exclude queues examples on old versions
1 parent a1f7a65 commit a2705c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+389
-239
lines changed

Diff for: .github/workflows/examples-jakarta-v1.2.2.yaml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Copyright 2023, 2024 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at
3+
# https://oss.oracle.com/licenses/upl.
4+
5+
# ---------------------------------------------------------------------------
6+
# Coherence Go Client GitHub Actions test examples against v23.03+
7+
# and v1.2.2 client
8+
# ---------------------------------------------------------------------------
9+
name: CI-Examples Jakarta - v1.2.2
10+
11+
on:
12+
workflow_dispatch:
13+
push:
14+
branches:
15+
- '*'
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-22.04
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
coherenceVersion:
24+
- 24.09
25+
- 24.09.1-SNAPSHOT
26+
go-version:
27+
- 1.19.x
28+
- 1.20.x
29+
- 1.21.x
30+
- 1.22.x
31+
- 1.23.x
32+
33+
# Checkout the source, we need a depth of zero to fetch all of the history otherwise
34+
# the copyright check cannot work out the date of the files from Git.
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Get Docker Images
41+
shell: bash
42+
run: |
43+
docker pull gcr.io/distroless/java17
44+
uname -a
45+
46+
- name: Set up JDK
47+
uses: actions/setup-java@v4
48+
with:
49+
java-version: '17'
50+
distribution: 'zulu'
51+
52+
- name: Cache Go Modules
53+
uses: actions/cache@v4
54+
with:
55+
path: ~/go/pkg/mod
56+
key: ${{ runner.os }}-go-mods-${{ hashFiles('**/go.sum') }}
57+
restore-keys: |
58+
${{ runner.os }}-go-mods-
59+
60+
- name: Cache Maven packages
61+
uses: actions/cache@v4
62+
with:
63+
path: ~/.m2
64+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
65+
restore-keys: ${{ runner.os }}-m2
66+
67+
- name: Set up Go
68+
uses: actions/setup-go@v5
69+
with:
70+
go-version: '${{ matrix.go-version }}'
71+
72+
- name: Verify Examples
73+
shell: bash
74+
run: |
75+
git checkout v1.2.2
76+
# Change the jib-maven-plugin as this version fails
77+
sed -i.bak 's/<version.plugin.jib>3\.3\.0<\/version.plugin.jib>/<version.plugin.jib>3.4.3<\/version.plugin.jib>/' java/pom.xml
78+
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
79+
COHERENCE_BASE_IMAGE=gcr.io/distroless/java17 COHERENCE_VERSION=${{ matrix.coherenceVersion }} PROFILES=,jakarta,-javax make clean generate-proto build-test-images test-cluster-startup test-examples
80+
make test-cluster-shutdown || true
81+
82+
- uses: actions/upload-artifact@v4
83+
if: failure()
84+
with:
85+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
86+
path: build/_output/test-logs

Diff for: .github/workflows/examples-jakarta.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ jobs:
6868
with:
6969
go-version: '${{ matrix.go-version }}'
7070

71-
- name: Copyright Check
72-
shell: bash
73-
run: |
74-
make copyright
75-
7671
- name: Verify Examples
7772
shell: bash
7873
run: |

Diff for: .github/workflows/examples-v1.2.2.yaml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Copyright 2022, 2024 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at
3+
# https://oss.oracle.com/licenses/upl.
4+
5+
# ---------------------------------------------------------------------------
6+
# Coherence Go Client GitHub Actions test examples against v22.06 versions
7+
# and v1.2.2 client
8+
# ---------------------------------------------------------------------------
9+
name: CI-Examples v22.06 - v1.2.2
10+
11+
on:
12+
workflow_dispatch:
13+
push:
14+
branches:
15+
- '*'
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-22.04
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
coherenceVersion:
24+
- 22.06.11-SNAPSHOT
25+
- 22.06.10
26+
go-version:
27+
- 1.19.x
28+
- 1.20.x
29+
- 1.21.x
30+
- 1.22.x
31+
- 1.23.x
32+
33+
# Checkout the source, we need a depth of zero to fetch all of the history otherwise
34+
# the copyright check cannot work out the date of the files from Git.
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Get Docker Images
41+
shell: bash
42+
run: |
43+
docker pull gcr.io/distroless/java:11
44+
uname -a
45+
46+
- name: Set up JDK
47+
uses: actions/setup-java@v4
48+
with:
49+
java-version: '11'
50+
distribution: 'zulu'
51+
52+
- name: Cache Go Modules
53+
uses: actions/cache@v4
54+
with:
55+
path: ~/go/pkg/mod
56+
key: ${{ runner.os }}-go-mods-${{ hashFiles('**/go.sum') }}
57+
restore-keys: |
58+
${{ runner.os }}-go-mods-
59+
60+
- name: Cache Maven packages
61+
uses: actions/cache@v4
62+
with:
63+
path: ~/.m2
64+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
65+
restore-keys: ${{ runner.os }}-m2
66+
67+
- name: Set up Go
68+
uses: actions/setup-go@v5
69+
with:
70+
go-version: '${{ matrix.go-version }}'
71+
72+
- name: Verify Examples
73+
shell: bash
74+
run: |
75+
git checkout v1.2.2
76+
# Change the jib-maven-plugin as this version fails
77+
sed -i.bak 's/<version.plugin.jib>3\.3\.0<\/version.plugin.jib>/<version.plugin.jib>3.4.3<\/version.plugin.jib>/' java/pom.xml
78+
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
79+
COHERENCE_VERSION=${{ matrix.coherenceVersion }} PROFILES=,-jakarta,javax make clean generate-proto build-test-images test-cluster-startup test-examples
80+
make test-cluster-shutdown || true
81+
82+
- uses: actions/upload-artifact@v4
83+
if: failure()
84+
with:
85+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
86+
path: build/_output/test-logs

Diff for: .github/workflows/examples.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022, 2023 Oracle Corporation and/or its affiliates.
1+
# Copyright 2022, 2024 Oracle Corporation and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at
33
# https://oss.oracle.com/licenses/upl.
44

@@ -68,11 +68,6 @@ jobs:
6868
with:
6969
go-version: '${{ matrix.go-version }}'
7070

71-
- name: Copyright Check
72-
shell: bash
73-
run: |
74-
make copyright
75-
7671
- name: Verify Examples
7772
shell: bash
7873
run: |

Diff for: Makefile

+11-24
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# ----------------------------------------------------------------------------------------------------------------------
99

1010
# This is the version of the coherence-go-client
11-
VERSION ?=2.0.0
11+
VERSION ?=2.0.0-rc1
1212
CURRDIR := $(shell pwd)
1313
USER_ID := $(shell echo "`id -u`:`id -g`")
1414

@@ -271,7 +271,7 @@ trivy-scan: gettrivy ## Scan the CLI using trivy
271271
test: test-clean gotestsum $(BUILD_PROPS) ## Run the unit tests
272272
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/coherence-test.xml \
273273
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-unit.out ./coherence/...
274-
go tool cover -html=$(COVERAGE_DIR)/cover-unit.out -o $(COVERAGE_DIR)/cover-unit.html
274+
go tool cover -func=$(COVERAGE_DIR)/cover-unit.out | grep -v '0.0%'
275275

276276

277277
# ----------------------------------------------------------------------------------------------------------------------
@@ -280,48 +280,35 @@ test: test-clean gotestsum $(BUILD_PROPS) ## Run the unit tests
280280
.PHONY: test-e2e-standalone
281281
test-e2e-standalone: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coherence
282282
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/go-client-test.xml \
283-
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional.out -v ./test/e2e/standalone/... -coverpkg=./coherence/...
284-
go tool cover -html=$(COVERAGE_DIR)/cover-functional.out -o $(COVERAGE_DIR)/cover-functional.html
285-
@echo
286-
@echo "**** CODE COVERAGE ****"
287-
@cat $(COVERAGE_DIR)/cover-functional.html | grep 'github.com/oracle/coherence-go-client/coherence' | grep option | sed 's/^.*github/github/' | sed 's,</option.*,,'
283+
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional.out -v ./test/e2e/standalone/... -coverpkg=github.com/oracle/coherence-go-client/v2/coherence/...
284+
go tool cover -func=$(COVERAGE_DIR)/cover-functional.out | grep -v '0.0%'
288285

289286
# ----------------------------------------------------------------------------------------------------------------------
290287
# Executes the Go end to end tests for standalone Coherence with Scope set
291288
# ----------------------------------------------------------------------------------------------------------------------
292289
.PHONY: test-e2e-standalone-scope
293290
test-e2e-standalone-scope: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coherence with Scope set
294291
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/go-client-test-scope.xml \
295-
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-scope.out -v ./test/e2e/scope/... -coverpkg=./coherence/...
296-
go tool cover -html=$(COVERAGE_DIR)/cover-functional-scope.out -o $(COVERAGE_DIR)/cover-functional-scope.html
297-
@echo
298-
@echo "**** CODE COVERAGE ****"
299-
@cat $(COVERAGE_DIR)/cover-functional-scope.html | grep 'github.com/oracle/coherence-go-client/coherence' | grep option | sed 's/^.*github/github/' | sed 's,</option.*,,'
292+
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-scope.out -v ./test/e2e/scope/... -coverpkg=github.com/oracle/coherence-go-client/v2/coherence/...
293+
go tool cover -func=$(COVERAGE_DIR)/cover-functional-scope.out | grep -v '0.0%'
300294

301295
# ----------------------------------------------------------------------------------------------------------------------
302296
# Executes the Go end to end tests for standalone Coherence with Queues
303297
# ----------------------------------------------------------------------------------------------------------------------
304298
.PHONY: test-e2e-standalone-queues
305299
test-e2e-standalone-queues: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coherence queues
306300
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/go-client-test-queues.xml \
307-
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-queues.out -v ./test/e2e/queues/... -coverpkg=./coherence/...
308-
go tool cover -html=$(COVERAGE_DIR)/cover-functional-queues.out -o $(COVERAGE_DIR)/cover-functional-queues.html
309-
@echo
310-
@echo "**** CODE COVERAGE ****"
311-
@cat $(COVERAGE_DIR)/cover-functional-queues.html | grep 'github.com/oracle/coherence-go-client/coherence' | grep option | sed 's/^.*github/github/' | sed 's,</option.*,,'
301+
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-queues.out -v ./test/e2e/queues/... -coverpkg=github.com/oracle/coherence-go-client/v2/coherence/...
302+
go tool cover -func=$(COVERAGE_DIR)/cover-functional-queues.out | grep -v '0.0%'
312303

313304
# ----------------------------------------------------------------------------------------------------------------------
314305
# Executes the Go end to end tests for gRPC v1 tests
315306
# ----------------------------------------------------------------------------------------------------------------------
316307
.PHONY: test-v1-base
317308
test-v1-base: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coherence
318309
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/go-client-test-v1.xml \
319-
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-v1.out -v ./test/v1/base/... -coverpkg=./coherence/...
320-
go tool cover -html=$(COVERAGE_DIR)/cover-functional-v1.out -o $(COVERAGE_DIR)/cover-functional-v1.html
321-
@echo
322-
@echo "**** CODE COVERAGE ****"
323-
@cat $(COVERAGE_DIR)/cover-functional-v1.html | grep 'github.com/oracle/coherence-go-client/coherence' | grep option | sed 's/^.*github/github/' | sed 's,</option.*,,'
324-
310+
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-v1.out -v ./test/v1/base/... -coverpkg=github.com/oracle/coherence-go-client/v2/coherence/...
311+
go tool cover -func=$(COVERAGE_DIR)/cover-functional-v1.out | grep -v '0.0%'
325312

326313
# ----------------------------------------------------------------------------------------------------------------------
327314
# Executes the test of the examples
@@ -369,7 +356,7 @@ test-coherence-shutdown: ## shutdown standalone cluster
369356
.PHONY: gotestsum
370357
GOTESTSUM = $(TOOLS_BIN)/gotestsum
371358
gotestsum: ## Download gotestsum locally if necessary.
372-
GOBIN=`pwd`/build/tools/bin go install gotest.tools/gotestsum@v1.8.1
359+
GOBIN=`pwd`/build/tools/bin go install gotest.tools/gotestsum@v1.12.0
373360

374361
# ----------------------------------------------------------------------------------------------------------------------
375362
# Cleans the test cache

Diff for: README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ docker run -d -p 1408:1408 -p 30000:30000 ghcr.io/oracle/coherence-ce:24.09
5050
```bash
5151
go get github.com/oracle/coherence-go-client@latest
5252
````
53-
After executing this command coherence-go-client is ready to use, and it's source will be in:
53+
54+
> Note: If you wish to use the latest v2.0.0-rc1, please use the following:
5455

5556
```bash
56-
$GOPATH/pkg/mod/github.com/oracle/coherence-go-client@version
57-
```
57+
go get github.com/oracle/coherence-go-client/v2@v2.0.0-rc1
58+
````
5859
5960
## <a name="doc"></a>Documentation
6061
@@ -72,6 +73,8 @@ issues `Put()`, `Get()` and `Size()` operations.
7273
7374
> Note: Keys and values can also be Go `structs`. See detailed examples [here](examples#basic).
7475
76+
> Note: for v2.0.0-rc1, please import `github.com/oracle/coherence-go-client/v2/coherence`
77+
7578
```go
7679
package main
7780

Diff for: coherence/aggregators/aggregators.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/*
2-
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
2+
* Copyright (c) 2022, 2024 Oracle and/or its affiliates.
33
* Licensed under the Universal Permissive License v 1.0 as shown at
44
* https://oss.oracle.com/licenses/upl.
55
*/
66

77
package aggregators
88

99
import (
10-
"github.com/oracle/coherence-go-client/coherence/extractors"
11-
"github.com/oracle/coherence-go-client/coherence/filters"
12-
"github.com/oracle/coherence-go-client/coherence/processors"
10+
"github.com/oracle/coherence-go-client/v2/coherence/extractors"
11+
"github.com/oracle/coherence-go-client/v2/coherence/filters"
12+
"github.com/oracle/coherence-go-client/v2/coherence/processors"
1313
"math/big"
1414
)
1515

Diff for: coherence/cache.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ package coherence
88

99
import (
1010
"context"
11-
"github.com/oracle/coherence-go-client/coherence/filters"
12-
"github.com/oracle/coherence-go-client/coherence/processors"
13-
pb1 "github.com/oracle/coherence-go-client/proto/v1"
11+
"github.com/oracle/coherence-go-client/v2/coherence/filters"
12+
"github.com/oracle/coherence-go-client/v2/coherence/processors"
13+
pb1 "github.com/oracle/coherence-go-client/v2/proto/v1"
1414
"time"
1515
)
1616

Diff for: coherence/coherence_test_helpers.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ package coherence
88

99
import (
1010
"context"
11-
"github.com/oracle/coherence-go-client/coherence/filters"
12-
pb1 "github.com/oracle/coherence-go-client/proto/v1"
11+
"github.com/oracle/coherence-go-client/v2/coherence/filters"
12+
pb1 "github.com/oracle/coherence-go-client/v2/proto/v1"
1313
"time"
1414
)
1515

Diff for: coherence/common.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ import (
1010
"context"
1111
"errors"
1212
"fmt"
13-
"github.com/oracle/coherence-go-client/coherence/aggregators"
14-
"github.com/oracle/coherence-go-client/coherence/extractors"
15-
"github.com/oracle/coherence-go-client/coherence/filters"
16-
"github.com/oracle/coherence-go-client/coherence/processors"
17-
pb "github.com/oracle/coherence-go-client/proto"
18-
pb1 "github.com/oracle/coherence-go-client/proto/v1"
13+
"github.com/oracle/coherence-go-client/v2/coherence/aggregators"
14+
"github.com/oracle/coherence-go-client/v2/coherence/extractors"
15+
"github.com/oracle/coherence-go-client/v2/coherence/filters"
16+
"github.com/oracle/coherence-go-client/v2/coherence/processors"
17+
pb "github.com/oracle/coherence-go-client/v2/proto"
18+
pb1 "github.com/oracle/coherence-go-client/v2/proto/v1"
1919
"google.golang.org/grpc/codes"
2020
"google.golang.org/grpc/status"
2121
"google.golang.org/protobuf/types/known/wrapperspb"

Diff for: coherence/doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This API fully supports Go Generics and is only supported for use with Go versio
4040
Example:
4141
4242
import (
43-
coherence "github.com/oracle/coherence-go-client/coherence"
43+
coherence "github.com/oracle/coherence-go-client/v2/coherence"
4444
)
4545
4646
...

Diff for: coherence/event.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"context"
1111
"errors"
1212
"fmt"
13-
"github.com/oracle/coherence-go-client/coherence/filters"
14-
"github.com/oracle/coherence-go-client/proto"
13+
"github.com/oracle/coherence-go-client/v2/coherence/filters"
14+
"github.com/oracle/coherence-go-client/v2/proto"
1515
"google.golang.org/grpc/codes"
1616
"google.golang.org/grpc/status"
1717
"io"

0 commit comments

Comments
 (0)