-
Notifications
You must be signed in to change notification settings - Fork 53
feat: support custom feed filenames for deployment #622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract a method to get the filename to use during deployment.
src/main/java/com/conveyal/datatools/manager/models/Deployment.java
Outdated
Show resolved
Hide resolved
src/main/java/com/conveyal/datatools/manager/models/Deployment.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the changes. Two minor nits but it's good to go.
entryName = fs.filename.endsWith(".zip") ? fs.filename : fs.filename + ".zip"; | ||
LOG.info("Using FeedSource filename for zip entry: {}", entryName); | ||
} else { | ||
// Fallback to the original GTFS filename derived from FeedVersion | ||
entryName = gtfsFile.getName(); | ||
LOG.info("Using FeedVersion filename for zip entry: {}", entryName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: you could log first then return
from inside the if/else block, and remove lines 434 and 445.
|
||
feedSource.filename = " "; | ||
Persistence.feedSources.replace(feedSource.id, feedSource); | ||
assertEquals(gtfsFile.getName(), deployment.getFeedSourceBundleFilename(feedVersion, gtfsFile)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract a variable for gtfsFile.getName()
.
…corresponding tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nitpicks but overall this looks great
/** An optional display filename for the feed in the bundle, e.g. "agency_transit.zip" */ | ||
public String filename; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this in the summary? Isn't it fine if the data only loads on requesting the entire feed source
@@ -18,6 +18,7 @@ | |||
import com.fasterxml.jackson.databind.ObjectMapper; | |||
import com.google.common.io.ByteStreams; | |||
import com.mongodb.client.FindIterable; | |||
import org.apache.logging.log4j.util.Strings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to import this? Feels strange to import this for non logging purposes
Checklist
dev
before they can be merged tomaster
)Description
This PR adds support for overriding the feed filenames that will be used in the bundle. This feature allows us to override feed specific build settings in the build config.