Skip to content

Commit 35e278e

Browse files
committed
Build comments should only be added to staged changes
Fixes: QTQAINFRA-3045 Change-Id: I2493f3b1768e6ce2d6933a4a6f897bc823810432 Reviewed-by: Kari Oikarinen <[email protected]> Reviewed-by: Paul Wicking <[email protected]>
1 parent 35021eb commit 35e278e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/com/googlesource/gerrit/plugins/qtcodereview/QtCommandNewBuild.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,14 @@ protected void run() throws UnloggedFailure {
132132
try (BatchUpdate u = updateFactory.create(dbProvider.get(), projectKey, user, TimeUtil.nowTs())) {
133133
for (Entry<ChangeData, RevCommit> item: openChanges) {
134134
Change change = item.getKey().change();
135-
logger.atInfo().log("qtcodereview: staging-new-build inserted change %s (%s) into build %s for %s",
136-
change, item.getValue().toString(), build, destinationKey);
137-
u.addOp(change.getId(), op);
135+
if (change.getStatus() == Change.Status.STAGED) {
136+
logger.atInfo().log("qtcodereview: staging-new-build inserted change %s (%s) into build %s for %s",
137+
change, item.getValue().toString(), build, destinationKey);
138+
u.addOp(change.getId(), op);
139+
} else {
140+
logger.atInfo().log("qtcodereview: staging-new-build change %s (%s) is included in build %s for %s",
141+
change, item.getValue().toString(), build, destinationKey);
142+
}
138143
}
139144
u.execute();
140145
}

0 commit comments

Comments
 (0)