-
Notifications
You must be signed in to change notification settings - Fork 89
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
Handle presence of index.jelly differently #345
Conversation
Signed-off-by: Thierry Wasylczenko <[email protected]>
I'm not at ease thinking that Such goal should always be reproducible, and here if you call it twice, the first call will fail, and the second one will succeed. Adding a separate goal to implement such behaviour would be acceptable IMO. |
I'm not sure generating sources outside directories expected to contain something like that is expected. Since users will need to I could see an argument for generating the |
Sorry for maybe being unclear: the generated file is in |
Signed-off-by: Thierry Wasylczenko <[email protected]>
Ah, I was confused by the path in the error message 🤦 |
I got confused as well. Looks okay to me. CI still needs fixing. |
Signed-off-by: Thierry Wasylczenko <[email protected]>
Signed-off-by: Thierry Wasylczenko <[email protected]>
Signed-off-by: Thierry Wasylczenko <[email protected]>
Signed-off-by: Thierry Wasylczenko <[email protected]>
I don't understand the current tests failures as in the output, there is the message which is checked in the logs 🤷 |
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 strong opinion, but
a case could be made that developers are expected to provide a better description
I think this is a good opportunity to just have the developer take a couple minutes to write the description they wish to show to users, possibly with formatting. Most plugins already have an index.jelly
so this should only affect a small minority anyway.
Signed-off-by: Thierry Wasylczenko <[email protected]>
Signed-off-by: Thierry Wasylczenko <[email protected]>
Co-authored-by: Jesse Glick <[email protected]>
Signed-off-by: Thierry Wasylczenko <[email protected]>
@@ -149,15 +149,15 @@ private void performPackaging() | |||
final OutputStreamWriter indexJellyWriter = new OutputStreamWriter(fos, StandardCharsets.UTF_8)) { | |||
indexJellyWriter.write("<?jelly escape-by-default='true'?>\n" + |
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.
This should be setting an XML encoding line.
<?xml version="1.0" encoding="UTF-8"?>
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.
The previous error suggested:
throw new MojoFailureException("Missing " + indexJelly + ". Delete any <description> from pom.xml and create src/main/resources/index.jelly:\n" +
"<?jelly escape-by-default='true'?>\n" +
"<div>\n" +
" The description here…\n" +
"</div>");
🤣
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.
Fixed it
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 am not sure why we would want this behaviour at all.
the Update center will use the description if the index.jelly is not found (as will the plugin manager if I am not mistaken).
So all this does is make a currently failing (has a description but no index.jelly) build pass.
You could just as easily do that by not failing in the first place (change the failure to a warning if there is no index.jelly) and avoid this generation.
but if the point is that people do not pay attention to warnings - why would they pay attention to the new warning here and provide something better?
Closing as stale. Nobody approved it in a year. |
Signed-off-by: Thierry Wasylczenko [email protected]
Currently if there is no
src/main/resources/index.jelly
file in the Jenkins plugin sources,mvn hpi:run
will fail the build indicating the file must be created using the POM's<description>
. This behaviour has been introduced in #302. As I like to enforce the creation ofindex.jelly
, the current approach:<description>
in the POM<description>
from your POMIMO this could be improved for plugins author's UX. If the description is present but the the file is not, I assume the author:
index.jelly
to be different from the descriptionThis PR aims to provide the following behaviours:
In case the
index.jelly
file doesn't exist and the description is provided, create the file undertarget/classes
and log a warningIn case the
index.jelly
file doesn't exist and the description is not provided, then throw an error to enforce the creation of the file by the authorIn case the
index.jelly
file is provided, use itMake sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
Ensure that the pull request title represents the desired changelog entry
Please describe what you did
Link to relevant issues in GitHub or Jira
Link to relevant pull requests, esp. upstream and downstream changes
Ensure you have provided tests - that demonstrates feature works or fixes the issue