From 91f5b1848a42629742bacc189b03e4c873ea8c9e Mon Sep 17 00:00:00 2001 From: miles-grant-ibi Date: Fri, 13 Dec 2024 11:52:13 -0500 Subject: [PATCH] remove project-wide deployment settings --- .../datatools/manager/models/Deployment.java | 35 ++----------------- .../manager/models/OtpBuildConfig.java | 19 ---------- .../manager/models/OtpRouterConfig.java | 26 -------------- .../datatools/manager/models/Project.java | 6 ---- 4 files changed, 2 insertions(+), 84 deletions(-) diff --git a/src/main/java/com/conveyal/datatools/manager/models/Deployment.java b/src/main/java/com/conveyal/datatools/manager/models/Deployment.java index cb06e25fd..4fe7ebb92 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/Deployment.java +++ b/src/main/java/com/conveyal/datatools/manager/models/Deployment.java @@ -442,22 +442,12 @@ public byte[] generateBuildConfig() throws IOException { } return customBuildConfig != null ? customBuildConfig.getBytes(StandardCharsets.UTF_8) - : getProjectBuildConfig(); - } - - /** - * If a project build config exists, return this as a byte array, or null if not available. - */ - private byte[] getProjectBuildConfig() { - Project project = parentProject(); - return project.buildConfig != null - ? writeToBytes(project.buildConfig) : null; } public String generateBuildConfigAsString() { if (customBuildConfig != null) return customBuildConfig; - return writeToString(this.parentProject().buildConfig); + return null; } /** Convenience method to write serializable object (primarily for router/build config objects) to byte array. */ @@ -487,30 +477,9 @@ public byte[] generateRouterConfig() throws IOException { customRouterConfig = downloadedConfig; } - byte[] customRouterConfigString = customRouterConfig != null + return customRouterConfig != null ? customRouterConfig.getBytes(StandardCharsets.UTF_8) : null; - - byte[] routerConfigString = parentProject().routerConfig != null - ? writeToBytes(parentProject().routerConfig) - : null; - - // If both router configs are present, merge the JSON before returning - // Merger code from: https://stackoverflow.com/questions/35747813/how-to-merge-two-json-strings-into-one-in-java - if (customRouterConfigString != null && routerConfigString != null) { - ObjectMapper mapper = new ObjectMapper(); - Map map1 = mapper.readValue(customRouterConfigString, Map.class); - Map map2 = mapper.readValue(routerConfigString, Map.class); - Map merged = new HashMap(map2); - merged.putAll(map1); - return mapper.writeValueAsString(merged).getBytes(); - } - - return customRouterConfigString != null - ? customRouterConfigString - : routerConfigString != null - ? routerConfigString - : null; } /** Generate router config for deployment as byte array (for writing to file output stream). */ diff --git a/src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java b/src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java index 760a0a11f..4ee8471b4 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java +++ b/src/main/java/com/conveyal/datatools/manager/models/OtpBuildConfig.java @@ -11,23 +11,4 @@ public class OtpBuildConfig implements Serializable { private static final long serialVersionUID = 1L; - public Boolean fetchElevationUS; - // FIXME: elevation bucket causing NPE issue if missing values when deploying to OTP - // public S3Bucket elevationBucket; - - public Boolean stationTransfers; - - public Double subwayAccessTime; - - /** Currently only supports no-configuration fares, e.g. New York or San Francisco */ - public String fares; - - public OtpBuildConfig() {} - - public static class S3Bucket implements Serializable { - private static final long serialVersionUID = 1L; - public String accessKey; - public String secretKey; - public String bucketName; - } } diff --git a/src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java b/src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java index 09771fb76..6be7d51e4 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java +++ b/src/main/java/com/conveyal/datatools/manager/models/OtpRouterConfig.java @@ -11,31 +11,5 @@ @JsonIgnoreProperties(ignoreUnknown = true) public class OtpRouterConfig implements Serializable { private static final long serialVersionUID = 1L; - public Double driveDistanceReluctance; - public Double stairsReluctance; - - public Collection updaters; - - public ItineraryFilter itineraryFilters; - - public static class ItineraryFilter implements Serializable { - private static final long serialVersionUID = 1L; - public String nonTransitGeneralizedCostLimit; - } - - public static class Updater implements Serializable { - private static final long serialVersionUID = 1L; - public String type; - - public Integer frequencySec; - - public String sourceType; - - public String url; - - public String feedId; - } - - public String requestLogFile; } diff --git a/src/main/java/com/conveyal/datatools/manager/models/Project.java b/src/main/java/com/conveyal/datatools/manager/models/Project.java index eccb7d33a..073405297 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/Project.java +++ b/src/main/java/com/conveyal/datatools/manager/models/Project.java @@ -47,10 +47,6 @@ public class Project extends Model { public boolean useCustomOsmBounds; - public OtpBuildConfig buildConfig; - - public OtpRouterConfig routerConfig; - public String organizationId; /** Last successful auto deploy. **/ @@ -111,8 +107,6 @@ public List availableOtpServers() { public Project() { - this.buildConfig = new OtpBuildConfig(); - this.routerConfig = new OtpRouterConfig(); this.useCustomOsmBounds = false; }