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
Upgrade to Jetty 12 ee8 #341
base: master
Are you sure you want to change the base?
Conversation
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.
Please take a moment and address the merge conflicts of your pull request. Thanks!
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
fixed. |
|
||
// mimic https://github.com/eclipse/jetty.project/blob/jetty-9.4.0.v20161208/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractNCSARequestLog.java#L130 |
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 old comment was valuable. Why delete it, rather than updating it? I think we should update it to:
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.
done with df6cfee
what about setup spotless for winstone? |
spotless #380 |
I have merged |
thanks for that! a bit busy. So I will try to look at other comments, but probably not before the end of the week. |
Thanks @olamy! In the absence of an update next week, I will assume you are no longer interested in contributing to this project, either through code or through feedback. |
Co-authored-by: Basil Crow <me@basilcrow.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
remoteUser = null; | ||
} | ||
|
||
// https://github.com/jetty/jetty.project/blob/3632a57f2796a2ab4fcdbfe62837d494bcd4e94a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java#L307 |
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.
Given the content the comment is referring to, the comment is placed above the wrong block of code. It should be placed above Request.AuthenticationState authenticationState
.
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 link is going to the NCSA format used by the Jetty.
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.
In the old (currently shipping) code, there was a single comment above the copy-pasted code to set the remote user, showing where it was originally from. The new version still has copy-pasted code to set the remote user, but has lost any reference to the original code, which is technically a regression (in documentation). To fix this, the original link should be changed from a reference to the copy-pasted Jetty 10 code to the copy-pasted Jetty 12 code (https://github.com/jetty/jetty.project/blob/c5b2533fdecce21b54c6fbaf36f79bc3ba909775/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java#L1093-L1099).
Adding a link to the NCSA format is a valuable change, but it isn't strictly related to this PR (moving from Jetty 10 to Jetty 12), so I think if that change is desired then a separate PR should be opened to introduce it. That PR could be merged immediately and would reduce the size of this diff.
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Basil Crow <me@basilcrow.com>
my bad merge should be fixed. sorry for that. |
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 is looking really close to finished! Very nice!
<changelist>-SNAPSHOT</changelist> | ||
<jetty.version>10.0.20</jetty.version> | ||
<jetty.version>12.0.9</jetty.version> |
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.
README.md
should also be updated to replace 10.0.x with 12.0.x.
<slf4j.version>2.0.13</slf4j.version> | ||
<gitHubRepo>jenkinsci/winstone</gitHubRepo> | ||
<maven.compiler.release>17</maven.compiler.release> |
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 is working around the fact that the parent POM doesn't (yet!) require Java 17 JENKINS-73121. Since we might forget to remove this workaround once JENKINS-73121 is resolved, let's leave a TODO comment here referencing JENKINS-73121.
<maven.compiler.release>17</maven.compiler.release> | |
<!-- TODO JENKINS-73121 until in parent POM --> | |
<maven.compiler.release>17</maven.compiler.release> |
} | ||
} | ||
} | ||
|
||
server.setRequestLog(configureAccessLog("webapp")); |
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.
configureAccessLog
can return null, so I think we should wrap this in a null check:
server.setRequestLog(configureAccessLog("webapp")); | |
RequestLog requestLog = configureAccessLog("webapp"); | |
if (requestLog != null) { | |
server.setRequestLog(requestLog); | |
} |
} | ||
|
||
private WebAppContext create(File app, String prefix) { | ||
private WebAppContext create(File app, String prefix, Server server) { |
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.
There is already a field named Server server
. Shadowing this field in an argument variable is a confusing practice and Checkstyle has a HiddenField
check that complains about this. I recommend simply reverting this hunk so that the field is used rather than the parameter:
private WebAppContext create(File app, String prefix, Server server) { | |
private WebAppContext create(File app, String prefix) { |
this.server | ||
.getMimeTypes() |
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.
A few lines above on line 96, you don't qualify the access to the server
field (server.getMimeTypes().addMimeMapping(extension.toLowerCase(), mimeType);
), so for consistency I don't think we should qualify the access here either:
this.server | |
.getMimeTypes() | |
server.getMimeTypes() |
@@ -56,7 +57,6 @@ public class SimpleAccessLogger extends AbstractLifeCycle implements RequestLog | |||
value = "PATH_TRAVERSAL_IN", | |||
justification = "false positive, webAppName come from command line") | |||
public SimpleAccessLogger(String webAppName, Map<String, String> startupArgs) throws IOException { | |||
|
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.
Unnecessary change?
remoteUser = null; | ||
} | ||
|
||
// https://github.com/jetty/jetty.project/blob/3632a57f2796a2ab4fcdbfe62837d494bcd4e94a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java#L307 |
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.
In the old (currently shipping) code, there was a single comment above the copy-pasted code to set the remote user, showing where it was originally from. The new version still has copy-pasted code to set the remote user, but has lost any reference to the original code, which is technically a regression (in documentation). To fix this, the original link should be changed from a reference to the copy-pasted Jetty 10 code to the copy-pasted Jetty 12 code (https://github.com/jetty/jetty.project/blob/c5b2533fdecce21b54c6fbaf36f79bc3ba909775/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java#L1093-L1099).
Adding a link to the NCSA format is a valuable change, but it isn't strictly related to this PR (moving from Jetty 10 to Jetty 12), so I think if that change is desired then a separate PR should be opened to introduce it. That PR could be merged immediately and would reduce the size of this diff.
Signed-off-by: Olivier Lamy olamy@apache.org