Skip to content

chore: Add missing JSpecify annotations to docling-testcontainers#592

Merged
edeandrea merged 1 commit into
mainfrom
jspecify-annotation
Jul 16, 2026
Merged

chore: Add missing JSpecify annotations to docling-testcontainers#592
edeandrea merged 1 commit into
mainfrom
jspecify-annotation

Conversation

@ThomasVitale

@ThomasVitale ThomasVitale commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
  • Add missing JSpecify annotations to the docling-testcontainers module.
  • Fix bug affecting the containerEnv map being immutable when adding more variables (e.g. after calling the toBuilder() method).

Copilot AI review requested due to automatic review settings July 16, 2026 06:11

Copilot AI 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.

Pull request overview

This PR updates the docling-testcontainers module configuration API to add missing JSpecify nullability annotations and to fix a toBuilder() regression where containerEnv could become immutable and fail when adding additional environment variables.

Changes:

  • Add @Nullable annotations to builder fields and to Builder.apiKey(...) to better express nullability expectations.
  • Fix toBuilder()-based config cloning by copying containerEnv into a mutable HashMap before further builder mutations.
  • Minor container setup call-site adjustments (this.withEnv(...), etc.) and stricter blank-check for image.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
docling-testcontainers/src/main/java/ai/docling/testcontainers/serve/DoclingServeContainer.java Uses explicit this. qualifiers when configuring the container instance.
docling-testcontainers/src/main/java/ai/docling/testcontainers/serve/config/DoclingServeContainerConfig.java Adds nullability annotations and fixes containerEnv mutability issues when using toBuilder().
docling-testcontainers/src/main/java/ai/docling/testcontainers/serve/config/DefaultDoclingContainerConfig.java Tightens validation for image using isBlank().

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

:java_duke: JaCoCo coverage report

Overall Project 47.59% 🔴
Files changed 100% 🟢

Module Coverage
test-report-aggregation 47.61% 🟢
test-report-aggregation 47.61% 🟢
test-report-aggregation 47.58% 🟢
test-report-aggregation 47.58% 🟢
Files
Module File Coverage
test-report-aggregation DoclingServeContainer.java 100% 🟢
DoclingServeContainerConfig.java 95.05% 🟢
DefaultDoclingContainerConfig.java 91.94% 🟢
test-report-aggregation DoclingServeContainer.java 100% 🟢
DoclingServeContainerConfig.java 95.05% 🟢
DefaultDoclingContainerConfig.java 91.94% 🟢
test-report-aggregation DoclingServeContainer.java 100% 🟢
DoclingServeContainerConfig.java 95.05% 🟢
DefaultDoclingContainerConfig.java 91.94% 🟢
test-report-aggregation DoclingServeContainer.java 100% 🟢
DoclingServeContainerConfig.java 95.05% 🟢
DefaultDoclingContainerConfig.java 91.94% 🟢

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
Gradle Test Results (all modules & JDKs)1792 ran1792 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

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

Only one comment on the image field - it can not be null (the docs even say so).

@edeandrea

Copy link
Copy Markdown
Contributor

Also I think some of the copilot comments are valid

Copilot AI review requested due to automatic review settings July 16, 2026 20:05
@ThomasVitale
ThomasVitale force-pushed the jspecify-annotation branch from c76fe68 to ff40330 Compare July 16, 2026 20:05

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings July 16, 2026 20:09
@ThomasVitale
ThomasVitale force-pushed the jspecify-annotation branch from ff40330 to 50335e2 Compare July 16, 2026 20:09
@ThomasVitale
ThomasVitale force-pushed the jspecify-annotation branch from 50335e2 to b782cc2 Compare July 16, 2026 20:11

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings July 16, 2026 20:12

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings July 16, 2026 20:16
@ThomasVitale
ThomasVitale force-pushed the jspecify-annotation branch from b782cc2 to 41d2551 Compare July 16, 2026 20:16
@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

* Add missing JSpecify annotations.
* Fix bug affecting the containerEnv map being immutable when adding more variables (e.g. after calling the toBuilder() method).
* Add unit tests for the config builder.

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 16, 2026 20:24
@ThomasVitale
ThomasVitale force-pushed the jspecify-annotation branch from 41d2551 to 47bc7c2 Compare July 16, 2026 20:24

Copilot AI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

docling-testcontainers/src/main/java/ai/docling/testcontainers/serve/config/DoclingServeContainerConfig.java:199

  • The Javadoc for Builder.image(String) says it throws IllegalArgumentException when the provided image is null/empty/blank, but the current implementation just assigns and defers validation until build() (via DefaultDoclingContainerConfig). Either update the Javadoc to reflect deferred validation or fail fast here so callers get the documented behavior at the point of call.
    /**
     * Sets the name of the container image to use for the configuration.
     * This value is required and must not be null, empty, or blank.
     *
     * @param image the name of the container image
     * @return the builder instance for method chaining
     * @throws IllegalArgumentException if the provided image is null, empty, or blank
     */
    public Builder image(String image) {
      this.image = image;
      return this;
    }

@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

@edeandrea
edeandrea enabled auto-merge (squash) July 16, 2026 20:28
@edeandrea
edeandrea merged commit aceb74e into main Jul 16, 2026
28 checks passed
@edeandrea
edeandrea deleted the jspecify-annotation branch July 16, 2026 20:39
@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants