Commit graph

1156 commits

Author SHA1 Message Date
guyben
0b5b16e97c Allow EventSample.record to accept numSamples=0
There's really no reason not to.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171037754
2017-10-05 11:41:59 -04:00
bbilbo
6b113603db Add nocron ear and deployer rules for the crash environment
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171027505
2017-10-04 16:16:45 -04:00
jianglai
9d8e48cf24 Refector metrics truth subject
The concrete implementation of a Metric is not of importance when asserting on the values it contains. Therefore this CL removes Metric<T> as a type parameter of AbstractMetricSubject. As a result the two implementations of the abstract subject can be used on any Metric<Long> and Metric<Distribution>, respectively.

Also migrate to Subject.Factory from deprecated SubjectFactory.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171012012
2017-10-04 16:16:45 -04:00
mmuller
a9ecccf672 Automated g4 rollback of changelist 170906329.
*** Reason for rollback ***

Forgot to send this for readability review.

*** Original change description ***

Add "create_cdns_tld" command to nomulus

Add a command to allow us to create the managed zone for a new TLD in cloud
dns.

Note: this implementation is problematic, it's currently doing its own thing
as far as credentials and http transport, making it unusable with the []
channel and the credentials generated by login.  Unfortunately, fixing the
plumbing to make it work right is difficult, and we have an immediate need for
this functionality.

b/67367533 created to clean this up, along with...

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171011304
2017-10-04 16:16:45 -04:00
mmuller
6e84401271 Add "create_cdns_tld" command to nomulus
Add a command to allow us to create the managed zone for a new TLD in cloud
dns.

Note: this implementation is problematic, it's currently doing its own thing
as far as credentials and http transport, making it unusable with the []
channel and the credentials generated by login.  Unfortunately, fixing the
plumbing to make it work right is difficult, and we have an immediate need for
this functionality.

b/67367533 created to clean this up, along with related warts in the codebase.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170906329
2017-10-04 16:16:45 -04:00
jakubvrana
939c18bbce Remove autoescape="strict" attributes from Soy templates.
Strict autoescaping is the default so they serve no purpose.

Design doc: []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170905337
2017-10-04 16:16:45 -04:00
mcilwain
51b04f7340 Add TODO for better handling of public suffix lists for hosts
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170854701
2017-10-04 16:16:45 -04:00
guyben
01591ff88e Clarify diff display of MutatingCommand
Tools inheriting from MutatingCommand print out the change they are going to
make and then ask the user to confirm that this is indeed what they wanted to
do.

The change is outputted as a list of updated values in the form

key -> [oldValue, newValue]

e.g.

dnsPaused -> [true, false]

This CL will change the output to be clearer:

key: oldValue -> newValue

e.g.

dnsPaused: true -> false

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170853745
2017-10-04 16:16:45 -04:00
nickfelt
fd62f4a74e Streamline transfer resolving helpers in ResourceFlowUtils
In the great flow flattening, ResourceFlowUtils grew a couple nice helpers
for rebuilding transferrable resources (Domains and Contacts) upon the
resolution of a transfer - approvePendingTransfer() and denyPendingTransfer().

Most transfer-resolving callsites use one of these two helpers, but for legacy
reasons the deletion flows (DomainDeleteFlow and DeleteContactsAndHostsAction)
were instead using the "manual" resolvePendingTransfer() method or its even more
low-level createResolvedTransferData() helper instead of denyPendingTransfer().
It's simpler to just have two options - approve and deny - so this CL inlines
createResolvedTransferData() into resolvePendingTransfer() and makes the latter
a private helper for the approve/denyPendingTransfer() public helpers.

This CL also adds sanity checks that approve/denyPendingTransfer() are called
only with the logically appropriate values of TransferStatus.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170819358
2017-10-04 16:16:45 -04:00
mountford
a5c931a152 Add RDAP support for deleted contacts and registrars
This CL adds the functionality for contact and registrar searches. A future CL will handle domains and entities.

Support is also added for filtering results by registrar.

Deleted items can only be seen by admins, and by registrars viewing their own deleted items.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170734664
2017-10-04 16:16:45 -04:00
jakubvrana
6740e9270f Remove autoescape="strict" attributes from Soy templates.
Strict autoescaping is the default so they serve no purpose.

Design doc: []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170725633
2017-10-04 16:16:45 -04:00
bbilbo
7aa5629517 Allow domain transfers with 0 period and in auto-renew grace period
Normally, if a domain is in the auto-renew grace period, a transfer will cancel the auto-renew billing event. In the event of a transfer with no change to registration end date, the auto-renew billing event should not be cancelled and the gaining registrar should not be charged for the transfer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170576726
2017-10-04 16:16:45 -04:00
mcilwain
a50ef39c04 Fix mismatch in types of Predicates being used
We're going to need to switch away from Guava's Functions and Predicates for
everything and replace them with the java.util versions. Unfortunately there
does not appear to be an automated tool to do this all at once. Refaster got
close but doesn't seem to care about these particular types of mismatch (I
suspect we're using a different version of the JDK than the outside world;
ours is OK with Guava classes).

