Commit graph

2590 commits

Author SHA1 Message Date
shicong
b10f880b7f Add source code and JAR file to internal repository
This CL made the following changes to achieve the purpose:

1. Modified HttpProxy.java to generate a file containing Maven
   coordinates for all requested JAR files. This is to replace
   Gradle task "generateMavenCoordinateForDependency" which served
   for the same purpose before. The reason is during the course
   of the build, Gradle may request some POM file of a artifact
   for some reason but it doesn't actually need the JAR file.
   However, task "generateMavenCoordinateForDependency" cannot
   identify this use case so it added more JARs to the dependency
   which are not necessary and are not consistent with what we
   get from HttpProxy.java. Going forward, we will use HttpProxy.java
   as the single source to provide dependency.

2. Updated update_deps_metadata.py to retrieve *-sources.jar for each
   dependency for obvious reason.

3. Improved update_dependency.sh by removing 1 unnecessary build.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=247607871
2019-05-13 12:41:31 -04:00
gbrodman
aa83472393 Remove the scrap AllocationToken command and OnLoad method
I have resaved all the tokens and verified in BigQuery that there are no
remaining null tokenTypes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=247425132
2019-05-13 12:39:47 -04:00
cpovirk
5bb93e9e4a Instead of calling Subject.actual(), store the actual value in a field, and read that.
actual() is being removed.

More information:
  []

Tested:
    TAP --sample ran all affected tests and none failed
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=247415370
2019-05-13 12:38:09 -04:00
guyben
38e2175699 Convert RDAP tests from simple.json to Gson
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=247237275
2019-05-13 12:36:31 -04:00
guyben
3b8a8892bb Inject RdapAuthorization
We currently create it from injected arguments, and pass it to every function.

Instead, we just create a provider for it and inject it where needed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=247072517
2019-05-13 12:34:53 -04:00
jianglai
ce7456ea66 Do not track IntelliJ files in SCM
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=247012595
2019-05-13 12:33:15 -04:00
guyben
bdc41edd34 Reimplement the RDAP Json creation using Jsonables
Currently we try to reimplemnet the same behavior of the existing code as much
as possible.

