Add Jira issue selector to collect issues since last successful build (#453)#746
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new SinceLastSuccessfulBuildIssueSelector that collects JIRA issues from all builds since the last successful build, excluding the last successful build itself. This addresses issue #453 for collecting issues across multiple failed/unstable builds.
Key changes:
- New issue selector implementation that traverses builds backwards until the last successful build
- Refactored shared code from
DefaultIssueSelectorintoAbstractIssueSelectorbase class - Comprehensive unit tests for the new selector functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
SinceLastSuccessfulBuildIssueSelector.java |
New selector that collects issues from builds since last successful build |
AbstractIssueSelector.java |
Refactored to include shared issue extraction methods moved from DefaultIssueSelector |
DefaultIssueSelector.java |
Removed methods that were moved to AbstractIssueSelector base class |
Messages.properties |
Added display name for the new selector |
SinceLastSuccessfulBuildIssueSelectorTest.java |
Comprehensive unit tests for the new selector |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
rantoniuk
left a comment
There was a problem hiding this comment.
@ahmedanwar1 thanks for contributing!
Before going into details:
-
can you remove the
AbstractIssueSelectorchanges? This class is Abstract on purpose and should not contain any logic and I don't why would you need those changes for the new selector you're providing -
please extend the documentation, i.e. features.md and preferably as well in the use-cases.md, since this selector is a more complex one. If you wish, you can extract all selectors documetantion into a separate Markdown file.
|
Thanks for the feedback @rantoniuk I modified Would you prefer a separate utility class like and should this selector also collect issues from the build parameters like |
I'm fine with both solutions, i.e. extend DefaultIssueSelector or extract to IssueSelectorUtils.
The reason DefaultIssueSelector does this is described in JENKINS-12312, so I think we need the same behavior here. |
|
I may tend to prefer extracting the shared logic into an |
|
Actually after looking deeper through the codebase, I realized so the current design relies on inheritance and method overriding and the utils class would break that flow I think adding an abstract class this approach keeps The hierarchy would be: AbstractIssueSelector --> BaseIssueSelector --> DefaultIssueSelector What do you think? |
|
Let's leave it then as it is now (in AbstractIssueSelector), just make sure to cover the changes with tests accordingly (see some missing branches). Edit: I actually need to see if this is valid at all - see my last comment. Allow me some time to test this on a live instance. |
|
@ahmedanwar1 I looked at the implementation and I'm wondering what do you think about a different approach. How about having a |
|
|
@ahmedanwar1 did you have a chance to look at my previous comment? Any thoughts? |
|
Hi @rantoniuk From a design perspective i leaned toward keeping Introducing a flag in Keeping them separate helps preserve a clearer separation of concerns and avoids accumulating conditional logic in one place over time What do you think is the best fit? |



Related issue
Resolves #453
Changes
SinceLastSuccessfulBuildIssueSelectorto collect JIRA issues from all builds since the last successful build, excluding the last successful build itself.AbstractIssueSelectorandDefaultIssueSelectorfor reusability and consistent issue extraction logic across selectors.Tests
docs/directory