Skip to content

Commit f43513a

Browse files
committed
Merge branch '4.x' (at 4.17.0) into scylla-4.x
2 parents 4c8eec7 + 95e3f2f commit f43513a

164 files changed

Lines changed: 3672 additions & 767 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 🔬 Snyk cli SCA
2+
3+
on:
4+
push:
5+
branches: [ 4.x ]
6+
pull_request:
7+
branches: [ 4.x ]
8+
workflow_dispatch:
9+
10+
env:
11+
SNYK_SEVERITY_THRESHOLD_LEVEL: high
12+
13+
jobs:
14+
snyk-cli-scan:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Git checkout
18+
uses: actions/checkout@v3
19+
20+
- name: prepare for snyk scan
21+
uses: datastax/shared-github-actions/actions/snyk-prepare@main
22+
23+
- name: Set up JDK 8
24+
uses: actions/setup-java@v3
25+
with:
26+
distribution: 'temurin'
27+
java-version: '8'
28+
cache: maven
29+
30+
- name: run maven install prepare for snyk
31+
run: |
32+
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
33+
34+
- name: snyk scan java
35+
uses: datastax/shared-github-actions/actions/snyk-scan-java@main
36+
with:
37+
directories: .
38+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
39+
SNYK_ORG_ID: ${{ secrets.SNYK_ORG_ID }}
40+
extra-snyk-options: "-DskipTests -Dmaven.javadoc.skip=true"
41+
42+
- name: Snyk scan result
43+
uses: datastax/shared-github-actions/actions/snyk-process-scan-results@main
44+
with:
45+
gh_repo_token: ${{ secrets.GITHUB_TOKEN }}
46+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
47+
SNYK_ORG_ID: ${{ secrets.SNYK_ORG_ID }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 🗑️ Snyk PR cleanup - merged/closed
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- 4.x
9+
workflow_dispatch:
10+
11+
jobs:
12+
snyk_project_cleanup_when_pr_closed:
13+
uses: datastax/shared-github-actions/.github/workflows/snyk-pr-cleanup.yml@main
14+
secrets:
15+
snyk_token: ${{ secrets.SNYK_TOKEN }}
16+
snyk_org_id: ${{ secrets.SNYK_ORG_ID }}

.snyk

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2+
version: v1.22.2
3+
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
4+
ignore:
5+
SNYK-JAVA-ORGGRAALVMSDK-2767964:
6+
- '*':
7+
reason: cannot upgrade to graal-sdk 22.1.0+ until we move off Java8, which is slated for later this year
8+
expires: 2024-01-10T00:00:00.000Z
9+
created: 2023-06-21T00:00:00.000Z
10+
SNYK-JAVA-ORGGRAALVMSDK-2769618:
11+
- '*':
12+
reason: cannot upgrade to graal-sdk 22.1.0+ until we move off Java8, which is slated for later this year
13+
expires: 2024-01-10T00:00:00.000Z
14+
created: 2023-06-21T00:00:00.000Z
15+
SNYK-JAVA-ORGGRAALVMSDK-5457933:
16+
- '*':
17+
reason: cannot upgrade to graal-sdk 22.1.0+ until we move off Java8, which is slated for later this year
18+
expires: 2024-01-10T00:00:00.000Z
19+
created: 2023-06-21T00:00:00.000Z

.snyk.ignore.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2+
version: v1.22.2
3+
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
4+
ignore:
5+
SNYK-PYTHON-URLLIB3-1533435:
6+
- '*':
7+
reason: state your ignore reason here
8+
expires: 2030-01-01T00:00:00.000Z
9+
created: 2022-03-21T00:00:00.000Z

Jenkinsfile

Lines changed: 85 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,66 @@ def initializeEnvironment() {
1818

1919
env.MAVEN_HOME = "${env.HOME}/.mvn/apache-maven-3.3.9"
2020
env.PATH = "${env.MAVEN_HOME}/bin:${env.PATH}"
21+
22+
/*
23+
* As of JAVA-3042 JAVA_HOME is always set to JDK8 and this is currently necessary for mvn compile and DSE Search/Graph.
24+
* To facilitate testing with JDK11/17 we feed the appropriate JAVA_HOME into the maven build via commandline.
25+
*
26+
* Maven command-line flags:
27+
* - -DtestJavaHome=/path/to/java/home: overrides JAVA_HOME for surefire/failsafe tests, defaults to environment JAVA_HOME.
28+
* - -Ptest-jdk-N: enables profile for running tests with a specific JDK version (substitute N for 8/11/17).
29+
*
30+
* Note test-jdk-N is also automatically loaded based off JAVA_HOME SDK version so testing with an older SDK is not supported.
31+
*
32+
* Environment variables:
33+
* - JAVA_HOME: Path to JDK used for mvn (all steps except surefire/failsafe), Cassandra, DSE.
34+
* - JAVA8_HOME: Path to JDK8 used for Cassandra/DSE if ccm determines JAVA_HOME is not compatible with the chosen backend.
35+
* - TEST_JAVA_HOME: PATH to JDK used for surefire/failsafe testing.
36+
* - TEST_JAVA_VERSION: TEST_JAVA_HOME SDK version number [8/11/17], used to configure test-jdk-N profile in maven (see above)
37+
*/
38+
2139
env.JAVA_HOME = sh(label: 'Get JAVA_HOME',script: '''#!/bin/bash -le
2240
. ${JABBA_SHELL}
2341
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
2442
env.JAVA8_HOME = sh(label: 'Get JAVA8_HOME',script: '''#!/bin/bash -le
2543
. ${JABBA_SHELL}
2644
jabba which 1.8''', returnStdout: true).trim()
2745

46+
env.TEST_JAVA_HOME = sh(label: 'Get TEST_JAVA_HOME',script: '''#!/bin/bash -le
47+
. ${JABBA_SHELL}
48+
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
49+
env.TEST_JAVA_VERSION = sh(label: 'Get TEST_JAVA_VERSION',script: '''#!/bin/bash -le
50+
echo "${JABBA_VERSION##*.}"''', returnStdout: true).trim()
51+
2852
sh label: 'Download Apache CassandraⓇ or DataStax Enterprise',script: '''#!/bin/bash -le
2953
. ${JABBA_SHELL}
30-
jabba use ${JABBA_VERSION}
54+
jabba use 1.8
3155
. ${CCM_ENVIRONMENT_SHELL} ${SERVER_VERSION}
3256
'''
3357

58+
if (env.SERVER_VERSION.split('-')[0] == 'dse') {
59+
env.DSE_FIXED_VERSION = env.SERVER_VERSION.split('-')[1]
60+
sh label: 'Update environment for DataStax Enterprise', script: '''#!/bin/bash -le
61+
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
62+
CCM_CASSANDRA_VERSION=${DSE_FIXED_VERSION} # maintain for backwards compatibility
63+
CCM_VERSION=${DSE_FIXED_VERSION}
64+
CCM_SERVER_TYPE=dse
65+
DSE_VERSION=${DSE_FIXED_VERSION}
66+
CCM_IS_DSE=true
67+
CCM_BRANCH=${DSE_FIXED_VERSION}
68+
DSE_BRANCH=${DSE_FIXED_VERSION}
69+
ENVIRONMENT_EOF
70+
'''
71+
}
72+
3473
sh label: 'Display Java and environment information',script: '''#!/bin/bash -le
3574
# Load CCM environment variables
3675
set -o allexport
3776
. ${HOME}/environment.txt
3877
set +o allexport
3978
4079
. ${JABBA_SHELL}
41-
jabba use ${JABBA_VERSION}
80+
jabba use 1.8
4281
4382
java -version
4483
mvn -v
@@ -65,7 +104,7 @@ def executeTests() {
65104
set +o allexport
66105
67106
. ${JABBA_SHELL}
68-
jabba use ${JABBA_VERSION}
107+
jabba use 1.8
69108
70109
if [ "${JABBA_VERSION}" != "1.8" ]; then
71110
SKIP_JAVADOCS=true
@@ -79,7 +118,9 @@ def executeTests() {
79118
fi
80119
printenv | sort
81120
82-
mvn -B -V ${INTEGRATION_TESTS_FILTER_ARGUMENT} verify \
121+
mvn -B -V ${INTEGRATION_TESTS_FILTER_ARGUMENT} -T 1 verify \
122+
-Ptest-jdk-${TEST_JAVA_VERSION} \
123+
-DtestJavaHome=${TEST_JAVA_HOME} \
83124
-DfailIfNoTests=false \
84125
-Dmaven.test.failure.ignore=true \
85126
-Dmaven.javadoc.skip=${SKIP_JAVADOCS} \
@@ -133,25 +174,6 @@ ${status} after ${currentBuild.durationString - ' and counting'}"""
133174
}
134175
}
135176

136-
def submitCIMetrics(buildType) {
137-
long durationMs = currentBuild.duration
138-
long durationSec = durationMs / 1000
139-
long nowSec = (currentBuild.startTimeInMillis + durationMs) / 1000
140-
def branchNameNoPeriods = env.BRANCH_NAME.replaceAll('\\.', '_')
141-
def durationMetric = "okr.ci.java.${env.DRIVER_METRIC_TYPE}.${buildType}.${branchNameNoPeriods} ${durationSec} ${nowSec}"
142-
143-
timeout(time: 1, unit: 'MINUTES') {
144-
withCredentials([string(credentialsId: 'lab-grafana-address', variable: 'LAB_GRAFANA_ADDRESS'),
145-
string(credentialsId: 'lab-grafana-port', variable: 'LAB_GRAFANA_PORT')]) {
146-
withEnv(["DURATION_METRIC=${durationMetric}"]) {
147-
sh label: 'Send runtime metrics to labgrafana', script: '''#!/bin/bash -le
148-
echo "${DURATION_METRIC}" | nc -q 5 ${LAB_GRAFANA_ADDRESS} ${LAB_GRAFANA_PORT}
149-
'''
150-
}
151-
}
152-
}
153-
}
154-
155177
def describePerCommitStage() {
156178
script {
157179
currentBuild.displayName = "Per-Commit build"
@@ -175,7 +197,9 @@ def describeAdhocAndScheduledTestingStage() {
175197

176198
// branch pattern for cron
177199
// should match 3.x, 4.x, 4.5.x, etc
178-
def branchPatternCron = ~"((\\d+(\\.[\\dx]+)+))"
200+
def branchPatternCron() {
201+
~"((\\d+(\\.[\\dx]+)+))"
202+
}
179203

180204
pipeline {
181205
agent none
@@ -215,12 +239,12 @@ pipeline {
215239
'3.0', // Previous Apache CassandraⓇ
216240
'3.11', // Current Apache CassandraⓇ
217241
'4.0', // Development Apache CassandraⓇ
218-
'dse-4.8', // Previous EOSL DataStax Enterprise
219-
'dse-5.0', // Long Term Support DataStax Enterprise
220-
'dse-5.1', // Legacy DataStax Enterprise
221-
'dse-6.0', // Previous DataStax Enterprise
222-
'dse-6.7', // Previous DataStax Enterprise
223-
'dse-6.8', // Current DataStax Enterprise
242+
'dse-4.8.16', // Previous EOSL DataStax Enterprise
243+
'dse-5.0.15', // Long Term Support DataStax Enterprise
244+
'dse-5.1.35', // Legacy DataStax Enterprise
245+
'dse-6.0.18', // Previous DataStax Enterprise
246+
'dse-6.7.17', // Previous DataStax Enterprise
247+
'dse-6.8.30', // Current DataStax Enterprise
224248
'ALL'],
225249
description: '''Apache Cassandra&reg; and DataStax Enterprise server version to use for adhoc <b>BUILD-AND-EXECUTE-TESTS</b> builds
226250
<table style="width:100%">
@@ -251,27 +275,27 @@ pipeline {
251275
<td>Apache Cassandra&reg; v4.x (<b>CURRENTLY UNDER DEVELOPMENT</b>)</td>
252276
</tr>
253277
<tr>
254-
<td><strong>dse-4.8</strong></td>
278+
<td><strong>dse-4.8.16</strong></td>
255279
<td>DataStax Enterprise v4.8.x (<b>END OF SERVICE LIFE</b>)</td>
256280
</tr>
257281
<tr>
258-
<td><strong>dse-5.0</strong></td>
282+
<td><strong>dse-5.0.15</strong></td>
259283
<td>DataStax Enterprise v5.0.x (<b>Long Term Support</b>)</td>
260284
</tr>
261285
<tr>
262-
<td><strong>dse-5.1</strong></td>
286+
<td><strong>dse-5.1.35</strong></td>
263287
<td>DataStax Enterprise v5.1.x</td>
264288
</tr>
265289
<tr>
266-
<td><strong>dse-6.0</strong></td>
290+
<td><strong>dse-6.0.18</strong></td>
267291
<td>DataStax Enterprise v6.0.x</td>
268292
</tr>
269293
<tr>
270-
<td><strong>dse-6.7</strong></td>
294+
<td><strong>dse-6.7.17</strong></td>
271295
<td>DataStax Enterprise v6.7.x</td>
272296
</tr>
273297
<tr>
274-
<td><strong>dse-6.8</strong></td>
298+
<td><strong>dse-6.8.30</strong></td>
275299
<td>DataStax Enterprise v6.8.x</td>
276300
</tr>
277301
</table>''')
@@ -283,7 +307,8 @@ pipeline {
283307
'openjdk@1.11', // OpenJDK version 11
284308
'openjdk@1.12', // OpenJDK version 12
285309
'openjdk@1.13', // OpenJDK version 13
286-
'openjdk@1.14'], // OpenJDK version 14
310+
'openjdk@1.14', // OpenJDK version 14
311+
'openjdk@1.17'], // OpenJDK version 17
287312
description: '''JDK version to use for <b>TESTING</b> when running adhoc <b>BUILD-AND-EXECUTE-TESTS</b> builds. <i>All builds will use JDK8 for building the driver</i>
288313
<table style="width:100%">
289314
<col width="15%">
@@ -320,6 +345,10 @@ pipeline {
320345
<td><strong>openjdk@1.14</strong></td>
321346
<td>OpenJDK version 14</td>
322347
</tr>
348+
<tr>
349+
<td><strong>openjdk@1.17</strong></td>
350+
<td>OpenJDK version 17</td>
351+
</tr>
323352
</table>''')
324353
booleanParam(
325354
name: 'SKIP_SERIAL_ITS',
@@ -354,15 +383,15 @@ pipeline {
354383

355384
triggers {
356385
// schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
357-
parameterizedCron(branchPatternCron.matcher(env.BRANCH_NAME).matches() ? """
386+
parameterizedCron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? """
358387
# Every weeknight (Monday - Friday) around 2:00 AM
359-
### JDK8 tests against 2.1, 3.0, DSE 4.8, DSE 5.0, DSE 5.1, DSE-6.0 and DSE 6.7
360-
H 2 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 dse-4.8 dse-5.0 dse-5.1 dse-6.0 dse-6.7;CI_SCHEDULE_JABBA_VERSION=1.8
388+
### JDK8 tests against 2.1, 3.0, DSE 4.8, DSE 5.0, DSE 5.1, dse-6.0.18 and DSE 6.7
389+
H 2 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 dse-4.8.16 dse-5.0.15 dse-5.1.35 dse-6.0.18 dse-6.7.17;CI_SCHEDULE_JABBA_VERSION=1.8
361390
### JDK11 tests against 3.11, 4.0 and DSE 6.8
362-
H 2 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.0 dse-6.8;CI_SCHEDULE_JABBA_VERSION=openjdk@1.11
391+
H 2 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.0 dse-6.8.30;CI_SCHEDULE_JABBA_VERSION=openjdk@1.11
363392
# Every weekend (Sunday) around 12:00 PM noon
364393
### JDK14 tests against 3.11, 4.0 and DSE 6.8
365-
H 12 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.0 dse-6.8;CI_SCHEDULE_JABBA_VERSION=openjdk@1.14
394+
H 12 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.0 dse-6.8.30;CI_SCHEDULE_JABBA_VERSION=openjdk@1.14
366395
""" : "")
367396
}
368397

@@ -398,17 +427,19 @@ pipeline {
398427
name 'SERVER_VERSION'
399428
values '3.11', // Latest stable Apache CassandraⓇ
400429
'4.0', // Development Apache CassandraⓇ
401-
'dse-6.8' // Current DataStax Enterprise
430+
'dse-6.8.30' // Current DataStax Enterprise
431+
}
432+
axis {
433+
name 'JABBA_VERSION'
434+
values '1.8', // jdk8
435+
'openjdk@1.11', // jdk11
436+
'openjdk@1.17' // jdk17
402437
}
403438
}
404439

405440
agent {
406441
label "${OS_VERSION}"
407442
}
408-
environment {
409-
// Per-commit builds are only going to run against JDK8
410-
JABBA_VERSION = '1.8'
411-
}
412443

413444
stages {
414445
stage('Initialize-Environment') {
@@ -428,7 +459,7 @@ pipeline {
428459
}
429460
stage('Build-Driver') {
430461
steps {
431-
buildDriver(env.JABBA_VERSION)
462+
buildDriver('default')
432463
}
433464
}
434465
stage('Execute-Tests') {
@@ -460,11 +491,6 @@ pipeline {
460491
}
461492
}
462493
post {
463-
always {
464-
node('master') {
465-
submitCIMetrics('commit')
466-
}
467-
}
468494
aborted {
469495
notifySlack('aborted')
470496
}
@@ -511,12 +537,12 @@ pipeline {
511537
'3.0', // Previous Apache CassandraⓇ
512538
'3.11', // Current Apache CassandraⓇ
513539
'4.0', // Development Apache CassandraⓇ
514-
'dse-4.8', // Previous EOSL DataStax Enterprise
515-
'dse-5.0', // Last EOSL DataStax Enterprise
516-
'dse-5.1', // Legacy DataStax Enterprise
517-
'dse-6.0', // Previous DataStax Enterprise
518-
'dse-6.7', // Previous DataStax Enterprise
519-
'dse-6.8' // Current DataStax Enterprise
540+
'dse-4.8.16', // Previous EOSL DataStax Enterprise
541+
'dse-5.0.15', // Last EOSL DataStax Enterprise
542+
'dse-5.1.35', // Legacy DataStax Enterprise
543+
'dse-6.0.18', // Previous DataStax Enterprise
544+
'dse-6.7.17', // Previous DataStax Enterprise
545+
'dse-6.8.30' // Current DataStax Enterprise
520546
}
521547
}
522548
when {

0 commit comments

Comments
 (0)