allthingssecurity opened a new pull request, #28198:
URL: https://github.com/apache/camel/pull/28198

   # Description
   
   [CAMEL-25806](https://issues.apache.org/jira/browse/CAMEL-25806)
   
   A poll of the `newIssues` consumer searches for `created > "<minute of the 
latest issue>" AND <jql> ORDER BY created DESC`. 
`AbstractJiraConsumer.getIssues` stops paging once it holds `maxResults` issues 
(default 50), and the consumer makes the newest issue of the answer its latest 
issue. So when more than `maxResults` issues were created since the previous 
poll, the poll routed the newest 50 and the next poll asked only for issues 
newer than those: the older ones were never consumed, and nothing was logged. 
This happens with a burst of new issues (an import, a bulk clone, an automation 
rule) and at the first poll after Jira was unreachable for a while.
   
   Change (in `NewIssuesConsumer.getNewIssues`): when there is a latest issue, 
the poll reads every page of that search; `maxResults` (capped at 50, as 
before) is the page size. The startup search, the order in which the issues are 
routed and the other Jira consumers are not changed.
   
   What users can notice: a poll can route more than `maxResults` issues. A 
short note in `jira-component.adoc` (and its catalog copy), the description of 
the `maxResults` option (the component JSON, its catalog copy and the endpoint 
DSL are regenerated), and a note under its own `camel-jira` heading in the 4.24 
upgrade guide.
   
   What is not changed: when the consumer found no issue at startup (an empty 
project, or Jira not reachable when the route started), its first poll still 
runs the configured JQL limited to `maxResults`, as before; only the polls that 
follow a latest issue read every page.
   
   Tests:
   - New `NewIssuesConsumerMoreThanMaxResultsTest` (a mocked `SearchRestClient` 
that pages like the Jira search: 60 issues created after the latest issue at 
startup, default `maxResults`). Without the change: `mock://result Received 
message count. Expected: <60> but was: <50>`. With the change it passes.
   - With the change the camel-jira unit tests pass: 60 run, 0 failures, 0 
errors, 0 skipped. The existing tests of the order and the pagination of new 
issues are unchanged.
   
   How it was found: a small Z3 model of the newIssues cursor over several 
polls (issues arrive between polls, a poll keeps the newest M, the cursor moves 
to the newest) has a counterexample on the current code as soon as M+1 issues 
arrive between two polls, and none when every page is read. The test above 
reproduces it on the real consumer.
   
   What was not run: a test against a Jira server; the full root build.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it): 
[CAMEL-25806](https://issues.apache.org/jira/browse/CAMEL-25806).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
     (I built and tested camel-jira, including the formatter and import-sort 
plugins. No option changed; the catalog copy of the edited doc page is updated 
by hand. I did not run the full root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit 
carries a `Co-Authored-By` trailer.
   
   _Claude Code on behalf of allthingssecurity_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to