Skip to content

Support new lists in Cloud Build sync objects job - #3245

Open
CydeWeys wants to merge 2 commits into
google:masterfrom
CydeWeys:sync-new-lists
Open

CydeWeys wants to merge 2 commits into
google:masterfrom
CydeWeys:sync-new-lists

Conversation

@CydeWeys

@CydeWeys CydeWeys commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Update release/db-object-updater/sync_db_objects.sh to pass --upsert when running update_premium_list or update_reserved_list so newly added lists are created automatically without shell fallback or currency parsing.

Also reorder release/cloudbuild-sync-db-objects.yaml so that premium and reserved lists are synced before configure_tld runs, ensuring newly created lists exist in the database before TLD configurations reference them, and add unit tests for sync_db_objects.sh in SyncDbObjectsTest.

Note: This PR is stacked on #3248 (update-list-upsert) and should be merged and deployed only after #3248 is deployed to production.

BUG=http://b/569977604


This change is Reviewable

@CydeWeys
CydeWeys requested a review from gbrodman October 7, 2026 14:38

@gbrodman gbrodman 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.

@gbrodman reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on CydeWeys).


release/db-object-updater/sync_db_objects.sh line 42 at r1 (raw file):

  if [[ -e "${FILE}" ]]; then
    echo "${FILE}"
    if ! java -jar /nomulus.jar -e "${nomulus_env}" \

we should capture the output here and only attempt the create-list fallback when the output tells us that the list doesn't exist

for other failures, just error out with that failure


release/db-object-updater/sync_db_objects.sh line 53 at r1 (raw file):

        echo "update_premium_list failed for ${FILE}, attempting" \
          "create_premium_list fallback with currency ${CURRENCY:-USD}..."
        java -jar /nomulus.jar -e "${nomulus_env}" \

what happens if this fails? i worry we'd be swallowing any failure

Add --upsert (-u) flag to UpdatePremiumListCommand and
UpdateReservedListCommand so that missing premium and reserved lists are
created automatically when --upsert is specified, while still failing
when --upsert is omitted and the list does not exist.

Allow CurrencyUnit to be nullable in PremiumListUtils.parseToPremiumList()
so that PremiumList.createFromLine() infers the currency unit from the
input lines when currency is unset, and use this in
UpdatePremiumListCommand when creating a new list via --upsert. Also fix
the mixed-currency example in config/files/premium/example.txt.

Also propagate exceptions from CreateOrUpdatePremiumListCommand.execute()
and CreateOrUpdateReservedListCommand.execute() instead of catching and
swallowing Throwable, and validate non-empty and parseable input data in
CreatePremiumListCommand.prompt(). Add comprehensive unit tests across
PremiumListUtilsTest and the create/update list command test suites.

BUG=http://b/569977604
Update release/db-object-updater/sync_db_objects.sh to pass --upsert
when running update_premium_list or update_reserved_list so newly added
lists are created automatically, and quote directory and file path
variables while skipping non-existent glob expansions.

Also reorder release/cloudbuild-sync-db-objects.yaml so that
update_premium_list and update_reserved_list run before configure_tld,
ensuring newly created lists exist in the database before TLD
configurations reference them. Add unit tests for sync_db_objects.sh in
SyncDbObjectsTest.

BUG=http://b/569977604

This branch has not been deployed

No deployments
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