Skip to content

test(servlet): Verify Servlet 3.1 and 4.0 compatibility - #6624

Open
adinauer wants to merge 6 commits into
mainfrom
chore/servlet-api-compatibility-stack
Open

adinauer wants to merge 6 commits into
mainfrom
chore/servlet-api-compatibility-stack

Conversation

@adinauer

@adinauer adinauer commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Servlet API)


📜 Description

Keep javax.servlet:javax.servlet-api at 3.1.0 as the production compile target and exclude the intentionally pinned dependency from Dependabot updates.

Add a real-container integration test that runs on both Tomcat 8.5 / Servlet 3.1 and Tomcat 9 / Servlet 4.0.

💡 Motivation and Context

Compiling against the minimum supported Servlet API prevents accidental use of Servlet 4-only APIs. The runtime matrix verifies that the same standalone sentry-servlet integration works at both ends of the supported javax.servlet range.

The existing servlet4-api catalog alias remains available for code that intentionally targets Servlet 4.

💚 How did you test it?

  • make format api
  • ./gradlew :sentry-servlet:integrationTest :sentry-servlet:integrationTestTomcat9 --rerun-tasks --no-build-cache
  • Verified compileClasspath resolves javax.servlet-api:3.1.0
  • Verified the isolated JVM test-suite runtimes resolve Tomcat 8.5.100 and Tomcat 9.0.108 respectively

📝 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

Merge PR #6625 into this branch with a merge commit, then squash-merge this collection PR into main.

#skip-changelog

@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.65.0 (1) release

⚙️ sentry-android Build Distribution Settings

dependabot Bot and others added 2 commits November 17, 2026 08:05
…#6475)

Bumps [javax.servlet:javax.servlet-api](https://github.com/javaee/servlet-spec) from 3.1.0 to 4.0.1.
- [Commits](javaee/servlet-spec@3.1.0...4.0.1)

---
updated-dependencies:
- dependency-name: javax.servlet:javax.servlet-api
  dependency-version: 4.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Compile the javax servlet integrations against the minimum supported API.
Exclude the intentionally pinned API from Dependabot while retaining the
separate Servlet 4 alias for latest-runtime coverage.

Co-Authored-By: Claude <[email protected]>
@adinauer adinauer changed the title chore(servlet): Update Servlet API compatibility test(servlet): Verify Servlet 3.1 and 4.0 compatibility Nov 17, 2026
@adinauer
adinauer marked this pull request as ready for review November 17, 2026 13:23
@adinauer
adinauer requested a review from a team as a code owner November 17, 2026 13:23
@adinauer
adinauer requested review from 0xadam-brown and markushi and removed request for a team November 17, 2026 13:23
@github-actions github-actions Bot added the risk: low PR risk score: low label Nov 17, 2026
adinauer and others added 2 commits November 19, 2026 11:53
* test(servlet): Test Servlet 3.1 on Tomcat 8.5

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.

* test(servlet): Run integration test on Tomcat 9

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.

* build(servlet): Use JVM test suites for Tomcat 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 <[email protected]>

* build(servlet): Remove unused Truth dependency

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]>

* build(deps): Share the Tomcat 9 version

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]>

* test(servlet): Run Tomcat matrix in dedicated CI job

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]>

* ci: Move integration tests to dedicated workflow

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]>

* ci: Restrict integration test workflow permissions

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]>

---------

Co-authored-by: Claude <[email protected]>
@socket-security

socket-security Bot commented Nov 19, 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

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

Reviewed by Cursor Bugbot for commit 3e48695. Configure here.

Comment thread gradle/libs.versions.toml Resolved
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: low PR risk score: low labels Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 97f84a7.

The model rated this change low. It was raised to medium because:

  • R5: dependencies or bundled SDK versions changed: gradle/libs.versions.toml
  • R6: build or release configuration changed: .github/dependabot.yml, .github/workflows/integration-tests.yml, gradle/libs.versions.toml, sentry-servlet/build.gradle.kts
  • R7: the model was not confident enough that the change is low

This label is a hint for reviewers, not an approval.

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 19, 2026
Restore Tomcat 11.0.27 after the collection branch merge and use one catalog version for Catalina and embedded Jasper so future updates keep them 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

This branch has not been deployed

No deployments
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.

1 participant