This also bumps up Guava to 0.23, which is needed for some new functionality
used in combination with Java 8 features.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170531539
2017-10-04 16:16:45 -04:00
nickfelt
447b83f7db Fix typo in DomainTransferResponse.Builder method namename
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170529902
2017-10-04 16:16:45 -04:00
nickfelt
bc02b701b5 Use transaction time when cloneProjectedAtTime()-ing within transaction
It's bad practice in terms of data model consistency to use DateTime.now(UTC) for cloneProjectedAtTime() within a transactional context - instead, we should always use ofy().getTransactionTime() when it's available.  The ofy transaction time is frozen at the start of the transaction attempt, whereas DateTime.now(UTC) will continue marching ahead.  So using it for a cloneProjectedAtTime() could mean materializing the outcome of logical-time-dependent events (like autorenews, or transfers, or grace period expirations) at a logical time (i.e. commit log time) prior to when they should actually have occurred.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170501277
2017-10-04 16:16:45 -04:00
jianglai
dc41d7923e Remove injectable constructors in metrics library
Users of the client library should be responsible for providing the bindings required. By removing the injectable constructors and named bindings in their parameters, the client library is no longer forcing its users to provide bindings with specific named annotations.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170490834
2017-10-04 16:16:45 -04:00
jianglai
ac0718079d Fix typo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170487675
2017-10-04 16:16:45 -04:00
mcilwain
f70a7e6342 Upgrade Nomulus to Java8
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170486775
2017-10-04 16:16:45 -04:00
mcilwain
1c4e79f99e Don't allow non-active registrars to create domains or applications
Specifically, this prevents suspended registrars from creating domains or applications. Pending registrars already can't perform these actions because they get an error message when attempting to log in.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170481338
2017-10-04 16:16:45 -04:00
mmuller
d09bd89629 Add config parameters to point at us to use cloud-dns staging
Add cloudDns.{rootUrl, servicePath} to allow us to point an environment at the
Cloud DNS staging API for testing.  Make sandbox and alpha point to staging.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170340859
2017-10-04 16:16:45 -04:00
larryruili
d4ab6fe90b Update activity reports to comply with agreement changes
This removes the ramp-up and pre-ramp-up registrar fields, and lists 'CZDS' as
the zfa-passwords field, in accordance to the registry agreement changes listed
on the associated bug.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170337426
2017-10-04 16:16:45 -04:00
mcilwain
c69b409b30 Add java8 runtime option to production appengine-web.xml files
It occurs to me that we can't have this setting different between sandbox
and production, otherwise we can end up with a situation where we push code
that works on sandbox but then fails only when it is pushed to production.
Sandbox and production need to always be set up similarly for this reason.

We'll just have to pay a greater amount of attention to the release process
next week than normal, and continue playing around in alpha for the mean
time with a fully Java 8 build.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170197703
2017-10-04 16:16:45 -04:00
nickfelt
2702c3a7f3 Fix code to always set HistoryEntry modification time using txn time
Since HistoryEntry always represents a read-only log of mutation to a core resource, that mutation should always happen in a transaction, and the HistoryEntry should be saved in that transaction.  As such, it's always more accurate to use ofy().getTransactionTime() for the modificationTime of the HistoryEntry rather than just DateTime.now(UTC).

In addition, having these be the exact same timestamp makes it possible to align HistoryEntries with commit log manifests using modificationTime = transactionTime, which is useful for recovery and analysis purposes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170136957
2017-10-04 16:16:45 -04:00
jianglai
ceadfea11f Remove @Inject annotation in StackDriverWriter
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170111976
2017-10-04 16:16:45 -04:00
mountford
c13c2f403a Add RDAP support for deleted nameservers and filtering by registrar
This CL adds the functionality for nameserver searches. Future CLs will handle domains and entities.

Deleted items can only be seen by admins, and by registrars viewing their own deleted items.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170106014
2017-10-04 16:16:45 -04:00
mmuller
0c8b5bc8bf Build DNS changes with HashMap instead of Builder
The existing CloudDnsWriter code uses ImmutableMap.Builder to construct the
map of DNS records to update.  This has been seen to fail on alpha, presumably
in a cases where host records and domain records produce duplicate updates for
a host.

Convert the Builder to a HashMap, allowing us to safely overwrite existing
records in the case of duplicates.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170103421
2017-10-04 16:16:45 -04:00
mcilwain
8908686f23 Add java8 runtime option to all non-production appengine-web*.xml files
Java 8 is go!

