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

Upgrade to Jetty 12 ee8 #341

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

Upgrade to Jetty 12 ee8 #341

wants to merge 11 commits into from

Conversation

olamy
Copy link
Member

@olamy olamy commented Aug 16, 2023

Signed-off-by: Olivier Lamy olamy@apache.org

Copy link
Member

@basil basil left a 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!

olamy added 3 commits May 7, 2024 10:28
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
@olamy
Copy link
Member Author

olamy commented May 7, 2024

fixed.

Jenkinsfile Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
src/main/java/winstone/HostConfiguration.java Show resolved Hide resolved
src/main/java/winstone/HostConfiguration.java Outdated Show resolved Hide resolved
src/main/java/winstone/HostConfiguration.java Outdated Show resolved Hide resolved
src/main/java/winstone/HostConfiguration.java Outdated Show resolved Hide resolved
src/main/java/winstone/HostConfiguration.java Outdated Show resolved Hide resolved
src/main/java/winstone/HostConfiguration.java Outdated Show resolved Hide resolved

// 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
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

done with df6cfee

@olamy
Copy link
Member Author

olamy commented May 7, 2024

what about setup spotless for winstone?
Discussing and fixing extra spaces is an absolute waste of time.

@olamy
Copy link
Member Author

olamy commented May 7, 2024

spotless #380

@basil
Copy link
Member

basil commented May 8, 2024

I have merged master into this branch and resolved the five issues related to unnecessary stylistic changes. The other feedback remains.

@olamy
Copy link
Member Author

olamy commented May 8, 2024

I have merged master into this branch and resolved the five issues related to unnecessary stylistic changes. The other feedback remains.

thanks for that!

a bit busy. So I will try to look at other comments, but probably not before the end of the week.

@basil
Copy link
Member

basil commented May 8, 2024

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.

olamy and others added 3 commits May 9, 2024 07:38
Co-authored-by: Basil Crow <me@basilcrow.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
pom.xml Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
src/main/java/winstone/accesslog/SimpleAccessLogger.java Outdated Show resolved Hide resolved
remoteUser = null;
}

// https://github.com/jetty/jetty.project/blob/3632a57f2796a2ab4fcdbfe62837d494bcd4e94a/jetty-core/jetty-server/src/main/java/org/eclipse/jetty/server/CustomRequestLog.java#L307
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

src/main/java/winstone/HostConfiguration.java Outdated Show resolved Hide resolved
olamy and others added 3 commits May 10, 2024 06:55
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Co-authored-by: Basil Crow <me@basilcrow.com>
@olamy
Copy link
Member Author

olamy commented May 9, 2024

my bad merge should be fixed. sorry for that.

Copy link
Member

@basil basil left a 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>
Copy link
Member

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>
Copy link
Member

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.

Suggested change
<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"));
Copy link
Member

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:

Suggested change
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) {
Copy link
Member

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:

Suggested change
private WebAppContext create(File app, String prefix, Server server) {
private WebAppContext create(File app, String prefix) {

Comment on lines +116 to +117
this.server
.getMimeTypes()
Copy link
Member

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:

Suggested change
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 {

Copy link
Member

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants