-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
Add sentry-servlet-jakarta module #1987
Conversation
testImplementation(Config.TestLibs.kotlinTestJunit) | ||
testImplementation(Config.TestLibs.mockitoKotlin) | ||
testImplementation(Config.TestLibs.awaitility) | ||
} |
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.
pulling in spring-boot-starter-test:3.0.0-M2 would have required Java 17
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.
Yes.
} | ||
} | ||
|
||
fun mockRequest(url: String, method: String = "GET", headers: Map<String, Any?> = emptyMap()): HttpServletRequest { |
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 a minimalistic replacement for MockHttpServletRequestBuilder
and MockHttpServletRequest
from spring-test
which I didn't want to pull in to avoid Java 17.
|
||
verify(fixture.hub).addBreadcrumb( | ||
check { it: Breadcrumb -> | ||
assertEquals("/some-uri", it.getData("url")) |
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 assertion differs from the one for sentry-servlet
as we simply set requestURI
to the full url including protocol and host there which is not what getRequestURI
usually returns according to https://docs.oracle.com/javaee/5/api/javax/servlet/http/HttpServletRequest.html#getRequestURI()
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.
Looks good. Have you considered adding a sample project so that we can easily verify that it actually works on servlet container supporting Jakarta EE?
Going to add it |
@@ -24,6 +24,7 @@ targets: | |||
maven:io.sentry:sentry-spring: | |||
maven:io.sentry:sentry-spring-boot-starter: | |||
maven:io.sentry:sentry-servlet: | |||
maven:io.sentry:sentry-servlet-jakarta: |
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.
Doing it on this PR will fail the publish release since it does not exist under https://github.com/getsentry/sentry-release-registry yet
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.
Created a PR for adding it there: getsentry/sentry-release-registry#69
📜 Description
Add
sentry-servlet-jakarta
module to supportjakarta.servlet-api
which has been moved fromjavax.servlet-api
.💡 Motivation and Context
Partially fixes #1789
Spring and Spring Boot require more investigation: #1984
💚 How did you test it?
📝 Checklist
🔮 Next steps