Skip to content
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

Defaulting to a StringParameterValue #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dannystaple
Copy link

Currently the rebuild plugin will throw an exception if it encounters a parameter type it doesn't know about - which could be introduced by many other plugins or custom HPI's.

This can be worked around by copying the StringParameterValue.jelly to one with the name of the new parameter type and restarting Jenkins - somewhat inconvenient, especially where restarting is an option that may need to be scheduled on a busy CI/Test farm.

These changes will cause the RebuildPlugin to use the custom jelly for a ParameterValue type if it exists in the folder, but if there is none, it will fall back to the StringParameterValue rendering, which for all but a few unusual cases, should be good enough. This saves rebuild plugin having to peg new plugins, and saves having to work around and restart for busy installations.

Tested on the current Jenkins LTS version.

If a parameter type from a plugin is not yet supported in the rebuild plugin, instead of raising an exception, default to use the StringParameterValue, which for most cases, will behave correctly.
Missing parameter types will now default to the StringParameterValue template.
My last commit was ALWAYS defaulting to StringParameterValue.
This will fallback properly. The problem was that the file exists was dependant on the PWD - not the classpath. Handling this exception here works instead.
@cloudbees-pull-request-builder

plugins » rebuild-plugin #22 SUCCESS
This pull request looks good

<st:include it="${parameterValue}"
from="${it}" page="${valuePage}.jelly"/>
</j:catch>
<j:if test="${ex != null and ex.toString().contains('No page found')}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that this check is OK, because it relies on non-documented text, etc. I suppose it should be implemented in the Java code. I suppose that it can be implemented using small patch in #17

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense - changing the Jelly seemed like a least intrusive patch, but "No page found" is merely human readable text and my code here is treating it as protocol.

@shemeersulaiman
Copy link
Member

Mistakenly pressed Merge pull request :( but the actual merge is not happened somebody please confirm how to reopen, or we cant reopen.

@rsandell
Copy link
Member

This is still open, but needs a rebase in order to be mergeable via the button.

@hagzag hagzag closed this Jun 16, 2015
@hagzag hagzag reopened this Jun 16, 2015
@GLundh GLundh force-pushed the master branch 2 times, most recently from 370af40 to 316c049 Compare March 3, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants