Migrate EPP XML generation from Soy to JAXB and emails to FreeMarker#3038
Open
CydeWeys wants to merge 1 commit into
Open
Migrate EPP XML generation from Soy to JAXB and emails to FreeMarker#3038CydeWeys wants to merge 1 commit into
CydeWeys wants to merge 1 commit into
Conversation
1268bcc to
d9d1130
Compare
| } | ||
|
|
||
| /** The inner add type on the update extension. */ | ||
| public static class Add extends AddRemoveBase { |
| @XmlElement(name = "id"), | ||
| @XmlElement(name = "name") }) | ||
| List<String> targetUniqueIds; | ||
| public class ResourceCheck extends ImmutableObject implements ResourceCommand { |
dcec4a2 to
9258e15
Compare
CydeWeys
commented
May 11, 2026
| 'com.google.template:soy:[2024-02-26,)', | ||
| 'com.google.truth:truth:[1.1.2,)', | ||
| 'com.googlecode.json-simple:json-simple:[1.1.1,)', | ||
| 'org.freemarker:freemarker:2.3.32', |
Member
Author
There was a problem hiding this comment.
Don't lock this to this specific revision. Use the open-ended [ ) syntax.
CydeWeys
commented
May 11, 2026
| and is written primarily in Java. It is the software that | ||
| [Google Registry](https://www.registry.google/) uses to operate TLDs such as .google, | ||
| .app, .how, .soy, and .みんな. It can run any number of TLDs in a single shared registry | ||
| .app, .how, and .みんな. It can run any number of TLDs in a single shared registry |
5f0a007 to
0b20767
Compare
| @XmlRootElement | ||
| @XmlType(propOrder = {"targetId", "innerAdd", "innerRemove", "innerChange"}) | ||
| public static class Update extends ResourceUpdate<Update.AddRemove, Domain.Builder, Update.Change> | ||
| public static class Update |
| @XmlRootElement | ||
| @XmlType(propOrder = {"targetId", "innerAdd", "innerRemove", "innerChange"}) | ||
| public static class Update extends ResourceUpdate<Update.AddRemove, Host.Builder, Update.Change> { | ||
| public static class Update |
a4a0fc1 to
cd82ada
Compare
|
|
||
| /** The inner change type on a contact update command. */ | ||
| public static class AddRemove extends ResourceUpdate.AddRemove {} | ||
| public static class ContactAddRemove extends ResourceUpdate.AddRemove { |
| /** The inner change type on a domain update command. */ | ||
| @XmlType(propOrder = {"nameserverHostNames", "foreignKeyedDesignatedContacts", "statusValues"}) | ||
| public static class AddRemove extends ResourceUpdate.AddRemove { | ||
| public static class DomainAddRemove extends ResourceUpdate.AddRemove { |
| @XmlType(propOrder = { "inetAddresses", "statusValues" }) | ||
| public static class AddRemove extends ResourceUpdate.AddRemove { | ||
| @XmlType(propOrder = {"inetAddresses", "statusValues"}) | ||
| public static class HostAddRemove extends ResourceUpdate.AddRemove { |
- Replace deprecated Soy templates for EPP XML with JAXB models and a refined Fluent DSL. - Migrate Spec11 and administrative emails to FreeMarker with HTML auto-escaping. - Remove Soy compiler, Gradle tasks, and library dependencies. - Address PR feedback regarding shadowing, version locking, and security warnings. - Enhance tests with comprehensive XML equality assertions using Java 15 text blocks. - Improve Javadocs and maintain strict temporal consistency using java.time. FreeMarker replaces Soy for email templating, providing native HTML auto-escaping and allowing the removal of the complex 'soyToJava' compilation step from the build process. This significantly simplifies the build system and reduces maintenance overhead. For EPP XML, migrating to JAXB allows tool-generated commands to use the same model classes as the server-side EPP flows. This ensures that tool-generated XML is always schema-compliant and eliminates the risk of divergence between tool templates and actual server-side implementation. This unified approach provides compile-time type safety and improves developer ergonomics via a refined fluent DSL. The base ImmutableObject class now provides a public clone() override that correctly resets the cached hashCode to null. This centralizes the custom cloning logic previously handled by a static helper and ensures that all subclasses—including the newly added JAXB models—satisfy CodeQL security requirements without needing redundant per-class overrides. The legacy static clone(T) helper has been updated to delegate to this instance method to maintain compatibility and architectural consistency.
weiminyu
requested changes
May 13, 2026
Collaborator
weiminyu
left a comment
There was a problem hiding this comment.
@weiminyu reviewed 58 files and made 1 comment.
Reviewable status: 58 of 104 files reviewed, 10 unresolved discussions (waiting on CydeWeys).
common/src/main/java/google/registry/util/TemplateRenderer.java line 57 at r5 (raw file):
* @throws RuntimeException if the template cannot be found, parsed, or processed */ public String render(String templatePath, ImmutableMap<String, Object> dataModel) {
If template variables and dataModel map keys do not match, missing or unused data keys, will the render throw an error?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This CL eliminates the deprecated Closure Template (Soy) engine from the Nomulus codebase.
Key changes:
Verified with ./gradlew :core:test and specialized tool command tests.
This change is