Skip to content

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

daniel-heppner-ibigroup
Copy link
Contributor

@daniel-heppner-ibigroup daniel-heppner-ibigroup commented Apr 16, 2025

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JavaDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing
  • The description lists all relevant PRs included in this release (remove this if not merging to master)
  • e2e tests are all passing (remove this if not merging to master)

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.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a 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.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a 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.

Comment on lines 438 to 443
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);
Copy link
Contributor

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));
Copy link
Contributor

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().

Copy link
Contributor

@miles-grant-ibigroup miles-grant-ibigroup left a 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

Comment on lines +45 to +47
/** An optional display filename for the feed in the bundle, e.g. "agency_transit.zip" */
public String filename;

Copy link
Contributor

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;
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants