Skip to content

Export domain drop list for open TLDs to Drive - #3223

Open
CydeWeys wants to merge 1 commit into
google:masterfrom
CydeWeys:domain-drop-list
Open

Export domain drop list for open TLDs to Drive#3223
CydeWeys wants to merge 1 commit into
google:masterfrom
CydeWeys:domain-drop-list

Conversation

@CydeWeys

@CydeWeys CydeWeys commented Aug 28, 2026

Copy link
Copy Markdown
Member

Redo the exported drop list mechanism by replacing the legacy per-TLD mode in ExportDomainListsAction with a dedicated, once-daily ExportDropListAction.

Key changes:

  1. Reverted ExportDomainListsAction to unconditionally export single-column active registered domains and deprecated the INCLUDE_PENDING_DELETE_DATE_FOR_DOMAINS feature flag.
  2. Implemented ExportDropListAction at /_dr/task/exportDropList to query the read replica for upcoming deletions on all open TLDs (where invoicing is enabled) and output an alphabetically sorted CSV file (domain_name,tld,deletion_time) to a designated Google Drive folder.
  3. Added domainDropListDriveFolderId configuration setting and provider.
  4. Registered the action in RequestComponent, routing.txt, and Cloud Scheduler tasks for production and sandbox.
  5. Added comprehensive test coverage in ExportDropListActionTest and cleaned up legacy test cases in ExportDomainListsActionTest.

BUG=b/553658111


This change is Reviewable

Comment thread core/src/main/java/google/registry/export/ExportDropListAction.java Outdated
Comment thread core/src/main/java/google/registry/config/RegistryConfig.java Outdated
static final String CSV_HEADER = "domain_name,tld,deletion_time";

private static final String SELECT_UPCOMING_DELETIONS_STATEMENT =
"""

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Actually, a better way to do this is to load all Tlds first (in a separate query) and check which ones have XAP enabled as of the current time, and then just filter explicitly to that list of TLDs in the query. Not all open TLDs will necessarily have XAP enabled so that is a better way to do it, and we don't want to facilitate drop-catching on non-XAP-enabled TLDs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done. Evaluated open TLDs that have XAP enabled at clock.now(), and passed them explicitly to the upcoming deletions query as xapTlds.

StringBuilder csvBuilder = new StringBuilder();
csvBuilder.append(CSV_HEADER).append('\n');
for (Object[] row : queryResults) {
csvBuilder.append(row[0]).append(',').append(row[1]).append(',').append(row[2]).append('\n');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is this really the best way to construct a CSV file? How do we do it elsewhere in the Nomulus codebase?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done. Replaced manual string building with org.apache.commons.csv.CSVPrinter (configured with Linux newline record separator).

Comment thread core/src/main/java/google/registry/export/ExportDropListAction.java
Comment thread core/src/main/java/google/registry/export/ExportDropListAction.java
@CydeWeys
CydeWeys force-pushed the domain-drop-list branch 2 times, most recently from b5efc1a to 2f22abf Compare August 28, 2026 16:53
}

Instant now = clock.now();
ImmutableSet<String> openTlds =

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Rename this to xapTlds, since it's not just openTlds.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done. Renamed to xapTlds in SELECT_UPCOMING_DELETIONS_STATEMENT and throughout run().

alpha.open2,open2,2020-02-04T02:02:02Z
zebra.open1,open1,2020-02-07T02:02:02Z
"""
.replace("\n", "\r\n"));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't like these Windows-style line-endings at all. Configure the Apache CSV writer so that it correctly uses Linux-style newlines consisting of just \n

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done. Configured CSVFormat.DEFAULT.builder().setRecordSeparator('\n').build() so output strictly uses Linux newlines (\n), and reverted tests to assert against \n.

void test_emptyDropList_outputsHeaderOnly() throws Exception {
persistActiveDomain("active.open1");
action.run();
verifyExportedToDrive("domain_name,tld,deletion_time\r\n");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah there should be no \r in here or anywhere else.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done. Removed all \r carriage returns across the codebase and test assertions.

Redo the exported drop list mechanism by replacing the legacy per-TLD
mode in ExportDomainListsAction with a dedicated, once-daily
ExportDropListAction.

Key changes:
1. Reverted ExportDomainListsAction to unconditionally export
   single-column active registered domains and deprecated the
   INCLUDE_PENDING_DELETE_DATE_FOR_DOMAINS feature flag.
2. Implemented ExportDropListAction at /_dr/task/exportDropList to query
   the read replica for upcoming deletions on all open TLDs (where
   invoicing is enabled) and output an alphabetically sorted CSV file
   (domain_name,tld,deletion_time) to a designated Google Drive folder.
3. Added domainDropListDriveFolderId configuration setting and provider.
4. Registered the action in RequestComponent, routing.txt, and Cloud
   Scheduler tasks for production and sandbox.
5. Added comprehensive test coverage in ExportDropListActionTest and
   cleaned up legacy test cases in ExportDomainListsActionTest.

BUG=b/553658111
@CydeWeys
CydeWeys requested a review from gbrodman August 28, 2026 17:14
static final ImmutableList<String> CSV_HEADER =
ImmutableList.of("domain_name", "tld", "deletion_time");
private static final CSVFormat CSV_FORMAT =
CSVFormat.DEFAULT.builder().setRecordSeparator('\n').build();
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