Skip to content

Commit 6957415

Browse files
committed
chore: Update workflows to v4, adjusts tests to be less brittle/more informative
1 parent 0b5a9e1 commit 6957415

8 files changed

Lines changed: 68 additions & 33 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Fetch sources
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414

1515
- name: Setup JDK 17
16-
uses: actions/setup-java@v1
16+
uses: actions/setup-java@v4
1717
with:
18+
distribution: 'temurin'
1819
java-version: 17
1920

2021
- name: Cache local Maven repository
21-
uses: actions/cache@v2
22+
uses: actions/cache@v4
2223
with:
2324
path: |
2425
~/.m2/repository
@@ -28,7 +29,7 @@ jobs:
2829

2930
- name: Configure build metadata
3031
id: metadata
31-
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
32+
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
3233

3334
- name: Build plugin
3435
env:

.github/workflows/smoke_tests.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ jobs:
1313

1414
steps:
1515
- name: Fetch sources
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717

1818
- name: Setup JDK 17
19-
uses: actions/setup-java@v1
19+
uses: actions/setup-java@v4
2020
with:
21+
distribution: 'temurin'
2122
java-version: 17
2223

2324
- name: Cache local Maven repository
24-
uses: actions/cache@v2
25+
uses: actions/cache@v4
2526
with:
2627
path: |
2728
~/.m2/repository
@@ -31,7 +32,7 @@ jobs:
3132

3233
- name: Configure build metadata
3334
id: metadata
34-
run: echo ::set-output name=tag::1.0.0
35+
run: echo "tag=1.0.0" >> $GITHUB_OUTPUT
3536

3637
- name: Build plugin
3738
env:

.github/workflows/unit_tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
java: [17, 20]
11+
java: [17, 21]
1212
steps:
1313
- name: Fetch sources
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4
1515

1616
- name: Setup JDK ${{ matrix.java }}
17-
uses: actions/setup-java@v1
17+
uses: actions/setup-java@v4
1818
with:
19+
distribution: 'temurin'
1920
java-version: ${{ matrix.java }}
2021

2122
- name: Cache local Maven repository
22-
uses: actions/cache@v2
23+
uses: actions/cache@v4
2324
with:
2425
path: |
2526
~/.m2/repository

.snyk

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,60 @@
11
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2-
version: v1.25.0
2+
version: v1.25.1
33
patch: {}
44
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
55
ignore:
6-
'SNYK-JAVA-COMGOOGLEPROTOBUF-8055227':
6+
SNYK-JAVA-COMGOOGLEPROTOBUF-8055227:
77
- '*':
8-
reason: Transitive dep of artifactory-papi. Actual papi is provided by artifactory env at runtime so this is a false positive.
8+
reason: >-
9+
Transitive dep of artifactory-papi. Actual papi is provided by
10+
artifactory env at runtime so this is a false positive.
911
created: 2024-12-19T00:00:00.000Z
10-
'SNYK-JAVA-DNSJAVA-7547403':
12+
SNYK-JAVA-DNSJAVA-7547403:
1113
- '*':
12-
reason: Transitive dep of artifactory-papi. Actual papi is provided by artifactory env at runtime so this is a false positive.
14+
reason: >-
15+
Transitive dep of artifactory-papi. Actual papi is provided by
16+
artifactory env at runtime so this is a false positive.
1317
created: 2024-12-19T00:00:00.000Z
14-
'SNYK-JAVA-DNSJAVA-7547404':
18+
SNYK-JAVA-DNSJAVA-7547404:
1519
- '*':
16-
reason: Transitive dep of artifactory-papi. Actual papi is provided by artifactory env at runtime so this is a false positive.
20+
reason: >-
21+
Transitive dep of artifactory-papi. Actual papi is provided by
22+
artifactory env at runtime so this is a false positive.
1723
created: 2024-12-19T00:00:00.000Z
18-
'SNYK-JAVA-DNSJAVA-7547405':
24+
SNYK-JAVA-DNSJAVA-7547405:
1925
- '*':
20-
reason: Transitive dep of artifactory-papi. Actual papi is provided by artifactory env at runtime so this is a false positive.
26+
reason: >-
27+
Transitive dep of artifactory-papi. Actual papi is provided by
28+
artifactory env at runtime so this is a false positive.
2129
created: 2024-12-19T00:00:00.000Z
22-
'SNYK-JAVA-COMMONSLANG-10734077':
30+
SNYK-JAVA-COMMONSLANG-10734077:
2331
- '*':
24-
reason: Transitive dep of artifactory-papi. Actual papi is provided by artifactory env at runtime so this is a false positive.
32+
reason: >-
33+
Transitive dep of artifactory-papi. Actual papi is provided by
34+
artifactory env at runtime so this is a false positive.
2535
created: 2025-07-17T00:00:00.000Z
26-
'SNYK-JAVA-ORGAPACHECOMMONS-10734078':
36+
SNYK-JAVA-ORGAPACHECOMMONS-10734078:
2737
- '*':
28-
reason: Transitive dep of artifactory-papi. Actual papi is provided by artifactory env at runtime so this is a false positive.
38+
reason: >-
39+
Transitive dep of artifactory-papi. Actual papi is provided by
40+
artifactory env at runtime so this is a false positive.
2941
created: 2025-07-17T00:00:00.000Z
30-
'SNYK-JAVA-ORGSPRINGFRAMEWORK-11958848':
42+
SNYK-JAVA-ORGSPRINGFRAMEWORK-11958848:
3143
- '*':
32-
reason: Transitive dep of artifactory-papi. Actual papi is provided by artifactory env at runtime so this is a false positive.
44+
reason: >-
45+
Transitive dep of artifactory-papi. Actual papi is provided by
46+
artifactory env at runtime so this is a false positive.
3347
created: 2025-08-18T00:00:00.000Z
34-
'SNYK-JAVA-ORGSPRINGFRAMEWORK-12008931':
48+
SNYK-JAVA-ORGSPRINGFRAMEWORK-12008931:
3549
- '*':
36-
reason: Transitive dep of artifactory-papi. Actual papi is provided by artifactory env at runtime so this is a false positive.
50+
reason: >-
51+
Transitive dep of artifactory-papi. Actual papi is provided by
52+
artifactory env at runtime so this is a false positive.
3753
created: 2025-08-26T00:00:00.000Z
54+
SNYK-JAVA-ORGSPRINGFRAMEWORK-12817817:
55+
- '*':
56+
reason: >-
57+
Transitive dep of artifactory-papi. Actual papi is provided by
58+
artifactory env at runtime so this is a false positive.
59+
expires: 2025-11-02T15:34:14.942Z
60+
created: 2025-10-03T15:34:14.947Z

