Repository navigation
Conversation
|
Warning Socket is a tool Sentry Security team deployed to defend against supply chain attack. Please provide any feedback you have in #discuss-security slack channel ❤️
|
📲 Install BuildsAndroid
|
Run sentry-servlet against the minimum supported servlet container while keeping Servlet 3.1 as the production compile target. Exercise the service-loaded initializer through a real HTTP request and verify that request context reaches Sentry.
Reuse the real-container servlet integration test with a Tomcat 9 and Servlet 4 runtime classpath. Keep the Tomcat 8.5 run as the minimum-runtime check and attach both runs to the verification lifecycle.
db8bb6c to
6793b24
Compare
runningcode
left a comment
There was a problem hiding this comment.
there's a couple of gradle quirks in this that would be fixed by using the jvm test suite like we do for the spring boot matrix.
Replace the hand-built Tomcat 9 test task with isolated JVM test suites. Run the shared servlet integration test with independent Tomcat 8.5 and Tomcat 9 dependency graphs and attach both suites to check. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bc1635c. Configure here.
runningcode
left a comment
There was a problem hiding this comment.
thanks for fixing this! i left some more comments but approving as well!
The servlet integration suites declare Truth directly, so the regular unit test configuration no longer needs it after moving the integration test. Co-Authored-By: Claude <noreply@anthropic.com>
Reference one catalog version from the Tomcat 9 core, Catalina, and Jasper aliases so dependency updates keep the runtime components aligned. Co-Authored-By: Claude <noreply@anthropic.com>
Compile the servlet integration test once and execute it with separate Tomcat 8.5 and Tomcat 9 runtime targets. Move both targets out of the standard check lifecycle and run them in a dedicated CI job. Co-Authored-By: Claude <noreply@anthropic.com>
Create a shared workflow for non-Spring Boot integration suites and move the servlet runtime matrix there instead of adding it to the main build workflow. Co-Authored-By: Claude <noreply@anthropic.com>

PR Stack (Servlet API)
📜 Description
Add a real-container integration test for
sentry-servletand run it on both Tomcat 8.5 / Servlet 3.1 and Tomcat 9 / Servlet 4.0.The shared test loads
SentryServletContainerInitializerthroughServiceLoader, sends an HTTP request through embedded Tomcat, and verifies that the captured Sentry event contains the request method, URL, and query string. A single JVM test suite compiles the test once and exposes separate Tomcat 8.5 and Tomcat 9 runtime targets.💡 Motivation and Context
Production code remains compiled against the minimum supported Servlet 3.1 API, preserving the compiler-enforced compatibility floor. Running the same compiled test against Servlet 3.1 and Servlet 4.0 verifies both the minimum runtime and the latest
javax.servletruntime.The servlet integration targets run in the shared non-Spring Boot integration-test workflow rather than as part of the standard
checklifecycle.💚 How did you test it?
make format api./gradlew :sentry-servlet:test :sentry-servlet:integrationTest :sentry-servlet:integrationTestTomcat9 --rerun-tasks --no-build-cachecompileClasspathresolvesjavax.servlet-api:3.1.0:sentry-servlet:checkdoes not include the integration targets📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None.
#skip-changelog