Skip to content

Commit e5b23d3

Browse files
fahedouchclaude
andcommitted
fix: Resolve CI failures for rating source tracking
- Remove unused imports in RatingSourceTest (Checkstyle violations) - Only audit source changes from non-null values to avoid noisy "Source: null → MANUAL" comments on initial analysis creation - Migrate ProcessScheduledNotificationRuleActivityTest to builder pattern for MakeAnalysisCommand Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0ea7f3a commit e5b23d3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

apiserver/src/main/java/org/dependencytrack/persistence/AnalysisQueryManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ public long makeAnalysis(final MakeAnalysisCommand command) {
161161

162162
if (command.source() != null && canUpdate) {
163163
if (analysis.getSource() != command.source()) {
164-
auditTrailComments.add("Source: %s → %s".formatted(analysis.getSource(), command.source()));
164+
if (analysis.getSource() != null) {
165+
auditTrailComments.add("Source: %s → %s".formatted(analysis.getSource(), command.source()));
166+
}
165167
analysis.setSource(command.source());
166168
}
167169
}

apiserver/src/test/java/org/dependencytrack/model/RatingSourceTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121
import org.junit.jupiter.api.Test;
2222

23-
import static org.junit.jupiter.api.Assertions.assertEquals;
2423
import static org.junit.jupiter.api.Assertions.assertFalse;
25-
import static org.junit.jupiter.api.Assertions.assertNull;
2624
import static org.junit.jupiter.api.Assertions.assertTrue;
2725

2826
/**

apiserver/src/test/java/org/dependencytrack/notification/ProcessScheduledNotificationRuleActivityTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ void shouldDispatchNewVulnNotification() throws InvalidProtocolBufferException {
9999
null, null, Date.from(afterRuleLastFiredAt));
100100
qm.addVulnerability(vulnB, parentProjectComponent, "internal",
101101
null, null, Date.from(afterRuleLastFiredAt));
102-
qm.makeAnalysis(new MakeAnalysisCommand(
103-
parentProjectComponent, vulnB, AnalysisState.FALSE_POSITIVE,
104-
null, null, null, true, null, null, Set.of()));
102+
qm.makeAnalysis(new MakeAnalysisCommand(parentProjectComponent, vulnB)
103+
.withState(AnalysisState.FALSE_POSITIVE)
104+
.withSuppress(true)
105+
.withOptions(Set.of()));
105106

106107
// Child project affected by vulnA (BEFORE) and vulnB (AFTER).
107108
final var childProject = new Project();

0 commit comments

Comments
 (0)