Delete end-date sunrise, landrush, and sunrush phases

This also deletes the associated commands and domain application specific
entities.

We haven't used any of these TLD phases since early 2015 and have no
intent to do so in the future, so it makes sense to delete them now so we
don't have to carry them through the Registry 3.0 migration.

Note that, while there are data model changes, there should be no required
data migrations. The fields and entities being removed will simply remain
as orphans. I confirmed that the removed types (such as the SUNRUSH_ADD
GracePeriodType) are no longer used in production data, and left types
that are still used, e.g. BillingEvent.Flag.LANDRUSH or
HistoryEntry.Type.ALLOCATE.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=228752843
This commit is contained in:
mcilwain 2019-01-10 12:09:14 -08:00 committed by Ben McIlwain
parent c74ffd7559
commit 580302898d
282 changed files with 344 additions and 17634 deletions

View file

@ -27,7 +27,6 @@ import static google.registry.config.RegistryConfig.getContactAutomaticTransferL
import static google.registry.model.EppResourceUtils.createDomainRepoId;
import static google.registry.model.EppResourceUtils.createRepoId;
import static google.registry.model.ResourceTransferUtils.createTransferResponse;
import static google.registry.model.domain.launch.ApplicationStatus.VALIDATED;
import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.model.registry.label.PremiumListUtils.parentPremiumListEntriesOnRevision;
import static google.registry.pricing.PricingEngineProxy.getDomainRenewCost;
@ -66,17 +65,14 @@ import google.registry.model.contact.ContactAuthInfo;
import google.registry.model.contact.ContactResource;
import google.registry.model.domain.DesignatedContact;
import google.registry.model.domain.DesignatedContact.Type;
import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.DomainAuthInfo;
import google.registry.model.domain.DomainResource;
import google.registry.model.domain.GracePeriod;
import google.registry.model.domain.launch.LaunchPhase;
import google.registry.model.domain.rgp.GracePeriodStatus;
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
import google.registry.model.eppcommon.StatusValue;
import google.registry.model.eppcommon.Trid;
import google.registry.model.host.HostResource;
import google.registry.model.index.DomainApplicationIndex;
import google.registry.model.index.EppResourceIndex;
import google.registry.model.index.EppResourceIndexBucket;
import google.registry.model.index.ForeignKeyIndex;
@ -93,7 +89,6 @@ import google.registry.model.registry.label.PremiumList.PremiumListEntry;
import google.registry.model.registry.label.PremiumList.PremiumListRevision;
import google.registry.model.registry.label.ReservedList;
import google.registry.model.reporting.HistoryEntry;
import google.registry.model.smd.EncodedSignedMark;
import google.registry.model.transfer.TransferData;
import google.registry.model.transfer.TransferData.Builder;
import google.registry.model.transfer.TransferStatus;
@ -164,59 +159,6 @@ public class DatastoreHelper {
.build();
}
public static DomainApplication newDomainApplication(String domainName) {
// This ensures that the domain application gets the next available repoId before the created
// contact does, which is usually the applicationId 1.
return newDomainApplication(
domainName,
generateNewDomainRoid(getTldFromDomainName(domainName)),
persistActiveContact("contact1234"),
LaunchPhase.SUNRISE);
}
public static DomainApplication newDomainApplication(String domainName, ContactResource contact) {
return newDomainApplication(domainName, contact, LaunchPhase.SUNRISE);
}
public static DomainApplication newDomainApplication(
String domainName, ContactResource contact, LaunchPhase phase) {
return newDomainApplication(
domainName,
generateNewDomainRoid(getTldFromDomainName(domainName)),
contact,
phase);
}
public static DomainApplication newDomainApplication(
String domainName, String repoId, ContactResource contact, LaunchPhase phase) {
Key<ContactResource> contactKey = Key.create(contact);
return new DomainApplication.Builder()
.setRepoId(repoId)
.setFullyQualifiedDomainName(domainName)
.setPersistedCurrentSponsorClientId("TheRegistrar")
.setAuthInfo(DomainAuthInfo.create(PasswordAuth.create("2fooBAR")))
.setRegistrant(contactKey)
.setContacts(ImmutableSet.of(
DesignatedContact.create(Type.ADMIN, contactKey),
DesignatedContact.create(Type.TECH, contactKey)))
.setPhase(phase)
.setApplicationStatus(VALIDATED)
.addStatusValue(StatusValue.PENDING_CREATE)
.build();
}
public static DomainApplication newSunriseApplication(String domainName) {
return newSunriseApplication(domainName, persistActiveContact("contact1234"));
}
public static DomainApplication newSunriseApplication(
String domainName, ContactResource contact) {
return newDomainApplication(domainName, contact, LaunchPhase.SUNRISE)
.asBuilder()
.setEncodedSignedMarks(ImmutableList.of(EncodedSignedMark.create("base64", "abcdef")))
.build();
}
/**
* Returns a newly created {@link ContactResource} for the given contactId (which is the foreign
* key) with an auto-generated repoId.
@ -327,25 +269,6 @@ public class DatastoreHelper {
.build());
}
public static DomainApplication persistActiveDomainApplication(String domainName) {
return persistResource(newDomainApplication(domainName));
}
public static DomainApplication persistActiveDomainApplication(
String domainName, ContactResource contact, LaunchPhase phase) {
return persistResource(newDomainApplication(domainName, contact, phase));
}
/**
* Persists a domain application resource with the given domain name deleted at the specified
* time.
*/
public static DomainApplication persistDeletedDomainApplication(
String domainName, DateTime deletionTime) {
return persistResource(
newDomainApplication(domainName).asBuilder().setDeletionTime(deletionTime).build());
}
/** Persists a domain resource with the given domain name deleted at the specified time. */
public static DomainResource persistDeletedDomain(String domainName, DateTime deletionTime) {
return persistDomainAsDeleted(newDomainResource(domainName), deletionTime);
@ -901,7 +824,7 @@ public class DatastoreHelper {
* ofy() session cache. Specifically, this method calls .now() on the save to force the write to
* actually get sent to Datastore (although it does not force it to be applied) and clears the
* session cache. If necessary, this method also updates the relevant {@link EppResourceIndex},
* {@link ForeignKeyIndex} and {@link DomainApplicationIndex}.
* {@link ForeignKeyIndex}.
*
* <p><b>Note:</b> Your resource will not be enrolled in a commit log. If you want backups, use
* {@link #persistResourceWithCommitLog(Object)}.
@ -934,9 +857,6 @@ public class DatastoreHelper {
if (resource instanceof ForeignKeyedEppResource) {
saver.entity(ForeignKeyIndex.create(resource, resource.getDeletionTime()));
}
if (resource instanceof DomainApplication) {
saver.entity(DomainApplicationIndex.createUpdatedInstance((DomainApplication) resource));
}
}
private static <R> R persistResource(final R resource, final boolean wantBackup) {

View file

@ -1,84 +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.testing;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.truth.Truth.assertAbout;
import static com.google.common.truth.Truth.assertThat;
import com.google.common.truth.FailureMetadata;
import com.google.common.truth.SimpleSubjectBuilder;
import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.Period;
import google.registry.model.domain.launch.ApplicationStatus;
import google.registry.model.smd.EncodedSignedMark;
import google.registry.testing.TruthChainer.And;
import java.util.Objects;
/** Truth subject for asserting things about {@link DomainApplication} instances. */
public final class DomainApplicationSubject
extends AbstractDomainBaseSubject<DomainApplication, DomainApplicationSubject> {
public And<DomainApplicationSubject> hasPeriodYears(int years) {
assertThat(actual().getPeriod()).isNotNull();
assertThat(actual().getPeriod().getUnit()).isEqualTo(Period.Unit.YEARS);
assertThat(actual().getPeriod().getValue()).isEqualTo(years);
return andChainer();
}
public And<DomainApplicationSubject> hasApplicationStatus(
ApplicationStatus applicationStatus) {
if (!Objects.equals(actual().getApplicationStatus(), applicationStatus)) {
failWithBadResults(
"has application status", applicationStatus, actual().getApplicationStatus());
}
return andChainer();
}
public And<DomainApplicationSubject> doesNotHaveApplicationStatus(
ApplicationStatus applicationStatus) {
return doesNotHaveValue(
applicationStatus,
actual().getApplicationStatus(),
"application status");
}
public And<DomainApplicationSubject> hasExactlyEncodedSignedMarks(
EncodedSignedMark... encodedSignedMarks) {
assertThat(actual().getEncodedSignedMarks())
.named("the encoded signed marks of " + actualAsString())
.containsExactly((Object[]) encodedSignedMarks);
return andChainer();
}
public And<DomainApplicationSubject> hasNumEncodedSignedMarks(int num) {
if (actual().getEncodedSignedMarks().size() != num) {
failWithBadResults(
"has this many encoded signed marks: ", num, actual().getEncodedSignedMarks().size());
}
return andChainer();
}
public DomainApplicationSubject(FailureMetadata failureMetadata, DomainApplication subject) {
super(failureMetadata, checkNotNull(subject));
}
public static SimpleSubjectBuilder<DomainApplicationSubject, DomainApplication>
assertAboutApplications() {
return assertAbout(DomainApplicationSubject::new);
}
}