Skip to content

Migrate EPP XML generation from Soy to JAXB and emails to FreeMarker#3038

Open
CydeWeys wants to merge 1 commit intogoogle:masterfrom
CydeWeys:freemarker
Open

Migrate EPP XML generation from Soy to JAXB and emails to FreeMarker#3038
CydeWeys wants to merge 1 commit intogoogle:masterfrom
CydeWeys:freemarker

Conversation

@CydeWeys
Copy link
Copy Markdown
Member

@CydeWeys CydeWeys commented May 8, 2026

This CL eliminates the deprecated Closure Template (Soy) engine from the Nomulus codebase.

Key changes:

  • Migrated all EPP tool commands (CreateDomain, UpdateDomain, etc.) from Soy templates to type-safe JAXB models using EppInput.
  • Migrated Spec11 emails to Apache FreeMarker using a new TemplateRenderer utility.
  • Updated EppInput and related models to support all necessary extensions (Fee, SecDNS, Metadata, AllocationToken, etc.).
  • Refactored DsRecord to remove Soy dependencies.
  • Updated tool test data XML files to match JAXB output (standardizing headers, removing redundant lang="en" attributes, and using self-closing tags).
  • Removed Soy dependencies and associated Gradle tasks from the build system.
  • Consolidated EPP exception classes to improve code health and remove circular dependencies.

Verified with ./gradlew :core:test and specialized tool command tests.


This change is Reviewable

@CydeWeys CydeWeys force-pushed the freemarker branch 3 times, most recently from 41188ab to 1268bcc Compare May 9, 2026 16:15
This commit eliminates the dependency on deprecated Soy templates by migrating
EPP XML generation to JAXB and abuse emails to FreeMarker. It also introduces
a fluent EPP DSL to simplify command construction and improve type safety.

Key changes:
- Migration: Replaced all Soy-based EPP and email templates with JAXB models
  and FreeMarker (.ftl) templates, removing the Soy compiler from the build.
- Fluent DSL: Introduced EppInputs and EppExtensions utility classes to
  centralize resource command generation, significantly reducing boilerplate.
- Type Safety: Enforced the use of Guava ImmutableList and ImmutableSet across
  all EPP API boundaries, ensuring structural integrity and immutability.
- Ergonomics: Refactored extension helpers to handle null/empty inputs
  gracefully, removing noisy ternary operators and conditional logic at
  callsites.
- SecDNS Optimization: Standardized DS record management, allowing for surgical
  updates and simplified URS (Uniform Rapid Suspension) logic.
- Verification: Added a new unit test suite (EppInputsTest) and verified
  functional parity across 5,260+ core tests.

This modernization improves codebase maintainability and aligns the registry's
EPP generation with modern Java idioms.

/** The inner change type on a contact update command. */
public static class AddRemove extends ResourceUpdate.AddRemove {}
public static class AddRemove extends ResourceUpdate.AddRemove {
}

/** 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 {

/** The inner change type on a contact update command. */
public static class AddRemove extends ResourceUpdate.AddRemove {}
public static class AddRemove extends ResourceUpdate.AddRemove {
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.

2 participants