Skip to content

Commit bb1c24e

Browse files
committed
Remove the concept of a GAE service endpoint
We don't need to support the mix of GAE and GKE any more so we can get rid of the GaeService bits and unify everything under one constant service. This also allows us to reduce the number of services down to four (FE, BE, PUBAPI, console) which is nice. For now we still keep around BackendRequestComponent and FrontendRequestComponent -- they're only used by the test server, and we should probably eventually find another way to serve those in local testing.
1 parent d9349be commit bb1c24e

File tree

136 files changed

+251
-1313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+251
-1313
lines changed

core/src/main/java/google/registry/batch/CannedScriptExecutionAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import com.google.common.flogger.FluentLogger;
2222
import google.registry.request.Action;
23-
import google.registry.request.Action.GaeService;
2423
import google.registry.request.Parameter;
2524
import google.registry.request.Response;
2625
import google.registry.request.UrlConnectionService;
@@ -43,7 +42,7 @@
4342
* --service BACKEND -X POST -u '/_dr/task/executeCannedScript}'}
4443
*/
4544
@Action(
46-
service = GaeService.BACKEND,
45+
service = Action.Service.BACKEND,
4746
path = "/_dr/task/executeCannedScript",
4847
method = {POST, GET},
4948
automaticallyPrintOk = true,

core/src/main/java/google/registry/batch/CheckBulkComplianceAction.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import google.registry.model.domain.token.BulkPricingPackage;
2828
import google.registry.model.registrar.Registrar;
2929
import google.registry.request.Action;
30-
import google.registry.request.Action.GaeService;
3130
import google.registry.request.auth.Auth;
3231
import google.registry.ui.server.SendEmailUtils;
3332
import google.registry.util.Clock;
@@ -39,7 +38,10 @@
3938
* An action that checks all {@link BulkPricingPackage} objects for compliance with their max create
4039
* limit.
4140
*/
42-
@Action(service = GaeService.BACKEND, path = CheckBulkComplianceAction.PATH, auth = Auth.AUTH_ADMIN)
41+
@Action(
42+
service = Action.Service.BACKEND,
43+
path = CheckBulkComplianceAction.PATH,
44+
auth = Auth.AUTH_ADMIN)
4345
public class CheckBulkComplianceAction implements Runnable {
4446

4547
public static final String PATH = "/_dr/task/checkBulkCompliance";

core/src/main/java/google/registry/batch/CloudTasksUtils.java

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import google.registry.config.RegistryConfig.Config;
4444
import google.registry.request.Action;
4545
import google.registry.request.Action.Method;
46-
import google.registry.request.Action.Service;
4746
import google.registry.util.Clock;
4847
import google.registry.util.CollectionUtils;
4948
import google.registry.util.GoogleCredentialsBundle;
@@ -175,7 +174,7 @@ private static String processRequestParameters(
175174
* the worker service</a>
176175
*/
177176
protected Task createTask(
178-
String path, Method method, Service service, Multimap<String, String> params) {
177+
String path, Method method, Action.Service service, Multimap<String, String> params) {
179178
checkArgument(
180179
path != null && !path.isEmpty() && path.charAt(0) == '/',
181180
"The path must start with a '/'.");
@@ -231,9 +230,7 @@ public Task createTask(
231230
method,
232231
actionClazz.getSimpleName(),
233232
allowedMethods);
234-
Service service =
235-
RegistryEnvironment.isOnJetty() ? Action.ServiceGetter.get(action) : action.service();
236-
return createTask(path, method, service, params);
233+
return createTask(path, method, action.service(), params);
237234
}
238235

239236
/**
@@ -256,7 +253,7 @@ public Task createTask(
256253
public Task createTaskWithJitter(
257254
String path,
258255
Method method,
259-
Service service,
256+
Action.Service service,
260257
Multimap<String, String> params,
261258
Optional<Integer> jitterSeconds) {
262259
if (jitterSeconds.isEmpty() || jitterSeconds.get() <= 0) {
@@ -297,9 +294,7 @@ public Task createTaskWithJitter(
297294
"Action class %s is not annotated with @Action",
298295
actionClazz.getSimpleName());
299296
String path = action.path();
300-
Service service =
301-
RegistryEnvironment.isOnJetty() ? Action.ServiceGetter.get(action) : action.service();
302-
return createTaskWithJitter(path, method, service, params, jitterSeconds);
297+
return createTaskWithJitter(path, method, action.service(), params, jitterSeconds);
303298
}
304299

305300
/**
@@ -319,7 +314,7 @@ public Task createTaskWithJitter(
319314
private Task createTaskWithDelay(
320315
String path,
321316
Method method,
322-
Service service,
317+
Action.Service service,
323318
Multimap<String, String> params,
324319
Duration delay) {
325320
if (delay.isEqual(Duration.ZERO)) {
@@ -354,9 +349,7 @@ public Task createTaskWithDelay(
354349
Duration delay) {
355350
Action action = getAction(actionClazz);
356351
String path = action.path();
357-
Service service =
358-
RegistryEnvironment.isOnJetty() ? Action.ServiceGetter.get(action) : action.service();
359-
return createTaskWithDelay(path, method, service, params, delay);
352+
return createTaskWithDelay(path, method, action.service(), params, delay);
360353
}
361354

362355
private static Action getAction(Class<? extends Runnable> actionClazz) {

core/src/main/java/google/registry/batch/DeleteExpiredDomainsAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import google.registry.model.eppoutput.EppOutput;
3838
import google.registry.persistence.transaction.QueryComposer.Comparator;
3939
import google.registry.request.Action;
40-
import google.registry.request.Action.GaeService;
4140
import google.registry.request.Response;
4241
import google.registry.request.auth.Auth;
4342
import google.registry.request.lock.LockHandler;
@@ -68,7 +67,7 @@
6867
* this action runs, thus alerting us that human action is needed to correctly process the delete.
6968
*/
7069
@Action(
71-
service = GaeService.BACKEND,
70+
service = Action.Service.BACKEND,
7271
path = DeleteExpiredDomainsAction.PATH,
7372
auth = Auth.AUTH_ADMIN)
7473
public class DeleteExpiredDomainsAction implements Runnable {

core/src/main/java/google/registry/batch/DeleteLoadTestDataAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import google.registry.model.reporting.HistoryEntryDao;
3838
import google.registry.persistence.VKey;
3939
import google.registry.request.Action;
40-
import google.registry.request.Action.GaeService;
4140
import google.registry.request.Parameter;
4241
import google.registry.request.auth.Auth;
4342
import google.registry.util.Clock;
@@ -55,7 +54,7 @@
5554
* production.
5655
*/
5756
@Action(
58-
service = GaeService.BACKEND,
57+
service = Action.Service.BACKEND,
5958
path = "/_dr/task/deleteLoadTestData",
6059
method = POST,
6160
auth = Auth.AUTH_ADMIN)

core/src/main/java/google/registry/batch/DeleteProberDataAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import google.registry.model.domain.DomainHistory;
4343
import google.registry.model.tld.Tld.TldType;
4444
import google.registry.request.Action;
45-
import google.registry.request.Action.GaeService;
4645
import google.registry.request.Parameter;
4746
import google.registry.request.auth.Auth;
4847
import google.registry.util.RegistryEnvironment;
@@ -59,7 +58,7 @@
5958
* billing events, along with their ForeignKeyDomainIndex entities.
6059
*/
6160
@Action(
62-
service = GaeService.BACKEND,
61+
service = Action.Service.BACKEND,
6362
path = "/_dr/task/deleteProberData",
6463
method = POST,
6564
auth = Auth.AUTH_ADMIN)

core/src/main/java/google/registry/batch/ExpandBillingRecurrencesAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import google.registry.model.billing.BillingRecurrence;
3636
import google.registry.model.common.Cursor;
3737
import google.registry.request.Action;
38-
import google.registry.request.Action.GaeService;
3938
import google.registry.request.Parameter;
4039
import google.registry.request.Response;
4140
import google.registry.request.auth.Auth;
@@ -51,7 +50,7 @@
5150
* BillingRecurrence} billing events into synthetic {@link BillingEvent} events.
5251
*/
5352
@Action(
54-
service = GaeService.BACKEND,
53+
service = Action.Service.BACKEND,
5554
path = "/_dr/task/expandBillingRecurrences",
5655
auth = Auth.AUTH_ADMIN)
5756
public class ExpandBillingRecurrencesAction implements Runnable {

core/src/main/java/google/registry/batch/RelockDomainAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import google.registry.model.tld.RegistryLockDao;
3333
import google.registry.persistence.VKey;
3434
import google.registry.request.Action;
35-
import google.registry.request.Action.GaeService;
3635
import google.registry.request.Parameter;
3736
import google.registry.request.Response;
3837
import google.registry.request.auth.Auth;
@@ -47,7 +46,7 @@
4746

4847
/** Task that re-locks a previously-Registry-Locked domain after a predetermined period of time. */
4948
@Action(
50-
service = GaeService.BACKEND,
49+
service = Action.Service.BACKEND,
5150
path = RelockDomainAction.PATH,
5251
method = POST,
5352
automaticallyPrintOk = true,

core/src/main/java/google/registry/batch/RemoveAllDomainContactsAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import google.registry.model.eppoutput.EppOutput;
4545
import google.registry.persistence.VKey;
4646
import google.registry.request.Action;
47-
import google.registry.request.Action.GaeService;
4847
import google.registry.request.Response;
4948
import google.registry.request.auth.Auth;
5049
import google.registry.request.lock.LockHandler;
@@ -67,7 +66,7 @@
6766
* leaving behind a record recording that update.
6867
*/
6968
@Action(
70-
service = GaeService.BACKEND,
69+
service = Action.Service.BACKEND,
7170
path = RemoveAllDomainContactsAction.PATH,
7271
method = Action.Method.POST,
7372
auth = Auth.AUTH_ADMIN)

core/src/main/java/google/registry/batch/ResaveAllEppResourcesPipelineAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import com.google.common.net.MediaType;
2929
import google.registry.config.RegistryConfig.Config;
3030
import google.registry.request.Action;
31-
import google.registry.request.Action.GaeService;
3231
import google.registry.request.Parameter;
3332
import google.registry.request.Response;
3433
import google.registry.request.auth.Auth;
@@ -54,7 +53,7 @@
5453
* <p>This runs the {@link google.registry.beam.resave.ResaveAllEppResourcesPipeline}.
5554
*/
5655
@Action(
57-
service = GaeService.BACKEND,
56+
service = Action.Service.BACKEND,
5857
path = ResaveAllEppResourcesPipelineAction.PATH,
5958
auth = Auth.AUTH_ADMIN)
6059
public class ResaveAllEppResourcesPipelineAction implements Runnable {

0 commit comments

Comments
 (0)