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

@ -21,7 +21,6 @@ import static google.registry.mapreduce.inputs.EppResourceInputs.createKeyInput;
import static google.registry.model.index.EppResourceIndexBucket.getBucketKey;
import static google.registry.testing.DatastoreHelper.createTld;
import static google.registry.testing.DatastoreHelper.newContactResource;
import static google.registry.testing.DatastoreHelper.newDomainApplication;
import static google.registry.testing.DatastoreHelper.newDomainResource;
import static google.registry.testing.DatastoreHelper.newHostResource;
import static google.registry.testing.DatastoreHelper.persistActiveContact;
@ -34,7 +33,6 @@ import com.google.appengine.tools.mapreduce.InputReader;
import com.googlecode.objectify.Key;
import google.registry.model.EppResource;
import google.registry.model.contact.ContactResource;
import google.registry.model.domain.DomainApplication;
import google.registry.model.domain.DomainBase;
import google.registry.model.domain.DomainResource;
import google.registry.model.host.HostResource;
@ -223,41 +221,6 @@ public class EppResourceInputsTest {
assertThrows(NoSuchElementException.class, deserializedReader::next);
}
@Test
public void testSuccess_entityReader_allowsPolymorphicMatches() throws Exception {
createTld("tld");
DomainResource domain = persistEppResourceInFirstBucket(newDomainResource("a.tld"));
DomainApplication application = persistEppResourceInFirstBucket(newDomainApplication("b.tld"));
Set<DomainBase> seen = new HashSet<>();
InputReader<DomainBase> reader = createEntityInput(DomainBase.class).createReaders().get(0);
reader.beginShard();
reader.beginSlice();
assertThat(reader.getProgress()).isWithin(EPSILON).of(0);
seen.add(reader.next());
assertThat(reader.getProgress()).isWithin(EPSILON).of(0.5);
seen.add(reader.next());
assertThat(reader.getProgress()).isWithin(EPSILON).of(1.0);
assertThat(seen).containsExactly(domain, application);
assertThrows(NoSuchElementException.class, reader::next);
}
@Test
public void testSuccess_entityReader_skipsPolymorphicMismatches() throws Exception {
createTld("tld");
persistEppResourceInFirstBucket(newDomainApplication("b.tld"));
DomainResource domainA = persistEppResourceInFirstBucket(newDomainResource("a.tld"));
InputReader<DomainResource> reader =
createEntityInput(DomainResource.class).createReaders().get(0);
reader.beginShard();
reader.beginSlice();
assertThat(reader.getProgress()).isWithin(EPSILON).of(0);
assertThat(reader.next()).isEqualTo(domainA);
// We can't reliably assert getProgress() here, since it counts before the postfilter that weeds
// out polymorphic mismatches, and so depending on whether the domain or the application was
// seen first it will be 0.5 or 1.0. However, there should be nothing left when we call next().
assertThrows(NoSuchElementException.class, reader::next);
}
@Test
public void testSuccess_entityReader_filtersOnMultipleTypes() throws Exception {
createTld("tld");
@ -284,9 +247,8 @@ public class EppResourceInputsTest {
createTld("tld");
ContactResource contact = persistEppResourceInFirstBucket(newContactResource("contact"));
// Specify the contact since persistActiveDomain{Application} creates a hidden one.
DomainResource domain = persistEppResourceInFirstBucket(newDomainResource("a.tld", contact));
DomainApplication application =
persistEppResourceInFirstBucket(newDomainApplication("b.tld", contact));
DomainResource domain1 = persistEppResourceInFirstBucket(newDomainResource("a.tld", contact));
DomainResource domain2 = persistEppResourceInFirstBucket(newDomainResource("b.tld", contact));
HostResource host = persistEppResourceInFirstBucket(newHostResource("ns1.example.com"));
Set<EppResource> seen = new HashSet<>();
InputReader<EppResource> reader = createEntityInput(EppResource.class).createReaders().get(0);
@ -301,7 +263,7 @@ public class EppResourceInputsTest {
assertThat(reader.getProgress()).isWithin(EPSILON).of(0.75);
seen.add(reader.next());
assertThat(reader.getProgress()).isWithin(EPSILON).of(1.0);
assertThat(seen).containsExactly(domain, host, application, contact);
assertThat(seen).containsExactly(domain1, domain2, host, contact);
assertThrows(NoSuchElementException.class, reader::next);
}
}