From 9223b81ab38743f03f32f6b2e019ce6a5217b0d7 Mon Sep 17 00:00:00 2001 From: sarahcaseybot Date: Tue, 16 Jan 2024 11:32:59 -0500 Subject: [PATCH] Remove create_tld and update_tld commands (#2261) * Remove create_tld and update_tld commands These commands are no longer necessary now that configure_tld command is available. However, the configure_tld command should only be used for crash, QA, and alpha environments. TLDs in production and sandbox must be modified using modifications to their config files in Gerrit unless using the configure_tld command in breakglass mode. Check the "How to configure TLDs" procedure doc for more info. * re-delete file --- .../java/google/registry/model/tld/Tld.java | 2 +- .../tools/CreateOrUpdateTldCommand.java | 485 ------- .../registry/tools/CreateTldCommand.java | 113 -- .../google/registry/tools/RegistryTool.java | 2 - .../registry/tools/RegistryToolComponent.java | 4 - .../registry/tools/UpdateTldCommand.java | 189 --- .../registry/tools/CreateTldCommandTest.java | 733 ----------- .../registry/tools/UpdateTldCommandTest.java | 1161 ----------------- 8 files changed, 1 insertion(+), 2688 deletions(-) delete mode 100644 core/src/main/java/google/registry/tools/CreateOrUpdateTldCommand.java delete mode 100644 core/src/main/java/google/registry/tools/CreateTldCommand.java delete mode 100644 core/src/main/java/google/registry/tools/UpdateTldCommand.java delete mode 100644 core/src/test/java/google/registry/tools/CreateTldCommandTest.java delete mode 100644 core/src/test/java/google/registry/tools/UpdateTldCommandTest.java diff --git a/core/src/main/java/google/registry/model/tld/Tld.java b/core/src/main/java/google/registry/model/tld/Tld.java index 3df2451fe..e4e1514e7 100644 --- a/core/src/main/java/google/registry/model/tld/Tld.java +++ b/core/src/main/java/google/registry/model/tld/Tld.java @@ -296,7 +296,7 @@ public class Tld extends ImmutableObject implements Buildable, UnsafeSerializabl * this procedure to change this value: * *
    - *
  1. Pause the DNS queue via {@link google.registry.tools.UpdateTldCommand} + *
  2. Pause the DNS queue via {@link google.registry.tools.ConfigureTldCommand} *
  3. Change this number *
  4. Let the Tld caches expire (currently 5 minutes) and drain the DNS publish queue *
  5. Unpause the DNS queue diff --git a/core/src/main/java/google/registry/tools/CreateOrUpdateTldCommand.java b/core/src/main/java/google/registry/tools/CreateOrUpdateTldCommand.java deleted file mode 100644 index ab245e465..000000000 --- a/core/src/main/java/google/registry/tools/CreateOrUpdateTldCommand.java +++ /dev/null @@ -1,485 +0,0 @@ -// Copyright 2017 The Nomulus Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package google.registry.tools; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.collect.ImmutableSet.toImmutableSet; -import static google.registry.tools.UpdateOrDeleteAllocationTokensCommand.getTokenKeys; -import static google.registry.util.CollectionUtils.findDuplicates; -import static google.registry.util.DomainNameUtils.canonicalizeHostname; - -import com.beust.jcommander.Parameter; -import com.google.common.base.Joiner; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSortedMap; -import com.google.common.collect.Sets; -import com.google.common.collect.Sets.SetView; -import google.registry.model.pricing.StaticPremiumListPricingEngine; -import google.registry.model.tld.Tld; -import google.registry.model.tld.Tld.TldState; -import google.registry.model.tld.Tld.TldType; -import google.registry.model.tld.Tlds; -import google.registry.model.tld.label.PremiumList; -import google.registry.model.tld.label.PremiumListDao; -import google.registry.tldconfig.idn.IdnTableEnum; -import google.registry.tools.params.OptionalStringParameter; -import google.registry.tools.params.StringListParameter; -import google.registry.tools.params.TransitionListParameter.BillingCostTransitions; -import google.registry.tools.params.TransitionListParameter.TldStateTransitions; -import java.io.UnsupportedEncodingException; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import javax.annotation.Nullable; -import javax.inject.Inject; -import javax.inject.Named; -import org.joda.money.Money; -import org.joda.time.DateTime; -import org.joda.time.Duration; - -/** Shared base class for commands to create or update a TLD. */ -abstract class CreateOrUpdateTldCommand extends MutatingCommand { - - @Inject - @Named("dnsWriterNames") - Set validDnsWriterNames; - - @Parameter(description = "Names of the TLDs", required = true) - List mainParameters; - - @Parameter( - names = "--escrow", - description = "Whether to enable nightly RDE escrow deposits", - arity = 1) - private Boolean escrow; - - @Parameter( - names = "--dns", - description = "Set to false to pause writing to the DNS queue", - arity = 1) - private Boolean dns; - - @Nullable - @Parameter( - names = "--add_grace_period", - description = "Length of the add grace period (in ISO 8601 duration format)") - Duration addGracePeriod; - - @Nullable - @Parameter( - names = "--redemption_grace_period", - description = "Length of the redemption grace period (in ISO 8601 duration format)") - Duration redemptionGracePeriod; - - @Nullable - @Parameter( - names = "--pending_delete_length", - description = "Length of the pending delete period (in ISO 8601 duration format)") - Duration pendingDeleteLength; - - @Nullable - @Parameter( - names = "--automatic_transfer_length", - description = "Length of the automatic transfer period (in ISO 8601 duration format)") - private Duration automaticTransferLength; - - @Nullable - @Parameter( - names = "--restore_billing_cost", - description = "One-time billing cost for restoring a domain") - private Money restoreBillingCost; - - @Nullable - @Parameter( - names = "--roid_suffix", - description = "The suffix to be used for ROIDs, e.g. COM for .com domains (which then " - + "creates roids looking like 123ABC-COM)") - String roidSuffix; - - @Nullable - @Parameter( - names = "--server_status_change_cost", - description = "One-time billing cost for a server status change") - private Money serverStatusChangeCost; - - @Nullable - @Parameter( - names = "--registry_lock_or_unlock_cost", - description = "One-time billing cost for a registry lock or unlock") - private Money registryLockOrUnlockCost; - - @Nullable - @Parameter( - names = "--tld_type", - description = "Tld type (REAL or TEST)") - private TldType tldType; - - @Nullable - @Parameter( - names = "--invoicing_enabled", - description = "Whether invoicing is enabled for this tld.", - arity = 1) - private Boolean invoicingEnabled; - - @Nullable - @Parameter( - names = "--create_billing_cost", - description = "Per-year billing cost for creating a domain") - Money createBillingCost; - - @Nullable - @Parameter( - names = "--drive_folder_id", - description = "Id of the folder in drive used to publish information for this TLD", - converter = OptionalStringParameter.class, - validateWith = OptionalStringParameter.class) - Optional driveFolderId; - - @Nullable - @Parameter( - names = "--lordn_username", - description = "Username for LORDN uploads", - converter = OptionalStringParameter.class, - validateWith = OptionalStringParameter.class) - Optional lordnUsername; - - @Nullable - @Parameter( - names = "--premium_list", - description = "The name of the premium list to apply to the TLD", - converter = OptionalStringParameter.class, - validateWith = OptionalStringParameter.class) - Optional premiumListName; - - @Parameter( - names = "--tld_state_transitions", - converter = TldStateTransitions.class, - validateWith = TldStateTransitions.class, - description = "Comma-delimited list of TLD state transitions, of the form " - + "