Claus Ibsen created CAMEL-27854:
-----------------------------------

             Summary: camel-github2: CamelGitHubInResponseTo is not used, the 
state is upper-cased with the default locale, the events consumer routes old 
events
                 Key: CAMEL-27854
                 URL: https://issues.apache.org/jira/browse/CAMEL-27854
             Project: Camel
          Issue Type: Bug
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-github2 for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31144).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. CamelGitHubInResponseTo is not used
{{PullRequestCommentProducer.process}} never reads the header; the comment 
always goes to the pull request conversation (GHIssue.comment), while the old 
doc page and Javadoc said it makes a reply.
Proposed change: implement the reply or drop the header.

h4. 2. A missing pull request header gives NullPointerException
PullRequestCommentProducer unboxes a null CamelGitHubPullRequest; the other 
producers say "Pull request number must be specified".
Proposed change: add the same check.

h4. 3. The state is upper-cased with the default locale
{{PullRequestStateProducer.process}} calls state.toUpperCase() without 
Locale.ROOT; with a Turkish locale "pending" and "failure" fail in 
GHCommitState.valueOf.
Proposed change: use toUpperCase(Locale.ROOT).

h4. 4. A missing state is not checked
With no state the library sends none and GitHub rejects the request (state is 
required).
Proposed change: validate it.

h4. 5. The events consumer routes old events on its first poll
{{EventsConsumer}} starts with lastEventId 0, unlike the other consumers, so 
its first poll routes every event the API still returns.
Proposed change: set lastEventId to the highest current id in doStart.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to