Skip to content

Commit c7a8db5

Browse files
Merge branch 'master' into HZC-7235/change-cloud-url
2 parents fe58513 + 335a32d commit c7a8db5

14 files changed

Lines changed: 153 additions & 146 deletions

.github/java-config.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
JAVA_VERSION=17
2+
JAVA_DISTRIBUTION=temurin

.github/workflows/code_quality.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ on:
88
pull_request:
99

1010
jobs:
11+
node-versions:
12+
uses: ./.github/workflows/get-supported-node-versions.yml
13+
1114
check-code-quality:
1215
name: Check code quality
1316
runs-on: ubuntu-latest
17+
needs: node-versions
1418

1519
steps:
1620
- name: Setup Node.js
1721
uses: actions/setup-node@v4
1822
with:
19-
node-version: 12
23+
node-version: ${{ needs.node-versions.outputs.default-version }}
2024
- name: Checkout code
2125
uses: actions/checkout@v4
2226
- name: Install dependencies

.github/workflows/code_sample_checker.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,46 @@ name: Code sample checker
22
on: pull_request
33

44
jobs:
5+
node-versions:
6+
uses: ./.github/workflows/get-supported-node-versions.yml
7+
58
test-code-samples:
69
name: Check code samples
710
runs-on: ${{matrix.os}}
11+
needs: node-versions
812

913
strategy:
1014
matrix:
1115
os: [ ubuntu-latest, windows-latest ]
1216

1317
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
- name: Read Java Config
21+
shell: bash
22+
run: cat .github/java-config.env >> $GITHUB_ENV
1423
- name: Setup Java
1524
uses: actions/setup-java@v4
1625
with:
17-
java-version: 17
26+
java-version: ${{ env.JAVA_VERSION }}
27+
distribution: ${{ env.JAVA_DISTRIBUTION }}
1828
- name: Setup Node.js
1929
uses: actions/setup-node@v4
2030
with:
21-
node-version: 10
22-
- name: Checkout code
23-
uses: actions/checkout@v4
31+
node-version: ${{ needs.node-versions.outputs.default-version }}
2432
- name: Install dependencies and compile client
2533
run: |
2634
npm install
2735
npm run compile
2836
- name: Check code samples
2937
run: |
3038
npm run check-code-samples
39+
40+
- name: Upload remote controller logs if test run fails
41+
uses: actions/upload-artifact@v4
42+
if: failure()
43+
with:
44+
name: rc-logs-${{ matrix.os }}
45+
path: |
46+
rc_stderr.log
47+
rc_stdout.log

.github/workflows/coverage_runner.yml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,24 @@ jobs:
2525
uses: hazelcast/hazelcast-tpm/membership@main
2626
with:
2727
organization-name: 'hazelcast'
28-
member-name: ${{ github.event.pull_request.head.repo.owner.login }}
28+
member-name: ${{ github.actor }}
2929
token: ${{ secrets.PAT }}
3030

31+
node-versions:
32+
uses: ./.github/workflows/get-supported-node-versions.yml
33+
3134
run-tests:
3235
name: Run Tests on (${{ matrix.os }})
33-
needs: [check_for_membership]
36+
needs:
37+
- check_for_membership
38+
- node-versions
3439
if: github.event_name == 'push' || needs.check_for_membership.outputs.check-result == 'true' || github.event_name == 'workflow_dispatch'
3540
runs-on: ${{ matrix.os }}
3641
strategy:
3742
matrix:
3843
os: [ ubuntu-latest, windows-latest ]
3944

4045
steps:
41-
- name: Setup Java
42-
uses: actions/setup-java@v1
43-
with:
44-
java-version: 17
45-
- name: Setup Node.js
46-
uses: actions/setup-node@v4
47-
with:
48-
node-version: 10
49-
5046
- name: Checkout code for PR
5147
if: github.event_name == 'pull_request_target'
5248
uses: actions/checkout@v4
@@ -63,6 +59,19 @@ jobs:
6359
with:
6460
ref: refs/pull/${{ github.event.inputs.pr_number }}/merge
6561

