-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JiraIssuesSizeEnvironmentVariableBuilder build step #119
base: master
Are you sure you want to change the base?
Conversation
How about extending JiraEnvironmentContributingAction + JiraEnvironmentVariableBuilder to provide issue number in ENV from the used AbstractIssueSelector? |
It seems that there is a problem with the JiraEnvironmentVariableBuilder if I understand the files correctly (forgive me I am a Jenkins plugin developer newbie). In the config.jelly there is a condition for the issue selector: 'if descriptor.hasIssueSelectors()' but the method 'hasIssueSelectors' is not defined in the class DescriptorImpl. That's why the control for choosing the selector does not show up. I can fix the error in my PR. Do you think the ENV var name should be set arbitrary or the user should be able to set it? |
I just thought that when using JiraEnvironmentVariableBuilder with arbitrary variable names we would be limited to only one set of issues per job. |
|
|
|
*/ | ||
package hudson.plugins.jira; | ||
|
||
import hudson.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have agreed approach not to use wildcard imports, could you expand those?
} | ||
|
||
@Override | ||
public void buildEnvVars(AbstractBuild<?, ?> ab, EnvVars ev) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no two letter variable names please :)
@mupakoz ping, are you able to address review comments? |
Yes, sorry for my inactivity. I will fix the implementation and the comments by the end of this week. |
@mupakoz ping? :-) |
cba77e6
to
0f1eeb3
Compare
@warden done. Let me know what you think. |
I also added the hasIssueSelectors() method because I think it was missing in the class. |
</j:if> | ||
<f:advanced> | ||
<f:entry title="${%Issues size variable name}" field="issuesSizeVariableName"> | ||
<f:textbox default="JIRA_ISSUES_SIZE"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to use word COUNT instead of SIZE.
size is usually used when creating an object of specific size to show how many elements can fit in collection, not how many there are
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applies to all files of course :)
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).
Please let me know what you think!
This change is