We only fix issues that go against the RFC7483, but we don't yet update the
code to follow the latest (15feb19) RDAP Response Profile. That will require a
much bigger change especially for the test files, so it'll wait for a followup
CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246948018
2019-05-13 12:31:32 -04:00
shicong
e382299212 Resolve carry-over state issue in TestServerRule
The TestServerRule object is shared between retries in the same test,
so the testServer object constructed in TestServerRule's constructor
will be shared as well. This should be the reason why the test retry
carries over some state. (The log in the test proves that the
testServer object is shared because it listens to the same port in
all retries, which should not happen if its constructor is invoked
every time. You can find multiple "TestServerRule is listening on:
[]in this test
[]

So, this CL delayed the construction to rule.before() method which is
invoked before every retry.(You can see each retry has a test server
listening to different port and the error is "It differed by <16> pixels."
for all attempts instead of not clickable button []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246904446
2019-05-13 12:29:53 -04:00
weiminyu
d1b7824cc2 Refactor Gradle project setup
Make root build.gradle easier to read:
- Moved appengine war-assembly into separate script
- Moved java static analysis configs to separate script,
  for easier sharing with buildSrc folder.

Update Gradle config in the buildSrc folder:
- Applied static analysis, and cleaned up a few style and
  dependency lint errors.
- Added dependency locks
- Set up Google java format enforcement (Spotless)
  since this is new code.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246858172
2019-05-06 17:03:18 -04:00
jianglai
d4698ae386 Fix Bazel build error
Bazel's GenTestRules does not support the "timeout" parameter, introduced in []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246830344
2019-05-06 17:00:03 -04:00
jianglai
1dcbfae314 Remove failing tests from Nomulus GCB pipeline
Also upgrade to Gradle 5.4.1.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246829399
2019-05-06 16:58:15 -04:00
gbrodman
3483f348dc Add a command to update allocation tokens
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246824258
2019-05-06 16:56:33 -04:00
gbrodman
df7e9a1225 Validate on-load that an AllocationToken can be used
Check the timing (that is, whether or not we're in a promotion), the allowed registrar client IDs, and the allowed TLDs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246824080
2019-05-06 16:54:55 -04:00
cpovirk
1480181fe1 Migrate from containsAllOf to containsAtLeast
The two behave identically, and containsAllOf is being removed.

More information:
  []
Tested:
    TAP --sample for global presubmit queue
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246791491
2019-05-06 16:53:03 -04:00
jianglai
e1f8817746 Tune timeout for test targets ([]
This CL looks good? Just LGTM and Approve it!
This CL doesn't look good? File a bug using []

What else can you do?
* Suggest a fix on the CL ([]
* Revert this CL, by replying "REVERT: <provide reason>".
* Revert this CL and not get a CL that cleans up this file in the future by replying "BLACKLIST: <provide reason>". This action is not reversible!

This CL was automatically generated by ATTT ([] using CL Shepherd ([] Please contact [] for questions.

//third_party/java_src/gtld/javatests/google/registry/model:registry/label/GenrulePremiumListTest: We're adjusting the test target timeout because it has a 1.248050 percent time out rate based on last week's (2019-04-27 - 2019-05-04) tap postsubmit running statistics. Its original timeout_sec is 60, and we're adjusting it to moderate, which is 300 seconds.
Some detailed statistics for the target:
  Num of invocation: 641
  Num of passed invocations: 633
  Num of timeout invocations: 8
  ****** Stats for passing runs ******
    Min run time in secs: 14
    Max run time in secs: 57
    Mean run time in secs: 28.955766
    Sd run time in secs: 9.104767

#codehealth

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246791200
2019-05-06 16:50:39 -04:00
cpovirk
021405eb17 Migrate Truth Subjects from no-arg check() to use description
The overload that accepts a description generally produces better failure messages:
- The first line of the message it produces is something like: "value of: myProto.getResponse()" (where "getResponse()" is taken from the provided description)
- The last line of the message it produces is something like: "myProto was: response: query was throttled" (the full value of myProto)
- And the existing text goes in between.

Additional motivation: We are deleting the no-arg overload externally (and probably internally thereafter).
Tested:
    TAP --sample ran all affected tests and none failed
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246582329
2019-05-06 16:49:01 -04:00
gbrodman
e9d220e6f3 Add promotional fields in GenerateAllocationTokensCommand
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246579125
2019-05-06 16:47:25 -04:00
gbrodman
c9ee5c3fb3 Add a scrap command to re-save all allocation token entities
This will populate the token type to be SINGLE_USE for existing tokens that
don't have a type.

Modeled after the ResaveEntitiesCommand, but modified so that we load all AllocationTokens (rather than having to provide a list of entity IDs on the command line)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246572756
2019-05-06 16:45:46 -04:00
cpovirk
251ec1ed32 Migrate from containsAllIn to containsAtLeastElementsIn
The two behave identically, and containsAllIn is being removed.

More information:
  []
Tested:
    TAP --sample for global presubmit queue
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246565417
2019-05-06 16:44:06 -04:00
cpovirk
7cb6d23884 Migrate from is(Not)SameAs to is(Not)SameInstanceAs.
They behave identically, and the old names are being removed.

Open-source note: The new methods are available in Truth as of version 0.44.

END_PUBLIC

More information:
  []

Tested:
    TAP --sample ran all affected tests and none failed
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246550001
2019-05-06 16:42:30 -04:00
weiminyu
e6e6303b9e Update to Truth 0.44 in Bazel build
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246548162
2019-05-06 16:40:54 -04:00
weiminyu
3145770f7c Upgrade truth to v0.44
Also upgraded Guava to 27.1-jre and truth java8 extension to v0.44.

Also removed lockfiles no longer in use in Gradle 5.4.

Follow up change will update bazel dependencies.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246515393
2019-05-06 16:39:17 -04:00
jianglai
cdb9a820e9 Update to bazel 0.25.0
Also updated the docker rules to be compatible with the new version of bazel,
and updated the proxy base image to the latest Java 8 version.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246509816
2019-05-06 16:36:04 -04:00
guyben
5962c9c561 Fix Kokoro failure
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246411007
2019-05-06 16:34:27 -04:00
gbrodman
625e613b07 Upgrade the version of google-closure-library that we use in NPM
This is the version that's available in internal Artifactory.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246392223
2019-05-06 16:31:14 -04:00
guyben
e1926dbc57 Add Jsonable and AbstractJsonableObject for easier RDAP object building
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246345611
2019-05-06 16:27:59 -04:00
jianglai
c45d3b843c Restore RemoteApiOptions method accessibility after use
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246161567
2019-05-06 16:24:44 -04:00
guyben
90c53152bf Simplify some of the RDAP Action classes
Overriding getter methods to change values is a bit overkill when these values
are static (don't change based on internal state).

Just setting them in the base class' constructor is simpler.

Also, we can read the PATH of an Action based on the Annotation instead
returning it manually for each Action.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246135754
2019-05-06 16:23:05 -04:00
weiminyu
99aeedc598 Replace deprecated Mockito Matchers class
Part of the attempt to remove or suppress warnings for deprecated
API use, which will make the Gradle project usable with Intellij.

Currently in the Intellij/Gradle setup, deprecation warnings cause
Intellij build process to fail. Passing -Werror:none flags to javac\
does not have any effect.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246135737
2019-05-06 16:21:27 -04:00
mmuller
bbdf3db63e Change default TTLs on all records to 1 hour.
We need this as a precursor to running refreshDnsForAllDomains to change our
TTLs from 3 minutes to an hour (see the associated bug for details).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246011747
2019-05-06 16:19:48 -04:00
mcilwain
d1edd1f58b Just use default Joda DateTime toString()
It defaults to ISO 8601, so no need to be fancy.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245809048
2019-05-06 16:18:09 -04:00
cpovirk
124d7375c3 Migrate from assertThat(foo).named("foo") to assertWithMessage("foo").that(foo).
(The exact change is slightly different in some cases, like when using custom subjects or check(), but it's always a migration from named(...) to [assert]WithMessage(...).)

named(...) is being removed.

This CL may slightly modify the failure messages produced, but all the old information will still be present.

More information:
  []

Tested:
    TAP --sample for global presubmit queue
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245762634
2019-05-06 16:16:31 -04:00
cpovirk
de5f3e6177 For assertions made _inside the implementation of another assertion_, migrate from assertThat to check.
For example:
  assertThat(actual().foo()).isEqualTo(expected);
becomes:
  check("foo()").that(actual().foo()).isEqualTo(expected);

More information:
  []

Tested:
    TAP --sample for global presubmit queue
    []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245750144
2019-05-06 16:13:13 -04:00
weiminyu
8daca56024 Fix incorrect public tutorial on configuration
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245665006
2019-05-06 16:09:23 -04:00
gbrodman
70c7e6c224 Use a potential discount in the AllocationToken when determining domain create price
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245458027
2019-04-27 00:08:57 -04:00
jianglai
1a1ff94bc5 Upload gradle binary to GCS when preparing the release
This makes it possible to pull the gradle binary from a trusted source when building the release artifacts.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245450562
2019-04-27 00:07:23 -04:00
gbrodman
274b331522 Fix up a comment based on investigation into billing events
Please see the linked bug for more context--I believe this is correct based on what I've observed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245423464
2019-04-27 00:05:49 -04:00
jianglai
ef1124de95 Update Nomulus release pipeline
Refactor out the build and package logic to a reusable script. Also removed the gradle task flag to skip lint check, as failing lint check is no longer a fatal error.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245296563
2019-04-27 00:01:06 -04:00
gbrodman
312c1a46ab Add additional tests for the AllocationToken status transitions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245292932
2019-04-26 23:59:32 -04:00
gbrodman
a0f9e3b3dd Store a reference to an allocation token in the OneTime billing event
We will need to be able to find all redemptions associated with a particular token and this will allow us to do that.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245292865
2019-04-26 23:57:56 -04:00
jianglai
d02a01ba66 Use the GCS repository when pulling dependencies in CI
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245292305
2019-04-26 23:56:20 -04:00
jianglai
ebe4e522df Use GCS HTTPS endpoints when pulling dependencies
This alleviates the needs to have Google credentials even when downloading from
a public bucket.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245290867
2019-04-26 23:54:43 -04:00
mmuller
83e93b87a5 Pin to a tagged selenium docker image
The latest version of the selenium/standalone-chrome docker image appears to
be out of sync with the API that we're using and there is no more recent
version of the API available in maven central.

This change pins us to the earlier version and fixes our CI build.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245286532
2019-04-26 23:53:06 -04:00
jianglai
fbb60df019 LSC: Mark Python binaries with explicit python_version.
Having PY2 global version default is deprecated and change in 2019Q3.  This LSC ([] is a prerequisite to that Blaze change to prevent unintended breakages when we flip the default.

This CL is no-op to “freeze” the world. If it conflicts with your plans to move to PY3, feel free to change forward to PY3 as you see fit (eg. remove python_version when you move to py2and3_test).

BEGIN_PUBLIC
n/a
END_PUBLIC

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=245028632
2019-04-26 23:51:31 -04:00
jianglai
37c5139629 Update .gitignore file
When a release repo is first created by combining the public and the internal repos, we need to make sure to include files that are currently excluded in the public repo's .gitignore but have been tracked before the exclusion rules are added (because the rules do not apply retroactively: if a file is already tracked by git, even if it later matches a rule in .gitignore, it will not be excluded).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244916005
2019-04-26 23:48:22 -04:00
jianglai
1e58ef4efa Exclude files under repos/ from being uploaded to Cloud Build
When submitting a Cloud Build job from the command line, we do not want to include files under repos/, which can amount to almost a Gig.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244906528
2019-04-26 23:46:44 -04:00
gbrodman
53c1557d2a Use the registrar client ID and abuse email address in Spec11
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244899045
2019-04-26 23:45:07 -04:00
gbrodman
0644fab76e Use stream-collect rather than transformValues in Spec11 collection
As it turns out, using Maps::transformValues does not allow us to change the
resulting map--calling Map::put throws an UnsupportedOperationException. As a
result, we have to do this roundabout stream-collect to do a group-by.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244852373
2019-04-26 23:41:55 -04:00
jianglai
143ae1f93e Update proxy release pipeline following Spinnaker 1.13 release
The image name in the manifest needs to be the same as the name that Spinnaker trigger catches. With the new release, Spinnaker now correctly recognizes gcr.io/${PROJECT_ID}/proxy as the image name.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244845037
2019-04-23 10:44:44 -04:00
jianglai
46c1a290be Upgrade to Gradle 5.4
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=244686718
2019-04-23 10:43:09 -04:00