Skip to content

Commit 841863d

Browse files
authored
Merge pull request #352 from ibi-group/dev
Release
2 parents 4922ce5 + 504f11d commit 841863d

File tree

109 files changed

+5036
-1894
lines changed

Some content is hidden

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

109 files changed

+5036
-1894
lines changed

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ before_script:
3636
# Create dir for GTFS+ files (used during testing)
3737
- mkdir /tmp/gtfsplus
3838
script:
39-
# run mvn package to make sure unit tests and packaging can work
40-
- mvn package
39+
# run mvn package (only print errors) to make sure unit tests and packaging can work
40+
- mvn -q package
4141
# Restart/clear MongoDB so that E2E tests run on clean DB.
4242
- ./scripts/restart-mongo-with-fresh-db.sh
4343
# recursively copy coverage results into another folder so the e2e tests don't overwrite them
@@ -89,7 +89,13 @@ before_deploy:
8989
- ls target/*.jar
9090
# Copy packaged jar over to deploy dir.
9191
- cp target/dt-*.jar deploy/
92-
- cp target/dt-*.jar "deploy/dt-latest-$BRANCH_CLEAN.jar"
92+
# Get the first jar file and copy it into a new file that adds the current branch name. During a
93+
# merge to master, there are multiple jar files produced, but they're each effectively the same
94+
# code (there may be slight differences in the version shown in the `pom.xml`, but that's not
95+
# important for the purposes of creating this "latest branch" jar).
96+
- ALL_JARS=(target/dt-*.jar)
97+
- FIRST_JAR="${ALL_JARS[0]}"
98+
- cp "$FIRST_JAR" "deploy/dt-latest-$BRANCH_CLEAN.jar"
9399
deploy:
94100
provider: s3
95101
skip_cleanup: true

configurations/test/env.yml.tmp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ SPARKPOST_EMAIL: [email protected]
1515
GTFS_DATABASE_URL: jdbc:postgresql://localhost/catalogue
1616
# GTFS_DATABASE_USER:
1717
# GTFS_DATABASE_PASSWORD:
18-
#MONGO_URI: mongodb://mongo-host:27017
18+
19+
# To configure a remote MongoDB service (such as MongoDB Atlas), provide all
20+
# Mongo properties below. Otherwise, only a database name is needed (server
21+
# defaults to mongodb://localhost:27017 with no username/password authentication).
1922
MONGO_DB_NAME: catalogue
23+
#MONGO_HOST: cluster1.mongodb.net
24+
#MONGO_PASSWORD: password
25+
#MONGO_PROTOCOL: mongodb+srv
26+
#MONGO_USER: user

pom.xml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,18 @@
239239
<dependency>
240240
<groupId>junit</groupId>
241241
<artifactId>junit</artifactId>
242-
<version>4.12</version>
242+
<version>4.13.1</version>
243243
<scope>test</scope>
244244
</dependency>
245245

246-
<!-- Used for loading/fetching/writing GTFS entities. gtfs-lib also provides access to:
246+
<!-- Used for loading/fetching/validating/writing GTFS entities. gtfs-lib also provides access to:
247247
- commons-io - generic utilities
248248
- AWS S3 SDK - putting/getting objects into/out of S3.
249249
-->
250250
<dependency>
251251
<groupId>com.conveyal</groupId>
252252
<artifactId>gtfs-lib</artifactId>
253-
<version>6.0.3</version>
253+
<version>6.1.0</version>
254254
<!-- Exclusions added in order to silence SLF4J warnings about multiple bindings:
255255
http://www.slf4j.org/codes.html#multiple_bindings
256256
-->
@@ -262,11 +262,11 @@
262262
</exclusions>
263263
</dependency>
264264

265-
<!-- Used for data-tools application database -->
265+
<!-- Used for application database -->
266266
<dependency>
267267
<groupId>org.mongodb</groupId>
268-
<artifactId>mongodb-driver</artifactId>
269-
<version>3.5.0</version>
268+
<artifactId>mongodb-driver-sync</artifactId>
269+
<version>4.0.5</version>
270270
</dependency>
271271

272272
<!-- Miscellaneous utilities -->
@@ -334,6 +334,13 @@
334334
<artifactId>gt-api</artifactId>
335335
<version>${geotools.version}</version>
336336
</dependency>
337+
<!-- gt-epsg-hsql includes coordinate reference libraries that were removed from gtfs-lib in
338+
https://github.com/conveyal/gtfs-lib/pull/290 -->
339+
<dependency>
340+
<groupId>org.geotools</groupId>
341+
<artifactId>gt-epsg-hsql</artifactId>
342+
<version>${geotools.version}</version>
343+
</dependency>
337344

338345
<!-- Error reporting -->
339346
<dependency>

src/main/java/com/conveyal/datatools/common/status/MonitorableJob.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public abstract class MonitorableJob implements Runnable, Serializable {
4545

4646
public enum JobType {
4747
UNKNOWN_TYPE,
48+
ARBITRARY_FEED_TRANSFORM,
4849
BUILD_TRANSPORT_NETWORK,
4950
CREATE_FEEDVERSION_FROM_SNAPSHOT,
5051
// **** Legacy snapshot jobs
@@ -65,7 +66,8 @@ public enum JobType {
6566
CONVERT_EDITOR_MAPDB_TO_SQL,
6667
VALIDATE_ALL_FEEDS,
6768
MONITOR_SERVER_STATUS,
68-
MERGE_FEED_VERSIONS
69+
MERGE_FEED_VERSIONS,
70+
RECREATE_BUILD_IMAGE
6971
}
7072

7173
public MonitorableJob(Auth0UserProfile owner, String name, JobType type) {
@@ -216,6 +218,11 @@ public void addNextJob(MonitorableJob ...jobs) {
216218
}
217219
}
218220

221+
/** Convenience wrapper for a {@link List} of jobs. */
222+
public void addNextJob(List<MonitorableJob> jobs) {
223+
for (MonitorableJob job : jobs) addNextJob(job);
224+
}
225+
219226
/**
220227
* Represents the current status of this job.
221228
*/

src/main/java/com/conveyal/datatools/common/utils/AWSUtils.java

Lines changed: 0 additions & 197 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.conveyal.datatools.common.utils;
2+
3+
/**
4+
* A class that holds another variable and keeps track of whether the variable is still considered to be active (ie not
5+
* expired)
6+
*/
7+
public class ExpiringAsset<T> {
8+
public final T asset;
9+
private final long expirationTimeMillis;
10+
11+
public ExpiringAsset(T asset, long validDurationMillis) {
12+
this.asset = asset;
13+
this.expirationTimeMillis = System.currentTimeMillis() + validDurationMillis;
14+
}
15+
16+
/**
17+
* @return true if the asset hasn't yet expired
18+
*/
19+
public boolean isActive() {
20+
return expirationTimeMillis > System.currentTimeMillis();
21+
}
22+
23+
/**
24+
* @return the amount of time that the asset is still valid for in milliseconds.
25+
*/
26+
public long timeRemainingMillis() {
27+
return expirationTimeMillis - System.currentTimeMillis();
28+
}
29+
}

0 commit comments

Comments
 (0)