Add JIRA_ISSUES_SIZE to the JiraEnvironmentVariableBuilder#707
Merged
rantoniuk merged 15 commits intojenkinsci:masterfrom Jun 20, 2025
Merged
Add JIRA_ISSUES_SIZE to the JiraEnvironmentVariableBuilder#707rantoniuk merged 15 commits intojenkinsci:masterfrom
rantoniuk merged 15 commits intojenkinsci:masterfrom
Conversation
* master: (627 commits) [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release jira-3.17 fully remove changelist from maven.config [skip ci] revert maven.config change [skip ci] fix: remove custom VersionComparator logic Bump the jenkins group with 2 updates (jenkinsci#705) Add Jira site property to configure max number of returned Jira issues (jenkinsci#665) tests: code coverage for VersionCreator docs: add info about failing the build when version already exists VersionCreator tests and logging fixes use Optional for null safety and add a test for null versions coming from API remove prefix from version naming scheme [skip ci] Set semver format for incrementals Add null check for getFixVersions() add pre-commit config [skip ci] [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release jira-3.16 fix remaining MAX_VALUE instances in the codebase Add support for jira issue parameter in pipelines (jenkinsci#652) Add support for jira version parameter in pipelines (jenkinsci#651) ...
rantoniuk
commented
Jun 6, 2025
src/main/java/hudson/plugins/jira/JiraEnvironmentVariableBuilder.java
Outdated
Show resolved
Hide resolved
src/main/java/hudson/plugins/jira/JiraEnvironmentContributingAction.java
Show resolved
Hide resolved
0f28983 to
b866a0f
Compare
b866a0f to
2ff5668
Compare
…conflicts * origin/master: add crowdin badges (jenkinsci#709) Use Crowdin translations (jenkinsci#712) add i18n CrowdIn info to README (jenkinsci#709) [skip ci] fix CrowdIn GHA version (jenkinsci#709) Add CrowdIn GHA workflow (jenkinsci#709) add CrowdIn import config (jenkinsci#709) fix: fixVersion field was not pulled from Jira (jenkinsci#710) Add option to show only released versions (jenkinsci#708) chore: Update pull_request_template.md [skip ci]
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for a new environment variable (JIRA_ISSUES_SIZE) that captures the count of issues matching a JQL query.
- Builder (
JiraEnvironmentVariableBuilder) now computes and logs issue count and passes it to the action - Contributing action (
JiraEnvironmentContributingAction) stores and exposes the new size variable - Tests and help documentation updated to cover
JIRA_ISSUES_SIZE
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/hudson/plugins/jira/JiraEnvironmentVariableBuilder.java | Compute idListSize, log "JIRA_ISSUES_SIZE" update, and pass size into action |
| src/main/java/hudson/plugins/jira/JiraEnvironmentContributingAction.java | Add issuesSize field, getter, constructor parameter, and contribute it to the environment |
| src/main/resources/hudson/plugins/jira/JiraEnvironmentVariableBuilder/help.html | Document new JIRA_ISSUES_SIZE variable |
| src/test/java/hudson/plugins/jira/JiraEnvironmentVariableBuilderTest.java | Update tests to handle builder’s new boolean return and size logging |
| src/test/java/hudson/plugins/jira/JiraEnvironmentContributingActionTest.java | Update tests to expect three env vars (ISSUES, SIZE, URL) |
| src/main/java/hudson/plugins/jira/versionparameter/JiraVersionParameterDefinition.java | Adjust constructor to call setDescription after super(name) |
Comments suppressed due to low confidence (3)
src/test/java/hudson/plugins/jira/JiraEnvironmentVariableBuilderTest.java:98
- The new
JIRA_ISSUES_SIZElog message isn’t asserted intestPerformAddsAction. Consider adding averify(listener.getLogger()).println(...)check for the size update to ensure full coverage of the new behavior.
boolean result = builder.perform(build, launcher, listener);
src/main/java/hudson/plugins/jira/versionparameter/JiraVersionParameterDefinition.java:40
- [nitpick] If the parent class provides a
super(name, description)constructor, consider using it directly instead of callingsuper(name)followed bysetDescription(description)for clearer intent and less boilerplate.
super(name);
src/test/java/hudson/plugins/jira/JiraEnvironmentContributingActionTest.java:20
- [nitpick] The test methods were made
public, whereas other JUnit Jupiter tests in this module remain package-private. Consider reverting to package-private for consistency with the existing style.
public void buildEnvVarsEnvIsNull() {
src/main/java/hudson/plugins/jira/JiraEnvironmentContributingAction.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI
pushed a commit
that referenced
this pull request
Jun 20, 2025
* Add configurable JIRA_ISSUES_SIZE to the JiraEnvironmentVariableBuilder --------- Co-authored-by: Pawel Kozikowski <pawel.kozikowski@atos.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributed by @mupakoz in #119
Adds JiraIssuesSizeEnvironmentVariableBuilder build step which enables saving number of issues matching a JQL query in a environment variable of specified name.
I came up with this idea for a new feature when I wanted to fail the build in case there are issues on JIRA that were resolved but still untested. Thanks to the plugin we can save the number of issues we are interested in and then use it in the next steps (for example a shell script or a conditional step).