Skip to content

test: verify packaged Jackson reads public Docker annotations - #11335

Open
anqorithm wants to merge 1 commit into
testcontainers:mainfrom
anqorithm:fix/jackson-shading-11236
Open

anqorithm wants to merge 1 commit into
testcontainers:mainfrom
anqorithm:fix/jackson-shading-11236

Conversation

@anqorithm

@anqorithm anqorithm commented Dec 7, 2025 •

Copy link
Copy Markdown

Add a packaged-JAR regression that verifies the shaded Docker mapper reads ID, Containers, and DockerRootDir into the public Info model. Give the JAR tests the existing runtime dependencies needed to exercise that boundary, run them in the minimal CircleCI job, and clarify that jackson-annotations remains an unshaded public dependency.

Related to #11236. The earlier annotation-shading patch has been removed: it made these fields deserialize as null. This revision provides regression coverage and documentation; support for applications forcing older Jackson annotations remains outside this change, and #11236 is not resolved by it.

Validation: the regression fails against the earlier shading patch and passes with annotations preserved. On current upstream main, jarFileTest passes (679 cases, 15 skipped, no failures), and Java/full Spotless checks pass. The combined CI task plan validates with Gradle dry-run. Final CircleCI job49741 passes on cec9d3b. CodeRabbit completed with no actionable comments. Its recorded results confirm the new annotation regression succeeds: 674 tests passed and 16 skipped, including 10 passing Docker integration cases and one Docker skip.

Recorded validation

@anqorithm
anqorithm requested a review from a team as a code owner December 7, 2025 03:30
@anqorithm
anqorithm marked this pull request as draft November 3, 2026 08:58
@anqorithm

anqorithm commented Nov 3, 2026 •

Copy link
Copy Markdown
Author

Revised in cec9d3b. The unsafe annotation-shading patch is removed. The PR now adds a packaged-JAR regression and documents the public annotation dependency. The regression fails with the old patch and passes with annotations preserved; package tests, Checkstyle and formatting pass on current upstream main. The minimal CircleCI job now runs the package tests too. This does not resolve #11236 for applications forcing older Jackson annotations. Final CircleCI49741 passes, including the new package regression and Docker integration; the docs preview also passes. CodeRabbit completed with no actionable comments.

Recorded validation

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

It’s great that you still remember this PR and the original issue; I honestly have no idea where the maintainers of testcontainers-java have gone over the last two years.😂

@anqorithm anqorithm closed this Nov 3, 2026
@anqorithm
anqorithm force-pushed the fix/jackson-shading-11236 branch from 8ff30c3 to f74d167 Compare November 3, 2026 10:08
@anqorithm anqorithm reopened this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The JAR test runtime classpath now includes project runtime dependencies. A new test checks Docker model deserialization through the shaded mapper. CI runs the test, and documentation describes the Jackson annotation dependency and compatibility warning.

Changes: Shaded mapper compatibility

Layer / File(s) Summary
Run and document shaded mapper validation
core/build.gradle, core/src/jarFileTest/java/org/testcontainers/JarFileShadingTest.java, .circleci/config.yml, docs/index.md
The JAR test uses the project runtime classpath and verifies Docker model values deserialized through the shaded mapper. The minimal core CI job runs the JAR test. The documentation notes that jackson-annotations is unshaded and that forcing an older Jackson version can cause linkage errors.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

Suggested reviewers: eddumelendez

Merge Risk: Minimal · up to cec9d

The change adds packaged-mapper regression coverage and documents the public Jackson annotation dependency. No actionable merge-blocking issue was identified; merge after normal CI succeeds.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names a test for packaged Jackson reading public Docker annotations. The changeset adds a packaged-JAR regression test that reads ID, Containers, and DockerRootDir into the public Info model…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description covers the main change: a packaged-JAR regression test for reading ID, Containers, and DockerRootDir into the public Info model, JAR test runtime dependencies, the minimal CircleCI job…
Full details: Title check

Explanation

The title names a test for packaged Jackson reading public Docker annotations. The changeset adds a packaged-JAR regression test that reads ID, Containers, and DockerRootDir into the public Info model, so the title matches the main change. It uses a conventional test: prefix and is specific enough for a teammate scanning history.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

Full details: Description check

Explanation

The description covers the main change: a packaged-JAR regression test for reading ID, Containers, and DockerRootDir into the public Info model, JAR test runtime dependencies, the minimal CircleCI job change, and the jackson-annotations documentation note. It also states the earlier shading patch was removed, that #11236 is not resolved, and gives validation results. It follows the template's intent (describes changes and context, references an issue with #). It does not follow the template's required checklist-style items (e.g., confirmation that checkstyleMain, checkstyleTest and spotlessApply were run is only partially addressed through Spotless reporting; no new-module or dependency-upgrade concerns apply). The validation section references an external image and a 'CodeRabbit' result, which is supporting evidence rather than a template requirement. Overall the description is mostly complete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7cdae884-141f-4583-8ef9-9e02ef30f92a
Commits

Reviewing files that changed from the base of the PR and between 25382d2 and cec9d3b.

Files selected for processing: 1
  • .circleci/config.yml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@anqorithm anqorithm changed the title Fix: Shade jackson-annotations and jackson-core to avoid classpath conflicts test: verify packaged Jackson reads public Docker annotations Nov 3, 2026
@anqorithm
anqorithm marked this pull request as ready for review November 3, 2026 10:09
@anqorithm
anqorithm force-pushed the fix/jackson-shading-11236 branch from 25382d2 to cec9d3b Compare November 3, 2026 10:13
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.

2 participants