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
[JENKINS-24398] Support for Token Macro Plugin in description #4
[JENKINS-24398] Support for Token Macro Plugin in description #4
Conversation
- Initial commit
plugins » description-setter-plugin #9 SUCCESS |
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
@@ -47,7 +49,11 @@ public static boolean setDescription(AbstractBuild<?, ?> build, | |||
result = build.getEnvironment(listener).expand(result); | |||
} else { | |||
if (result == null && regexp == null && description != null) { | |||
result = description; | |||
try { | |||
result = TokenMacro.expandAll(build, listener, description); |
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.
Since token-macro is only an optional plugin dependency you'll risk getting a ClassNotFoundException here.
You should maybe do an "if plugin installed" check here as well.
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.
I see two options here:
- Make the dependency to the Token Macro plugin mandatory
- Add a check if the plugin is installed.
I actually propose option 1 as this is the most convenient option for the user as in this case the Token Macro plugin is automatically installed if missing.
Let me know your thoughts.
+1 this would be awesome to have! |
- Make token macro support optional.
Added check if token macro plugin is installed. If token plugin is installed then macros are expanded. If not then the description is used verbatim. |
Looks like PR used to be legit at one point but now has conflicts? Any chance of a fix-up so this can get into a release? |
Let's close this in favor of #11 unless anyone objects. |
Supports to expansion of macros provided via the token macro plugin.
Macros are expanded only if no regex is given.