From 87ab14904991e89a5b007e50ef9f4a44f9df28fd Mon Sep 17 00:00:00 2001 From: mmuller Date: Fri, 18 Jan 2019 09:24:32 -0800 Subject: [PATCH] Externalize premium/reserved list tests Remove the GoogleInternal designator on the premium/reserved list tests, move the lists themselves under the config/files directory, and fix all of the surrounding infrastructure. The lists do not get exported. Only the "example.txt" list does, allowing the test to function on the open source build. TESTED: Verified that the gradle build works and that only the example.txt file is exported. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=229940659 --- .../premium-list-management.md | 3 +++ java/google/registry/config/files/premium/BUILD | 10 ++++++++++ .../registry/config/files/premium/example.txt | 7 +++++++ java/google/registry/config/files/reserved/BUILD | 10 ++++++++++ .../config/files/reserved/common_example.txt | 14 ++++++++++++++ javatests/google/registry/model/BUILD | 2 ++ 6 files changed, 46 insertions(+) create mode 100644 java/google/registry/config/files/premium/BUILD create mode 100644 java/google/registry/config/files/premium/example.txt create mode 100644 java/google/registry/config/files/reserved/BUILD create mode 100644 java/google/registry/config/files/reserved/common_example.txt diff --git a/docs/operational-procedures/premium-list-management.md b/docs/operational-procedures/premium-list-management.md index 6a750a034..02c616961 100644 --- a/docs/operational-procedures/premium-list-management.md +++ b/docs/operational-procedures/premium-list-management.md @@ -31,6 +31,9 @@ reconstruct a premium list .txt file from the premium list that is loaded into Datastore (though in principle it would be easy to do by writing a tool to do so), so don't lose those .txt files. +An example premium list can be found at +`java/google/registry/model/registry/config/files/premium/example.txt`. + ## Creating a premium list Once the file containing the premium prices is ready, run the diff --git a/java/google/registry/config/files/premium/BUILD b/java/google/registry/config/files/premium/BUILD new file mode 100644 index 000000000..f3c384aa8 --- /dev/null +++ b/java/google/registry/config/files/premium/BUILD @@ -0,0 +1,10 @@ +licenses(["notice"]) # Apache 2.0 + +package( + default_visibility = ["//java/google/registry:registry_project"], +) + +filegroup( + name = "all_lists", + srcs = glob(["*.txt"]), +) diff --git a/java/google/registry/config/files/premium/example.txt b/java/google/registry/config/files/premium/example.txt new file mode 100644 index 000000000..3de39f2d9 --- /dev/null +++ b/java/google/registry/config/files/premium/example.txt @@ -0,0 +1,7 @@ +# Example of a reserved list file. This is simply a CSV file with two +# columns: sub-domain name and price (specified as currency type and value). +# +# These are manipulated using the "nomulus" tool +# {create,update,delete,list}_premium_list commands. +foo,USD 100 # comment after the item +bar,JPY 14 diff --git a/java/google/registry/config/files/reserved/BUILD b/java/google/registry/config/files/reserved/BUILD new file mode 100644 index 000000000..bbfb63df8 --- /dev/null +++ b/java/google/registry/config/files/reserved/BUILD @@ -0,0 +1,10 @@ +licenses(["notice"]) # Apache 2.0 + +package( + default_visibility = ["//java/google/registry:registry_project"], +) + +filegroup( + name = "all_lists", + srcs = glob(["**/*.txt"]), +) diff --git a/java/google/registry/config/files/reserved/common_example.txt b/java/google/registry/config/files/reserved/common_example.txt new file mode 100644 index 000000000..3fbc45a50 --- /dev/null +++ b/java/google/registry/config/files/reserved/common_example.txt @@ -0,0 +1,14 @@ +# Example of a reserved list file. This is simply a CSV file with 2-3 +# columns: sub-domain name and reservation type and (in the case of the +# NAMESERVER_RESTRICTED type) a colon-separated list of nameservers. See +# java/google/registry/model/registry/label/ReserverationType for the complete +# set of reservation types. +# +# These are manipulated using the "nomulus" tool +# {create,update,delete,list}_reserved_list commands. +nsrestric,NAMESERVER_RESTRICTED,foo.example.com:bar.example.com +sunrise,ALLOWED_IN_SUNRISE +specific,RESERVED_FOR_SPECIFIC_USE +anchor,RESERVED_FOR_ANCHOR_TENANT +collision,NAME_COLLISION +blocked,FULLY_BLOCKED # Comment after the line. diff --git a/javatests/google/registry/model/BUILD b/javatests/google/registry/model/BUILD index b7fecc5ca..1e04ec78f 100644 --- a/javatests/google/registry/model/BUILD +++ b/javatests/google/registry/model/BUILD @@ -16,6 +16,8 @@ java_library( "**/*.java", ]), resources = [ + "//java/google/registry/config/files/premium:all_lists", + "//java/google/registry/config/files/reserved:all_lists", ] + glob(["**/testdata/*"]), deps = [ "//java/google/registry/config",