core/src/test/java/io/snyk/plugins/artifactory/scanner/PythonScannerTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import java.util.Properties;
1616

1717
import static io.snyk.plugins.artifactory.configuration.PluginConfiguration.API_ORGANIZATION;
18+
import static org.assertj.core.api.Assertions.assertThat;
1819
import static org.junit.jupiter.api.Assertions.*;
1920
import static org.mockito.Mockito.mock;
2021
import static org.mockito.Mockito.when;
@@ -39,7 +40,9 @@ void shouldTestPipPackage() throws Exception {
3940
when(fileLayoutInfo.getBaseRevision()).thenReturn("1.25.7");
4041

4142
TestResult result = scanner.scan(fileLayoutInfo, repoPath);
42-
assertEquals(6, result.getVulnSummary().getTotalCount());
43+
assertThat(result.getVulnSummary().getTotalCount())
44+
.isGreaterThanOrEqualTo(7)
45+
.withFailMessage("As of 2025-10-03 urllib3@1.25.7 should have at least 7 vulns");
4346
assertEquals("https://security.snyk.io/package/pip/urllib3/1.25.7", result.getDetailsUrl().toString());
4447
}
4548

core/src/test/java/io/snyk/plugins/artifactory/scanner/cocoapods/CocoapodsScannerTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ void whenAValidPackage() {
4242
when(repoPath.getPath()).thenReturn("OpenSSL/OpenSSL/tags/1.0.2/OpenSSL-1.0.2.tar.gz");
4343

4444
TestResult result = scanner.scan(fileLayoutInfo, repoPath);
45-
assertThat(result.getVulnSummary().getCountAtOrAbove(Severity.MEDIUM)).isGreaterThanOrEqualTo(63);
45+
assertThat(result.getVulnSummary().getCountAtOrAbove(Severity.MEDIUM))
46+
.isGreaterThanOrEqualTo(63)
47+
.withFailMessage("As of 2025-10-03 OpenSSL@1.0.2 should have at least 63 medium+ vulns");
4648
assertThat(result.getDetailsUrl().toString()).isEqualTo("https://security.snyk.io/package/cocoapods/OpenSSL/1.0.2");
4749
}
4850
}

core/src/test/java/io/snyk/plugins/artifactory/scanner/nuget/NugetScannerTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ void whenAValidNugetPackage() {
4242
when(repoPath.getName()).thenReturn("newtonsoft.json.13.0.0.nupkg");
4343

4444
TestResult result = scanner.scan(fileLayoutInfo, repoPath);
45-
assertThat(result.getVulnSummary().getCountAtOrAbove(Severity.MEDIUM)).isGreaterThanOrEqualTo(1);
45+
assertThat(result.getVulnSummary().getCountAtOrAbove(Severity.MEDIUM))
46+
.isGreaterThanOrEqualTo(1)
47+
.withFailMessage("As of 2025-10-03 newtonsoft.json@13.0.0 should have at least 1 medium+ vuln");
4648
assertThat(result.getDetailsUrl().toString()).isEqualTo("https://security.snyk.io/package/nuget/newtonsoft.json/13.0.0");
4749
}
4850

core/src/test/java/io/snyk/plugins/artifactory/scanner/rubygems/RubyGemsScannerTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ void whenAValidGemPackage() {
4343
when(repoPath.getName()).thenReturn("sinatra-2.0.0.gem");
4444

4545
TestResult result = scanner.scan(fileLayoutInfo, repoPath);
46-
assertThat(result.getVulnSummary().getCountAtOrAbove(Severity.MEDIUM)).isGreaterThanOrEqualTo(5);
46+
assertThat(result.getVulnSummary().getCountAtOrAbove(Severity.MEDIUM))
47+
.isGreaterThanOrEqualTo(5)
48+
.withFailMessage("As of 2025-10-03 sinatra@2.0.0 should have at least 5 medium+ vulns");
4749
assertThat(result.getDetailsUrl().toString()).isEqualTo("https://security.snyk.io/package/rubygems/sinatra/2.0.0");
4850
}
4951

0 commit comments

Comments
 (0)