https://cloudplatform.googleblog.com/2017/09/Java-8-on-App-Engine-Standard-environment-is-now-generally-available.html

We will add this option to the production files next week.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170101056
2017-10-04 16:16:45 -04:00
nickfelt
498f390e54 Make ICANN reporting URLs default to real icann.org URLs
No reason for these not to work out of the box, right?  The default-config.yaml already has a couple other real icann.org URLs for RDE testing and the TMCH CRL.  This way Nomulus users don't have to worry about changing this setting (since other than testing it's hard to imagine what other value would be used; this is literally ICANN reporting so it always goes to ICANN).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=170093954
2017-10-04 16:16:45 -04:00
shikhman
f27dd70c9e Automated g4 rollback of changelist 169922096.
*** Reason for rollback ***

Rolling back to fix []
*** Original change description ***

Remove @Inject annotation in StackDriverWriter

StackDriverWriter is provided by java.google.registry.monitoring.whitebox.StackdriverModule. The @Inject annotation in its constructor is not used. It also uses outdated named binding like @Named(stackdriverGcpProject) which causes confusion because that name is not provided anywhere in the code.

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169931047
2017-10-04 16:16:45 -04:00
nickfelt
3ad21e3834 Fix RDE import pending transfer handling
Mostly based on the original PR, but with some tweaking by nfelt@, in particular to add some support for autorenew grace period subsumption.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169922894
2017-10-04 16:16:45 -04:00
jianglai
2814561e92 Remove @Inject annotation in StackDriverWriter
StackDriverWriter is provided by java.google.registry.monitoring.whitebox.StackdriverModule. The @Inject annotation in its constructor is not used. It also uses outdated named binding like @Named(stackdriverGcpProject) which causes confusion because that name is not provided anywhere in the code.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169922096
2017-10-04 16:16:45 -04:00
mcilwain
8bd9b35dfd Link domain to subordinate hosts on RDE import
Based on the original pull request below with some modifications for code drift
over time (including adding handling/testing for the case where superordinate
domains are in pending delete, and thus can't have hosts linked to them).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169698157
2017-10-04 16:16:45 -04:00
larryruili
3d5a6b808c Change loadActiveApplicationsByDomainName to non-transactional
We can easily end up enlisting too many entity groups (separate
DomainApplications) in a TransactionalFlow when loading all applications
tracked by the DomainApplicationIndex. This makes the load operation
transactionless, to avoid overenlisting.

Potential problems:
1. We fail to prevent landrush applications, if a single sunrise application
exists. This is likely fine, except for a brief moment in Sunrush when a
sunrise application is made immediately prior to a landrush application. The
result is we accept an invalid application- which can be mediated manually.

2. We fail to prevent a domain create for a domain with an open application.
This is a little more sinister, but also unlikely unless someone submits an
application immediately before someone tries to create the same domain (sans
application?)

3. We return an invalid DomainCheck response (instead of 'pending allocation').
Not the worst outcome.

4. We reduce the AuctionStatusCommand and GetApplicationIdsCommand to
eventual consistency. Since they're internal tools, that's not too big a deal.

A better solution:
DomainApplications really should just be normalized under a virtualEntityGroup
by fullyQualifiedDomainName, or a hash-bucket like EppResources are. The
DomainApplication -> DomainBase -> EppResource hierarchy seems to be purely for
code reuse, at the cost of Datastore consistency. This would, however, require
quite some refactoring, and a custom resave operation across all
DomainApplications.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169395586
2017-10-04 16:16:44 -04:00
larryruili
578673141c Migrate to new Sheets v4 api
This moves us from the oudated google/data XML api to the OnePlatform REST/JSON api, finally silencing the deprecation warnings we've been seeing.

The synchronization algorithm diffs the spreadsheet's current values with its internally sourced values, adding the row to a batch update request if there's a discrepancy. Additional internal data are added as an append operation to the end of the sheet, and any extraneous spreadsheet data is cleared from the spreadsheet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169273590
2017-09-20 10:27:17 -04:00
nickfelt
67116c5fa1 Remove long-dead LogsExportCursor and PersistedRangeLong
LogsExportCursor was only used by ExportLogsTaskServlet, which we removed a long time ago.  It's just dead code.  The PersistedRangeLong type was only written for use by LogsExportCursor, and since it hasn't picked up new users in 3+ years I don't think we need to keep it around.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169264994
2017-09-20 10:27:17 -04:00
mountford
f34d4b6bbb Resolve RDAP TODO without action
There was a TODO to consider making RDAP queries look up domains by foreign key rather than directly to the domain itself. But since the TLD is a possible search filter, it makes more sense to stick with direct lookup, so we can take advantage of the index on TLD.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169240318
2017-09-20 10:27:17 -04:00
mountford
1bb655267c Add RDAP warning when domain searches by nameserver may be incomplete
When searching for domains by nameserver name or IP address, we fetch the matching nameserver keys, then search for domains by those keys. We limit the number of nameserver keys returned, to avoid arbitrarily large domain queries. This CL adds a warning to the RDAP response if we retrieved the maximum number of nameservers. This may indicate that we have not found all the domains.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168885124
2017-09-20 10:27:17 -04:00
mcilwain
7dc1940cdb Move ResaveAllEppResources mapreduce from tools service to backend
It makes sense for all mapreduces to run in backend, especially onces
that are scheduled regularly to run in cron like this one now. We don't
have many instances configured for the tools service anymore on some
of our environments, so backend is the friendliest place for a mapreduce
to run.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168882122
2017-09-20 10:27:17 -04:00
guyben
3cc44259da Use different locks for thin and full rde reports
The lock is used to prevent dual writing of the same output file, and to
prevent us from generating the same data twice (if RdeStaging was run twice).

However, at times when we're creating both RDE and BRDA reports - we use the
same lock for both even though they write to different files and create
different reports.

This causes one of the two to almost always fail (when both are created, which
is once a week I think) delaying that report by several hours.

Note that the "prefix" part of the filenames has the mode in it, so different
modes will not have the same files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168882007
2017-09-20 10:27:17 -04:00
guyben
892424b148 Check if lock owner is finished on lock acquisition
Sometimes requests "die" suddenly, without going through catch/finally blocks.
If this happens, any lock they own will remain locked until it times out (which
can take hours in some cases).

This cl implicitly unlocks any lock if the owner of the lock isn't running
anymore.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168880938
2017-09-20 10:27:17 -04:00
guyben
d7214b58fc Re-enable DeleteOldCommitLogs cron job
Also adds a "resave all epp" cron job that's needed for the delete to work correctly.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168879965
2017-09-20 10:27:17 -04:00
mountford
80ff106e4c Prohibit some RDAP domain and nameserver lookups by nameserver name
We had been allowing lookups by nameserver name using a wildcard and suffix if the suffix was a domain name. That's ok if the domain name is one we manage, but doesn't work efficiently otherwise. A lookup of ns*.zombo.com would require us to search for all nameservers beginning with ns (which could be almost all of them), then loop through until we found those ending with .zombo.com. So we are going to prohibit suffixes after the TLD unless the suffix is an in-bailiwick domain.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168835732
2017-09-20 10:27:17 -04:00
mcilwain
3a9d7f9b70 Add cloneProjectedInTime() to ResaveAllEppResources mapreduce
We're planning on adding a cronjob to run this mapreduce monthly, so
we may as well also project the resources being re-saved to the present
time so as to handle pending transfers, grace periods, and such. This will
make the BigQuery exports more useful.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168831056
2017-09-20 10:27:17 -04:00
jakubvrana
04a61794e0 Fix closing and self-closing tags in templates
Void tags (e.g. <img>) couldn't have a closing tag (e.g. </img> is invalid). Non-void tags (e.g. <div>) couldn't be self closing (e.g. <div/> is invalid) and must be closed explicitly (e.g. with </div>). This CL fixes the tags which also prepares the templates for stricthtml which enforces it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168829028
2017-09-20 10:27:17 -04:00
jianglai
ccb0bf5af0 Use real Preconditions class, not old clone from unrelated package.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168720192
2017-09-20 10:27:17 -04:00
mcilwain
d73ef66352 Remove temporary handling of invalid billing events
The bad prober domain data has since been deleted, so we no longer need
to handle the case where these Keys point to entities that don't exist.

This mostly reverses []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168687701
2017-09-20 10:27:17 -04:00
larryruili
efd7010f9d Add resave command for all HistoryEntries
This pattern will mainly be used for data migrations, i.e. updating all
HistoryEntries' DomainTransactionRecords to the new schema.

TESTED=Ran in alpha, the underlying data dropped non-Objectify fields as
expected.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168684356
2017-09-20 10:27:17 -04:00
mmuller
07e5741cbb Implement compare_db_backups "main"
Implement toplevel class that reads in two database backups and displays
diffs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168592124
2017-09-20 10:27:17 -04:00
mcilwain
51298aeabb Extract multiple commit prevention in DNS writers into a base class
This still retains the DnsWriter interface itself for better integration
with Dagger and to preserve the option of having a DNS writer that does
not have this requirement (e.g. because it is idempotent).

This also makes the commit check thread-safe, which is a nice-to-have.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168451114
2017-09-20 10:27:17 -04:00
mountford
f6e0d5fa0c Fix typo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168437857
2017-09-20 10:27:17 -04:00