Repository navigation
Update IC4J dependencies and harden code generation - #1
Conversation
Update IC4J agent and Candid dependencies to 0.8.5, correct generated Java, Spring, and React Native behavior, harden CLI and JAXB error handling, and add reproducible packaging and regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical generation and packaging issues, along with moderate correctness concerns, block approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates IC4J Codegen to 0.8.5 while hardening client generation, JAXB handling, packaging, publication, testing, and CI.
Changes:
- Updates dependencies, JBang metadata, publishing, and fat-JAR configuration.
- Improves Java, Spring, React Native, identity, and JAXB generation.
- Adds regression tests, generated-source checks, and Java 8/11/21 CI.
File summaries
| File | Reviewed changes and findings |
|---|---|
src/test/java/org/ic4j/codegen/test/XSDWriterTest.java |
Generation failures now fail the test. |
src/test/java/org/ic4j/codegen/test/SwiftTest.java |
Generation failures now fail the test. |
src/test/java/org/ic4j/codegen/test/RosettaNetTest.java |
Generation failures now fail the test. |
src/test/java/org/ic4j/codegen/test/JAXBWriterTest.java |
Generation failures now fail the test. |
src/test/java/org/ic4j/codegen/GeneratorRegressionTest.java |
Adds generator regression coverage. |
src/main/java/org/ic4j/codegen/SpringWriter.java |
Improves Spring generation. Critical findings: raw proxy names, lifecycle init collisions, and invalid @Async usage remain possible. |
src/main/java/org/ic4j/codegen/ReactNativeWriter.java |
Improves React Native dispatch and response generation. |
src/main/java/org/ic4j/codegen/JAXBGenerator.java |
Adds failure propagation, XML hardening, and timeouts. Moderate finding: interrupted writers may continue running. |
src/main/java/org/ic4j/codegen/JavaxJAXBGenerator.java |
Improves JAXB error handling. |
src/main/java/org/ic4j/codegen/JavaWriterContext.java |
Tracks collision-aware generated type names. |
src/main/java/org/ic4j/codegen/JavaWriter.java |
Improves Java generation. Critical finding: Object method signatures are not reserved. |
src/main/java/org/ic4j/codegen/JavaIdentifier.java |
Adds identifier normalization. Critical finding: Object-final method names such as getClass are not reserved. |
src/main/java/org/ic4j/codegen/JakartaJAXBGenerator.java |
Improves JAXB error handling. |
src/main/java/org/ic4j/codegen/IC4JBase.java |
Validates identities and closes resources. |
src/main/java/org/ic4j/codegen/IC4J.java |
Improves CLI metadata and usage handling. |
src/main/java/org/ic4j/codegen/CodegenException.java |
Adds cause-aware exceptions. |
README.md |
Updates dependency version examples. |
jbang/IC4JJBang.java |
Updates JBang dependencies. |
DEPLOY.md |
Updates publishing instructions. Nit: dry-run validation does not verify remote credentials or repositories. |
build.gradle |
Configures dependencies, publication, fat JAR, and generated-source checks. Critical finding: the fat JAR omits compile-only React Native dependencies. Moderate finding: generation relies on an undeclared test side effect. |
.gitignore |
Stops ignoring tracked publishing configuration. |
.github/workflows/build.yml |
Adds Java 8/11/21 CI validation. |
Review details
Suppressed comments (3)
DEPLOY.md:43
- This command only performs a local publication task, and Gradle
--dry-runskips task actions, so it cannot validate the remote release repository or credentials as the preceding text claims. Keep this as a task-graph check with accurate wording, or document a separate remote publication task/configuration for credential validation.
./gradlew --no-daemon publishToMavenLocal --dry-run --console=plain
src/main/java/org/ic4j/codegen/JAXBGenerator.java:164
- Cancelling with interruption and immediately calling
shutdownNow()does not guarantee that theTypeWritertask has stopped;TypeWriter.writeFilehas no interruption contract, so a writer can continue traversing and writing after this timeout is reported. Repeated timeouts can leave daemon workers alive and can race with later generations or leave partial output. Use an isolation/termination mechanism, or wait for guaranteed worker termination before reporting the timeout.
future.cancel(true);
src/main/java/org/ic4j/codegen/SpringWriter.java:172
- When
useFutureis false,toTypeName(..., isFuture)produces a plain response type, but the response branch still adds@Asyncsolely becauseisFutureis true. That generates methods such as@Async String update(...), which Spring rejects at runtime because asynchronous methods must returnvoidor aFuture; gate this annotation onthis.useFutureas well.
methodBuilder.addStatement("return this.call($S" + args + ")",name);
- Files reviewed: 20/22 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Co-authored-by: rdobrik <8812511+rdobrik@users.noreply.github.com>
Addressed in c63ce1c. |
Co-authored-by: rdobrik <8812511+rdobrik@users.noreply.github.com>
Reserve final Object method names, prevent Spring lifecycle collisions, normalize generated proxy references, package compile-only runtime classes, make generated-source task outputs explicit, and remove unsafe timeout workers. Keep local-only IC4J 0.8.5 dependencies while removing the hosted workflow that cannot resolve them from Maven Central. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Choose a lifecycle method name outside the generated proxy method set and keep the regression tests compatible with the Java 8 target. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Why
The code generator needed to consume the local IC4J agent and Candid 0.8.5 artifacts, while several generation paths could emit incomplete or uncompilable clients without failing the build.
What changed
check, and add a Java 8/11/21 CI workflow.Validation
./gradlew check fatJar publishToMavenLocal