62+
- name: Read Java Config
63+
shell: bash
64+
run: cat .github/java-config.env >> $GITHUB_ENV
65+
- name: Setup Java
66+
uses: actions/setup-java@v4
67+
with:
68+
java-version: ${{ env.JAVA_VERSION }}
69+
distribution: ${{ env.JAVA_DISTRIBUTION }}
70+
- name: Setup Node.js
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: ${{ needs.node-versions.outputs.default-version }}
74+
6675
- name: Checkout to test artifacts
6776
uses: actions/checkout@v4
6877
with:
@@ -73,6 +82,7 @@ jobs:
7382
- name: Copy certificates JAR to destination with the appropriate name
7483
run: |
7584
cp ${{ github.workspace }}/certs/certs.jar ${{ github.workspace }}/certs.jar
85+
unzip -p ${{ github.workspace }}/certs.jar com/hazelcast/nio/ssl/letsencrypt.jks > test/integration/backward_compatible/parallel/ssl/keystore.jks
7686
7787
- name: Install dependencies and compile client
7888
run: |
@@ -87,23 +97,29 @@ jobs:
8797
8898
- name: Publish results to Codecov for PR coming from hazelcast organization
8999
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request_target' }}
90-
uses: codecov/codecov-action@v3
100+
uses: codecov/codecov-action@v5
91101
with:
102+
token: ${{ secrets.CODECOV_TOKEN }}
92103
files: coverage/lcov.info
93104
override_pr: ${{ github.event.pull_request.number }}
105+
fail_ci_if_error: true
94106

95107
- name: Publish results to Codecov for Push
96108
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'push' }}
97-
uses: codecov/codecov-action@v3
109+
uses: codecov/codecov-action@v5
98110
with:
111+
token: ${{ secrets.CODECOV_TOKEN }}
99112
files: coverage/lcov.info
113+
fail_ci_if_error: true
100114

101115
- name: Publish result to Codecov for PR coming from community
102116
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'workflow_dispatch' }}
103-
uses: codecov/codecov-action@v3
117+
uses: codecov/codecov-action@v5
104118
with:
119+
token: ${{ secrets.CODECOV_TOKEN }}
105120
files: coverage/lcov.info
106121
override_pr: ${{ github.event.inputs.pr_number }}
122+
fail_ci_if_error: true
107123

