Skip to content

test(servlet): Test Servlet 3.1 and 4.0 runtimes - #6625

Merged
adinauer merged 8 commits into
chore/servlet-api-compatibility-stackfrom
test/servlet-api-compatibility-tomcat85
Nov 19, 2026
Merged

adinauer merged 8 commits into
chore/servlet-api-compatibility-stackfrom
test/servlet-api-compatibility-tomcat85

Conversation

@adinauer

@adinauer adinauer commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Servlet API)


📜 Description

Add a real-container integration test for sentry-servlet and run it on both Tomcat 8.5 / Servlet 3.1 and Tomcat 9 / Servlet 4.0.

The shared test loads SentryServletContainerInitializer through ServiceLoader, 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.servlet runtime.

The servlet integration targets run in the shared non-Spring Boot integration-test workflow rather than as part of the standard check lifecycle.

💚 How did you test it?

  • make format api
  • ./gradlew :sentry-servlet:test :sentry-servlet:integrationTest :sentry-servlet:integrationTestTomcat9 --rerun-tasks --no-build-cache
  • Verified compileClasspath resolves javax.servlet-api:3.1.0
  • Verified the target runtime classpaths resolve Tomcat 8.5.100 and Tomcat 9.0.108 respectively
  • Verified :sentry-servlet:check does not include the integration targets

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

None.

#skip-changelog

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

@socket-security

socket-security Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

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 ❤️

Priority Alert  (click "▶" to expand/collapse) Action
Critical priority
Critical CVE: Apache Tomcat - Security constraints not correctly applied in maven org.apache.tomcat.embed:tomcat-embed-core

CVE: GHSA-5m62-pw8w-7w9f Apache Tomcat - Security constraints not correctly applied (CRITICAL)

Affected versions: < 9.0.118; >= 10.1.0-M1 < 10.1.55; >= 11.0.0-M1 < 11.0.22

Patched version: 9.0.118

From: gradle/libs.versions.toml → maven/org.apache.tomcat.embed/[email protected]

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/org.apache.tomcat.embed/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Critical priority
Critical CVE: Apache Tomcat - Digest authenticator will authenticate any unknown user in maven org.apache.tomcat.embed:tomcat-embed-core

CVE: GHSA-h6fc-48rj-7qqh Apache Tomcat - Digest authenticator will authenticate any unknown user (CRITICAL)

Affected versions: < 9.0.118; >= 10.1.0-M1 < 10.1.55; >= 11.0.0-M1 < 11.0.22

Patched version: 9.0.118

From: gradle/libs.versions.toml → maven/org.apache.tomcat.embed/[email protected]

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/org.apache.tomcat.embed/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Critical priority
Critical CVE: Apache Tomcat - HTTP/2 request headers not validated in maven org.apache.tomcat.embed:tomcat-embed-core

CVE: GHSA-r29c-68gh-xp6x Apache Tomcat - HTTP/2 request headers not validated (CRITICAL)

Affected versions: >= 8.5.0 < 9.0.118; >= 10.1.0-M1 < 10.1.55; >= 11.0.0-M1 < 11.0.22

Patched version: 9.0.118

From: gradle/libs.versions.toml → maven/org.apache.tomcat.embed/[email protected]

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/org.apache.tomcat.embed/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Medium priority
Critical CVE: Apache Tomcat: Potential RCE and/or information disclosure and/or information corruption with partial PUT in maven org.apache.tomcat.embed:tomcat-embed-core

CVE: GHSA-83qj-6fr2-vhqg Apache Tomcat: Potential RCE and/or information disclosure and/or information corruption with partial PUT (CRITICAL)

Affected versions: >= 8.5.0 <= 8.5.100; >= 9.0.0.M1 < 9.0.99; >= 10.1.0-M1 < 10.1.35; >= 11.0.0-M1 < 11.0.3

Patched version: No patched versions

From: gradle/libs.versions.toml → maven/org.apache.tomcat.embed/[email protected]

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore maven/org.apache.tomcat.embed/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@sentry

sentry Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.64.0 (1) release

⚙️ sentry-android Build Distribution Settings

@adinauer adinauer changed the title test(servlet): [Servlet API 2] Test Servlet 3.1 on Tomcat 8.5 test(servlet): [Servlet API 2] Test Servlet 3.1 and 4.0 runtimes Nov 16, 2026
@adinauer
adinauer marked this pull request as ready for review November 16, 2026 15:11
@adinauer
adinauer requested a review from a team as a code owner November 16, 2026 15:11
@adinauer
adinauer requested review from romtsn and runningcode and removed request for a team November 16, 2026 15:11
@github-actions github-actions Bot added the risk: low PR risk score: low label Nov 16, 2026
Base automatically changed from dependabot/gradle/javax.servlet-javax.servlet-api-4.0.1 to chore/servlet-api-compatibility-stack November 17, 2026 07:05
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.
@adinauer
adinauer force-pushed the test/servlet-api-compatibility-tomcat85 branch from db8bb6c to 6793b24 Compare November 17, 2026 08:48
@adinauer adinauer changed the title test(servlet): [Servlet API 2] Test Servlet 3.1 and 4.0 runtimes test(servlet): Test Servlet 3.1 and 4.0 runtimes Nov 17, 2026

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread sentry-servlet/build.gradle.kts Resolved
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 <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread sentry-servlet/build.gradle.kts Resolved
Comment thread sentry-servlet/build.gradle.kts Resolved
Comment thread gradle/libs.versions.toml Resolved
Comment thread sentry-servlet/build.gradle.kts Resolved

@runningcode runningcode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for fixing this! i left some more comments but approving as well!

Comment thread sentry-servlet/build.gradle.kts Resolved
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 <[email protected]>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: low PR risk score: low labels Nov 19, 2026
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 <[email protected]>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 19, 2026
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 <[email protected]>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 19, 2026
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 <[email protected]>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 19, 2026
Limit the workflow token to read-only repository contents because the test, artifact, and step-summary operations do not require write access.

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 19, 2026
@adinauer
adinauer merged commit 31f58ed into chore/servlet-api-compatibility-stack Nov 19, 2026
48 of 49 checks passed
@adinauer
adinauer deleted the test/servlet-api-compatibility-tomcat85 branch November 19, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants