Skip to content

Add expiry_access_period_enabled boolean column to Tld table#2804

Merged
CydeWeys merged 1 commit into
google:masterfrom
CydeWeys:expiry-access-period
Aug 18, 2025
Merged

Add expiry_access_period_enabled boolean column to Tld table#2804
CydeWeys merged 1 commit into
google:masterfrom
CydeWeys:expiry-access-period

Conversation

@CydeWeys

@CydeWeys CydeWeys commented Aug 18, 2025

Copy link
Copy Markdown
Member

This is the first in a series of PRs to implement the expiry access period (XAP). The overall fee schedules will be set in YAML config files, so the only DB change necessary should be this single new boolean column on the Tld entity, which defaults to false so as to require XAP explicitly being turned on for a given TLD.

BUG=http://b/437398822


This change is Reviewable

@CydeWeys
CydeWeys requested a review from weiminyu August 18, 2025 18:10

@ptkach ptkach left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @weiminyu)

@weiminyu weiminyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @CydeWeys)

This is the first in a series of PRs to implement the expiry access period
(XAP).  The overall fee schedules will be set in YAML config files, so the only
DB change necessary should be this single new boolean column on the Tld entity,
which defaults to false so as to require XAP explicitly being turned on for a
given TLD.

BUG=http://b/437398822
@CydeWeys
CydeWeys force-pushed the expiry-access-period branch from 4b9b1ee to 6106d1d Compare August 18, 2025 21:37
@CydeWeys
CydeWeys enabled auto-merge August 18, 2025 21:38
@CydeWeys
CydeWeys added this pull request to the merge queue Aug 18, 2025
Merged via the queue into google:master with commit a61a667 Aug 18, 2025
9 checks passed
@CydeWeys
CydeWeys deleted the expiry-access-period branch August 18, 2025 23:25
CydeWeys added a commit to CydeWeys/nomulus that referenced this pull request Jun 23, 2026
This commit implements the database schema changes for the Expiry Access Period (XAP) launch configuration on TLDs. It represents the first step of a Two-PR deployment strategy, deploying the database schema changes in advance of the server logic.

Specifically, it replaces the `expiry_access_period_enabled` boolean column (originally introduced in PR google#2804) with a new `expiry_access_period_transitions` hstore column.

Why we are making this change:
A basic boolean flag only allows an immediate, manual on/off toggle. To launch XAP on a TLD, registry operators would have to manually flip the flag at the exact launch time, which is operationally fragile and cannot be planned in advance. Refactoring this to an hstore-backed timed transition map (mapping Instant to ExpiryAccessPeriodMode) allows operators to schedule the XAP launch in advance via TLD YAML configurations. The registry will automatically transition the TLD to the ENABLED mode at the scheduled timestamp, aligning with how other scheduled TLD changes (like TLD states and EAP fee schedules) are managed.

Since the original boolean column was never mapped in Java (PR google#2804 only added the database column), it is completely safe to drop it immediately in this migration.

To ensure backward compatibility with running servers (which are still executing the old Java code during the deployment transition), the new column is added as `NOT NULL` with a temporary `DEFAULT` constraint. This prevents constraint violations on inserts from old servers. A TODO has been left in the SQL migration to drop this default in a subsequent schema release once the Java changes have been deployed.

TAG=agy
CONV=88271e71-e272-40e0-85f8-a075a423b7c2
CydeWeys added a commit to CydeWeys/nomulus that referenced this pull request Jun 23, 2026
This commit implements the database schema changes for the Expiry Access Period (XAP) launch configuration on TLDs. It represents the first step of a Two-PR deployment strategy, deploying the database schema changes in advance of the server logic.

Specifically, it replaces the `expiry_access_period_enabled` boolean column (originally introduced in PR google#2804) with a new `expiry_access_period_transitions` hstore column.

Why we are making this change:
A basic boolean flag only allows an immediate, manual on/off toggle. To launch XAP on a TLD, registry operators would have to manually flip the flag at the exact launch time, which is operationally fragile and cannot be planned in advance. Refactoring this to an hstore-backed timed transition map (mapping Instant to ExpiryAccessPeriodMode) allows operators to schedule the XAP launch in advance via TLD YAML configurations. The registry will automatically transition the TLD to the ENABLED mode at the scheduled timestamp, aligning with how other scheduled TLD changes (like TLD states and EAP fee schedules) are managed.

Since the original boolean column was never mapped in Java (PR google#2804 only added the database column), it is completely safe to drop it immediately in this migration.

To ensure backward compatibility with running servers (which are still executing the old Java code during the deployment transition), the new column is added as `NOT NULL` with a temporary `DEFAULT` constraint. This prevents constraint violations on inserts from old servers. A TODO has been left in the SQL migration to drop this default in a subsequent schema release once the Java changes have been deployed.

TAG=agy
CONV=88271e71-e272-40e0-85f8-a075a423b7c2
pull Bot pushed a commit to faizulho/nomulus that referenced this pull request Jun 23, 2026
This commit implements the database schema changes for the Expiry Access Period (XAP) launch configuration on TLDs. It represents the first step of a Two-PR deployment strategy, deploying the database schema changes in advance of the server logic.

Specifically, it replaces the `expiry_access_period_enabled` boolean column (originally introduced in PR google#2804) with a new `expiry_access_period_transitions` hstore column.

Why we are making this change:
A basic boolean flag only allows an immediate, manual on/off toggle. To launch XAP on a TLD, registry operators would have to manually flip the flag at the exact launch time, which is operationally fragile and cannot be planned in advance. Refactoring this to an hstore-backed timed transition map (mapping Instant to ExpiryAccessPeriodMode) allows operators to schedule the XAP launch in advance via TLD YAML configurations. The registry will automatically transition the TLD to the ENABLED mode at the scheduled timestamp, aligning with how other scheduled TLD changes (like TLD states and EAP fee schedules) are managed.

Since the original boolean column was never mapped in Java (PR google#2804 only added the database column), it is completely safe to drop it immediately in this migration.

To ensure backward compatibility with running servers (which are still executing the old Java code during the deployment transition), the new column is added as `NOT NULL` with a temporary `DEFAULT` constraint. This prevents constraint violations on inserts from old servers. A TODO has been left in the SQL migration to drop this default in a subsequent schema release once the Java changes have been deployed.

TAG=agy
CONV=88271e71-e272-40e0-85f8-a075a423b7c2
CydeWeys added a commit to CydeWeys/nomulus that referenced this pull request Jul 6, 2026
This commit implements the Expiry Access Period (XAP) feature for domain deletions, allowing a TLD to be configured with a timed launch schedule to charge a fee for domain registration during a configurable period after deletion. This represents the second step of a Two-PR deployment strategy, deploying the server logic after the database schema changes are live.

It refactors the TLD configuration to replace the `expiry_access_period_enabled` boolean column (originally introduced in PR google#2804) with a new `expiry_access_period_transitions` hstore column to support timed launch schedules.

Key changes:
- Refactored Tld.java to replace the expiryAccessPeriodEnabled boolean with expiryAccessPeriodTransitions, a TimedTransitionProperty of ExpiryAccessPeriodMode (DISABLED/ENABLED), allowing scheduled activation of XAP on a TLD.
- Implemented ExpiryAccessPeriodModeTransitionUserType for mapping the XAP mode transitions to a PostgreSQL hstore column in Hibernate.
- Implemented TimedTransitionPropertyExpiryAccessPeriodModeDeserializer in EntityYamlUtils.java to support Jackson serialization/deserialization of XAP mode transitions from TLD YAML configurations.
- Updated DomainPricingLogic.java, DomainCreateFlow.java, and DomainCheckFlow.java to query the XAP mode transitions map at the transaction/pricing time.
- Updated all 14 test TLD YAML files to use the transition map format, default-initializing them to DISABLED at UNIX epoch.
- Updated the generated database schema mapping (db-schema.sql.generated) to include the new hstore column mapping.
- Added comprehensive integration tests in DomainCheckFlowTest.java (testFeeExtension_xapLabel_std_v1) and corresponding XML test data to verify XAP fee checks.
- Fixed and updated unit tests in DomainPricingLogicTest.java, AllocationTokenFlowUtilsTest.java, and ConfigureTldCommandTest.java to align with the new transition map configurations.

TAG=agy
CONV=88271e71-e272-40e0-85f8-a075a423b7c2
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