108124
- name: Upload remote controller logs if test run fails
109125
uses: actions/upload-artifact@v4
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Get supported Node.js versions
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
node-versions:
7+
value: ${{ jobs.get-supported-node-versions.outputs.node-versions }}
8+
default-version:
9+
value: ${{ jobs.get-supported-node-versions.outputs.default-version }}
10+
11+
jobs:
12+
get-supported-node-versions:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
node-versions: ${{ steps.get_versions.outputs.node-versions }}
16+
default-version: ${{ steps.get_versions.outputs.default-version }}
17+
steps:
18+
- name: Get supported Node.js versions
19+
id: get_versions
20+
run: |
21+
# Look for versions that are:
22+
# - Currently supported
23+
# - That are LTS
24+
# - Within LTS date range (i.e. not future LTS)
25+
NODE_VERSIONS=$(curl --silent https://raw.githubusercontent.com/nodejs/Release/main/schedule.json | jq --compact-output '
26+
def today: now | strftime("%Y-%m-%d");
27+
to_entries
28+
| map(select(.value.end > today and .value.lts != null and .value.lts < today))
29+
| [.[0].key, .[-1].key]
30+
| unique
31+
')
32+
33+
echo "node-versions=${NODE_VERSIONS}" >> ${GITHUB_OUTPUT}
34+
# Default to using the newest version
35+
echo "default-version=$(jq -r '.[1]' <<< ${NODE_VERSIONS})" >> ${GITHUB_OUTPUT}

.github/workflows/markdown_link_checker.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ jobs:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v4
8-
- uses: gaurav-nelson/github-action-markdown-link-check@v1
9-
with:
10-
use-quiet-mode: 'yes'
8+
- uses: ruzickap/action-my-markdown-link-checker@v1

.github/workflows/nightly_runner_maintenance.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ on:
44
schedule:
55
- cron: '0 2 */2 * *'
66
jobs:
7+
node-versions:
8+
uses: ./.github/workflows/get-supported-node-versions.yml
9+
710
run-tests:
811
runs-on: ${{ matrix.os }}
12+
needs: node-versions
913
name: Run tests of branch ${{ matrix.branch }} on ${{ matrix.os }} with Node ${{ matrix.nodejs_version }}
1014
strategy:
1115
matrix:
1216
branch: [ 5.0.x, 4.2.x, 4.1.x, 4.0.x ]
1317
os: [ ubuntu-latest, windows-latest ]
14-
nodejs_version: [ 10, 18 ]
18+
nodejs_version: ${{ fromJSON(needs.node-versions.outputs.node-versions) }}
1519
fail-fast: false
1620
steps:
1721
- name: Setup Java
18-
uses: actions/setup-java@v2
22+
uses: actions/setup-java@v4
1923
with:
2024
java-version: 8
2125
distribution: temurin

.github/workflows/nightly_runner_master.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,33 @@ on:
44
schedule:
55
- cron: '0 2 * * *'
66
jobs:
7+
node-versions:
8+
uses: ./.github/workflows/get-supported-node-versions.yml
9+
710
run-tests:
811
runs-on: ${{ matrix.os }}
12+
needs: node-versions
913
name: Run tests of master on ${{ matrix.os }} with Node ${{ matrix.nodejs_version }}
1014
strategy:
1115
matrix:
1216
os: [ ubuntu-latest, windows-latest ]
13-
nodejs_version: [ 10, 18 ]
17+
nodejs_version: ${{ fromJSON(needs.node-versions.outputs.node-versions) }}
1418
fail-fast: false
1519
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
- name: Read Java Config
23+
shell: bash
24+
run: cat .github/java-config.env >> $GITHUB_ENV
1625
- name: Setup Java
17-
uses: actions/setup-java@v2
26+
uses: actions/setup-java@v4
1827
with:
19-
java-version: 17
20-
distribution: temurin
28+
java-version: ${{ env.JAVA_VERSION }}
29+
distribution: ${{ env.JAVA_DISTRIBUTION }}
2130
- name: Setup Node.js
2231
uses: actions/setup-node@v4
2332
with:
2433
node-version: ${{ matrix.nodejs_version }}
25-
- name: Checkout code
26-
uses: actions/checkout@v4
2734
- name: Checkout to test artifacts
2835
uses: actions/checkout@v4
2936
with:
@@ -34,6 +41,7 @@ jobs:
3441
- name: Copy certificates JAR to destination with the appropriate name
3542
run: |
3643
cp ${{ github.workspace }}/certs/certs.jar ${{ github.workspace }}/certs.jar
44+
unzip -p ${{ github.workspace }}/certs.jar com/hazelcast/nio/ssl/letsencrypt.jks > test/integration/backward_compatible/parallel/ssl/keystore.jks
3745
- name: Install dependencies and compile client
3846
run: |
3947
npm install

.husky/pre-commit

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run compile
5-
npm run lint
6-
npm run validate-user-code
4+
# See https://github.com/typicode/husky/issues/1072#issuecomment-1784006332
5+
npm_exec=$([[ $OS == "Windows_NT" ]] && echo "npm.cmd" || echo "npm")
6+
7+
"${npm_exec}" run compile
8+
"${npm_exec}" run lint
9+
"${npm_exec}" run validate-user-code

DOCUMENTATION.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* [5.3. Enabling Redo Operation](#53-enabling-redo-operation)
4040
* [5.4. Setting Connection Timeout](#54-setting-connection-timeout)
4141
* [5.5. Enabling Client TLS/SSL](#55-enabling-client-tlsssl)
42-
* [5.6. Enabling Hazelcast Viridian Discovery](#56-enabling-hazelcast-viridian-discovery)
42+
* [5.6. Enabling Hazelcast Cloud Discovery](#56-enabling-hazelcast-cloud-discovery)
4343
* [5.7. Configuring Backup Acknowledgment](#57-configuring-backup-acknowledgment)
4444
* [5.8. External Client Public Address Discovery](#58-external-client-public-address-discovery)
4545
* [6. Client Connection Strategy](#6-client-connection-strategy)
@@ -699,19 +699,19 @@ When Hazelcast Node.js client serializes an object:
699699

700700
4. If the above check fails, then it checks if it is an instance of one of the default types (see above default types).
701701

702-
5. If the above check fails, then it looks for a user-specified [Custom Serialization](#43-custom-serialization).
702+
5. If the above check fails, then it looks for a user-specified [Custom Serialization](#44-custom-serialization).
703703

704-
6. If the above check fails, it will use the registered [Global Serialization](#44-global-serialization) if one exists.
704+
6. If the above check fails, it will use the registered [Global Serialization](#45-global-serialization) if one exists.
705705

706706
7. If the above check fails, then the Node.js client uses `JSON Serialization` by default.
707707

708708
However, `JSON Serialization` may not be the best way of serialization in terms of performance and interoperability between
709709
the clients in different languages. If you want the serialization to work faster or you use the clients in different languages,
710710
Hazelcast offers its own native serialization methods, such as
711-
[`IdentifiedDataSerializable` Serialization](#41-identifieddataserializable-serialization) and
712-
[`Portable` Serialization](#42-portable-serialization).
711+
[`IdentifiedDataSerializable` Serialization](#42-identifieddataserializable-serialization) and
712+
[`Portable` Serialization](#43-portable-serialization).
713713

714-
Or, if you want to use your own serialization method, you can use [Custom Serialization](#43-custom-serialization).
714+
Or, if you want to use your own serialization method, you can use [Custom Serialization](#44-custom-serialization).
715715

716716
> **NOTE: Hazelcast Node.js client is a TypeScript-based project but JavaScript does not have interfaces. Therefore, some
717717
> interfaces are given to the user by using the TypeScript files that have `.ts` extension. In this guide, implementing an
@@ -1431,10 +1431,10 @@ authentication feature which allows the Node.js clients also to have their priva
14311431
to have their certificate authorities so that the members can know which clients they can trust. See the
14321432
[Mutual Authentication section](#913-mutual-authentication).
14331433

1434-
## 5.6. Enabling Hazelcast Viridian Discovery
1434+
## 5.6. Enabling Hazelcast Cloud Discovery
14351435

14361436
Hazelcast Node.js client can discover and connect to Hazelcast clusters running on
1437-
[Hazelcast Viridian](https://viridian.hazelcast.com/). For this, provide authentication information as `clusterName` and enable cloud
1437+
[Hazelcast Cloud](https://cloud.hazelcast.com/). For this, provide authentication information as `clusterName` and enable cloud
14381438
discovery by setting your `discoveryToken` as shown below.
14391439

14401440
```javascript
@@ -3567,7 +3567,7 @@ results of your query are ready, they are parsed from JSON strings and returned
35673567

35683568
For the purposes of your application, you may want to get rid of the parsing and just work with the raw JSON strings using
35693569
`HazelcastJsonValue` objects. Then, you can configure your client to do so as described in the
3570-
[JSON Serialization](#45-json-serialization) section.
3570+
[JSON Serialization](#46-json-serialization) section.
35713571

35723572
```javascript
35733573
const client = await Client.newHazelcastClient({

0 commit comments

Comments
 (0)