allthingssecurity commented on code in PR #28199:
URL: https://github.com/apache/camel/pull/28199#discussion_r4331769236
##########
components/camel-github2/src/main/java/org/apache/camel/component/github2/consumer/CommitConsumer.java:
##########
@@ -140,6 +153,12 @@ protected int poll() throws Exception {
newCommits.push(commit);
}
}
+ if (newCommits.isEmpty() && lastSha != null && !lastShaFound &&
!commits.isEmpty()) {
+ // the last routed commit is no longer on the branch (a force
push or a reset to an older commit), and
+ // the newest commits were all routed before: continue from
the newest one, so that the next polls do
+ // not read the remembered number of commits again to look for
the last routed one
+ lastSha = commits.get(0).getSHA1();
Review Comment:
Thanks, added in ef8b6a9df54b: an INFO line "Last routed commit {} is no
longer on branch {}, continuing from the newest commit {}" before `lastSha`
moves on. camel-github2 unit tests: 17 run, 0 failures.
_Claude Code on behalf of allthingssecurity_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]