Skip to content

Commit 45bfdf2

Browse files
authored
2.1.0 Release (#35)
# Improvements * Upgrade Kafka to 2.8.1 * Upgrade JCSMP to 10.12.0 # Bug fixes * use ephemeral ports for test infrastructure setup (#29) * obfuscate passwords (#30) * Fix start error propagation (#32) * Add `sol.message_processor.error.ignore` config option to discard messages that produce message processor errors (#33) * Fixed Gradle `integrationTest` task and added `test` task # Misc * Add Dependabot * Add Jacoco code coverage * Add static code analysis tools (CodeQL, PMD, SpotBugs) * Upload test results to Github Action
1 parent e0fcb78 commit 45bfdf2

File tree

57 files changed

+2196
-1181
lines changed

Some content is hidden

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

57 files changed

+2196
-1181
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gradle"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
allow:
8+
- dependency-name: "org.apache.kafka:*"
9+
- dependency-name: "com.solacesystems:*"

.github/workflows/build-test.yml

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,69 @@ on:
77
push:
88

99
jobs:
10+
dupe_check:
11+
name: Check for Duplicate Workflow Run
12+
runs-on: ubuntu-latest
13+
outputs:
14+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
15+
steps:
16+
- id: skip_check
17+
uses: fkirc/skip-duplicate-actions@v3.4.0
18+
with:
19+
concurrent_skipping: same_content
20+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
21+
1022
build:
23+
needs:
24+
- dupe_check
25+
if: needs.dupe_check.outputs.should_skip != 'true' || (github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'SolaceProducts')
1126

1227
runs-on: ubuntu-latest
1328

1429
steps:
1530
- uses: actions/checkout@v2
16-
- name: Setup JDK 1.8
17-
uses: actions/setup-java@v1
1831
with:
19-
java-version: 1.8
32+
submodules: recursive
33+
34+
- name: Cache Gradle
35+
uses: actions/cache@v2
36+
with:
37+
path: |
38+
~/.gradle/caches
39+
~/.gradle/wrapper
40+
key: ${{ runner.os }}-gradle-build-test-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
41+
restore-keys: |
42+
${{ runner.os }}-gradle-build-test-
43+
44+
- name: Setup JDK 8
45+
uses: actions/setup-java@v2
46+
with:
47+
distribution: zulu
48+
java-version: 8
49+
50+
- name: Validate Gradle wrapper
51+
uses: gradle/wrapper-validation-action@v1
52+
53+
- name: Install Test Support
54+
working-directory: solace-integration-test-support
55+
run: ./mvnw clean install -DskipTests
56+
2057
- name: Build and test with Gradle
21-
run: ./gradlew clean integrationTest --tests com.solace.connector.kafka.connect.source.it.SourceConnectorIT
58+
run: ./gradlew clean test integrationTest jacocoFullReport --info
59+
60+
- name: Upload Test Artifacts
61+
if: always()
62+
uses: actions/upload-artifact@v2
63+
with:
64+
name: Test Results
65+
path: |
66+
**/build/jacoco/*.exec
67+
**/build/reports/
68+
**/build/test-results/**/*.xml
69+
2270
- name: Publish artifacts
23-
if: github.event_name == 'push'
71+
# Security Measure: Do not publish artifacts from dependabot builds
72+
if: github.event_name == 'push' && (github.actor != 'dependabot[bot]' || !contains(github.ref, 'dependabot'))
2473
run: |
2574
if [ ${{ github.ref }} == 'refs/heads/master' ] && [ ${{ github.repository_owner }} == 'SolaceProducts' ] ; then
2675
echo "Using master on SolaceProducts"
@@ -56,4 +105,30 @@ jobs:
56105
git remote add origin-pages https://${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git > /dev/null 2>&1;
57106
git push --quiet --set-upstream origin-pages gh-pages;
58107
echo "Updated and pushed GH pages!";
59-
fi
108+
fi
109+
110+
- name: Cleanup Gradle Cache
111+
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
112+
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
113+
run: |
114+
rm -f ~/.gradle/caches/modules-2/modules-2.lock
115+
rm -f ~/.gradle/caches/modules-2/gc.properties
116+
117+
- name: Publish Unit Test Results
118+
if: github.actor != 'dependabot[bot]' || (github.event_name == 'push' && !contains(github.ref, 'dependabot'))
119+
uses: EnricoMi/publish-unit-test-result-action@v1
120+
continue-on-error: true
121+
with:
122+
check_name: Unit Test Results
123+
comment_mode: create new
124+
fail_on: nothing
125+
hide_comments: orphaned commits
126+
files: |
127+
**/build/test-results/**/*.xml
128+
129+
- name: Publish Test Coverage Results
130+
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository
131+
uses: madrapps/jacoco-report@v1.2
132+
with:
133+
paths: build/reports/jacoco/jacocoFullReport/jacocoFullReport.xml
134+
token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "Code Analysis (CodeQL)"
13+
14+
on:
15+
push:
16+
pull_request:
17+
schedule:
18+
- cron: '38 15 * * 0'
19+
workflow_dispatch:
20+
21+
jobs:
22+
dupe_check:
23+
name: Check for Duplicate Workflow Run
24+
runs-on: ubuntu-latest
25+
outputs:
26+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
27+
steps:
28+
- id: skip_check
29+
uses: fkirc/skip-duplicate-actions@v3.4.0
30+
with:
31+
concurrent_skipping: same_content
32+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
33+
34+
analyze:
35+
name: Analyze
36+
needs:
37+
- dupe_check
38+
if: needs.dupe_check.outputs.should_skip != 'true'
39+
runs-on: ubuntu-latest
40+
permissions:
41+
actions: read
42+
contents: read
43+
security-events: write
44+
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v2
48+
49+
- name: Cache Gradle
50+
uses: actions/cache@v2
51+
with:
52+
path: |
53+
~/.gradle/caches
54+
~/.gradle/wrapper
55+
key: ${{ runner.os }}-gradle-codeql-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
56+
restore-keys: |
57+
${{ runner.os }}-gradle-codeql-
58+
59+
# Initializes the CodeQL tools for scanning.
60+
- name: Initialize CodeQL
61+
uses: github/codeql-action/init@v1
62+
with:
63+
languages: java
64+
# If you wish to specify custom queries, you can do so here or in a config file.
65+
# By default, queries listed here will override any specified in a config file.
66+
# Prefix the list here with "+" to use these queries and those in the config file.
67+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
68+
69+
- name: Validate Gradle wrapper
70+
uses: gradle/wrapper-validation-action@v1
71+
72+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
73+
# If this step fails, then you should remove it and run the build manually (see below)
74+
- name: Autobuild
75+
uses: github/codeql-action/autobuild@v1
76+
77+
# ℹ️ Command-line programs to run using the OS shell.
78+
# 📚 https://git.io/JvXDl
79+
80+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
81+
# and modify them (or add more) to build your code if your project
82+
# uses a compiled language
83+
84+
#- run: |
85+
# make bootstrap
86+
# make release
87+
88+
- name: Perform CodeQL Analysis
89+
uses: github/codeql-action/analyze@v1
90+
91+
- name: Cleanup Gradle Cache
92+
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
93+
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
94+
run: |
95+
rm -f ~/.gradle/caches/modules-2/modules-2.lock
96+
rm -f ~/.gradle/caches/modules-2/gc.properties

.github/workflows/pmd-analysis.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Code Analysis (PMD)
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
dupe_check:
10+
name: Check for Duplicate Workflow Run
11+
runs-on: ubuntu-latest
12+
outputs:
13+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
14+
steps:
15+
- id: skip_check
16+
uses: fkirc/skip-duplicate-actions@v3.4.0
17+
with:
18+
concurrent_skipping: same_content
19+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
20+
21+
run-analysis:
22+
name: Run PMD Static Code Analysis
23+
needs:
24+
- dupe_check
25+
if: needs.dupe_check.outputs.should_skip != 'true'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Cache Gradle
31+
uses: actions/cache@v2
32+
with:
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
key: ${{ runner.os }}-gradle-pmd-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: |
38+
${{ runner.os }}-gradle-pmd-
39+
40+
- name: Setup JDK 8
41+
uses: actions/setup-java@v2
42+
with:
43+
distribution: zulu
44+
java-version: 8
45+
46+
- name: Validate Gradle wrapper
47+
uses: gradle/wrapper-validation-action@v1
48+
49+
- name: Run static code analysis
50+
run: ./gradlew clean pmdMainSarif --info
51+
52+
- name: Upload Test Artifacts
53+
if: always()
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: Static Code Analysis Results (PMD)
57+
path: |
58+
**/build/reports/
59+
60+
- name: Upload SARIF file
61+
if: success() || failure()
62+
uses: github/codeql-action/upload-sarif@v1
63+
with:
64+
sarif_file: build/reports/pmd/main.sarif
65+
66+
- name: Cleanup Gradle Cache
67+
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
68+
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
69+
run: |
70+
rm -f ~/.gradle/caches/modules-2/modules-2.lock
71+
rm -f ~/.gradle/caches/modules-2/gc.properties
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Code Analysis (SpotBugs)
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
dupe_check:
10+
name: Check for Duplicate Workflow Run
11+
runs-on: ubuntu-latest
12+
outputs:
13+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
14+
steps:
15+
- id: skip_check
16+
uses: fkirc/skip-duplicate-actions@v3.4.0
17+
with:
18+
concurrent_skipping: same_content
19+
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
20+
21+
run-analysis:
22+
name: Run SpotBugs Static Code Analysis
23+
needs:
24+
- dupe_check
25+
if: needs.dupe_check.outputs.should_skip != 'true'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v2
29+
30+
- name: Cache Gradle
31+
uses: actions/cache@v2
32+
with:
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
key: ${{ runner.os }}-gradle-spotbugs-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: |
38+
${{ runner.os }}-gradle-spotbugs-
39+
40+
- name: Setup JDK 8
41+
uses: actions/setup-java@v2
42+
with:
43+
distribution: zulu
44+
java-version: 8
45+
46+
- name: Validate Gradle wrapper
47+
uses: gradle/wrapper-validation-action@v1
48+
49+
- name: Run static code analysis
50+
run: ./gradlew clean spotbugsMain --info
51+
52+
- name: Upload Test Artifacts
53+
if: always()
54+
uses: actions/upload-artifact@v2
55+
with:
56+
name: Static Code Analysis Results (SpotBugs)
57+
path: |
58+
**/build/reports/
59+
60+
- name: Upload SARIF file
61+
if: success() || failure()
62+
uses: github/codeql-action/upload-sarif@v1
63+
with:
64+
sarif_file: build/reports/spotbugs/main.sarif
65+
66+
- name: Cleanup Gradle Cache
67+
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
68+
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
69+
run: |
70+
rm -f ~/.gradle/caches/modules-2/modules-2.lock
71+
rm -f ~/.gradle/caches/modules-2/gc.properties

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,11 @@ local.properties
3636
*.launch
3737
/build/
3838

39+
### IntelliJ
40+
.idea
41+
*.iws
42+
*.iml
43+
*.ipr
44+
3945
# Unzipped test connector
4046
src/integrationTest/resources/pubsubplus-connector-kafka*/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "solace-integration-test-support"]
2+
path = solace-integration-test-support
3+
url = ../../SolaceDev/solace-integration-test-support.git

0 commit comments

Comments
 (0)