chore: Add missing JSpecify annotations to docling-testcontainers#592
Conversation
There was a problem hiding this comment.
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
@Nullableannotations to builder fields and toBuilder.apiKey(...)to better express nullability expectations. - Fix
toBuilder()-based config cloning by copyingcontainerEnvinto a mutableHashMapbefore further builder mutations. - Minor container setup call-site adjustments (
this.withEnv(...), etc.) and stricter blank-check forimage.
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
:java_duke: JaCoCo coverage report
Files
|
|
||||||||||||||
|
HTML test reports are available as workflow artifacts (zipped HTML). • Download: Artifacts for this run |
edeandrea
left a comment
There was a problem hiding this comment.
Only one comment on the image field - it can not be null (the docs even say so).
|
Also I think some of the copilot comments are valid |
c76fe68 to
ff40330
Compare
ff40330 to
50335e2
Compare
50335e2 to
b782cc2
Compare
b782cc2 to
41d2551
Compare
|
HTML test reports are available as workflow artifacts (zipped HTML). • Download: Artifacts for this run |
* 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>
41d2551 to
47bc7c2
Compare
There was a problem hiding this comment.
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 throwsIllegalArgumentExceptionwhen the provided image is null/empty/blank, but the current implementation just assigns and defers validation untilbuild()(viaDefaultDoclingContainerConfig). 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;
}
|
HTML test reports are available as workflow artifacts (zipped HTML). • Download: Artifacts for this run |
|
HTML test reports are available as workflow artifacts (zipped HTML). • Download: Artifacts for this run |
Uh oh!
There was an error while loading. Please reload this page.