Skip to content
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

Add option to export patterns #567

Merged
merged 11 commits into from
Nov 15, 2023
Merged

Conversation

philip-cline
Copy link
Contributor

@philip-cline philip-cline commented Oct 6, 2023

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

Description

This PR facilitates the export of the proprietary datatools_patterns.txt file, introduced in https://github.com/conveyal/gtfs-lib/pulls, which allows the preservation of custom pattern names in the editor.

Front end PR: https://github.com/ibi-group/datatools-ui/compare/add-option-for-publishing-patterns?expand=1
GTFS-lib PR: conveyal/gtfs-lib#394

@br648 br648 assigned philip-cline and unassigned br648 Oct 25, 2023
@philip-cline philip-cline assigned br648 and unassigned philip-cline Nov 6, 2023
Copy link
Contributor

@br648 br648 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Will be good to get this merged so dev is in-sync with GTFS-lib dev which already contains this work.

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.

Very clean, just one major q

@@ -63,6 +63,12 @@ private static Snapshot getSnapshotFromRequest(Request req) {
return Persistence.snapshots.getById(id);
}

private static boolean getPublishProprietaryFiles(Request req) {
return Boolean.parseBoolean(
req.queryParamOrDefault("publishProprietaryFiles",Boolean.FALSE.toString())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
req.queryParamOrDefault("publishProprietaryFiles",Boolean.FALSE.toString())
req.queryParamOrDefault("publishProprietaryFiles", Boolean.FALSE.toString())

Missing space

@@ -130,7 +130,8 @@ public void jobLogic() {
snapshot.feedTransformResult = dbTarget.feedTransformResult;
// If the user has selected to create a new version from the resulting snapshot, do so here.
if (rules.createNewVersion) {
addNextJob(new CreateFeedVersionFromSnapshotJob(feedSource, snapshot, owner));
// Publishing the proprietary files will preserve the pattern names in the newly created feed version.
addNextJob(new CreateFeedVersionFromSnapshotJob(feedSource, snapshot, owner, true));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a scary new default. How are we sure this won't have weird side effects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a safe default bc the method is only used to process incoming GTFS files. All the export methods allow for user selection if they want to export the pattern names and this just allows re-import

@philip-cline philip-cline merged commit 4d2b850 into dev Nov 15, 2023
6 checks passed
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.

3 participants