Skip to content

Fares V2#8

Open
br648 wants to merge 56 commits intodevfrom
feature/DT-448-fares-v2
Open

Fares V2#8
br648 wants to merge 56 commits intodevfrom
feature/DT-448-fares-v2

Conversation

@br648
Copy link
Copy Markdown

@br648 br648 commented Aug 19, 2024

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

Update to include fares v2 based on design:

https://docs.google.com/document/d/1EBMoxfXscPhFWyrn4fyGR6foQ7JGBWvMWeodrvo7DPw/edit

br648 added 30 commits August 15, 2024 13:14
Replaced endsWith with equals to avoid unwanted matches e.g. stop_areas.txt being used instead of
areas.txt
…ator with OS derived reference

Test should now work on Linux
… the route network table

The route id is unique to the route table has well. This prevents duplicate key failures
Copy link
Copy Markdown

@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.

So much boilerplate wow... this looks really good! Just 2 small things

Comment thread src/main/java/com/conveyal/gtfs/loader/Table.java
Comment thread src/main/java/com/conveyal/gtfs/model/Entity.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/model/Entity.java
Comment thread src/main/java/com/conveyal/gtfs/util/CsvReaderUtil.java
Copy link
Copy Markdown

@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.

This looks great! Because of the scope of these changes I couldn't review as carefully as I could for a smaller PR, but everything seems to work well and the changes look clean

Copy link
Copy Markdown

@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.

First round of comments just from reading some of the files. More to come.

Comment thread src/main/java/com/conveyal/gtfs/graphql/GraphQLUtil.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/graphql/GraphQLGtfsFaresV2Schema.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/graphql/GraphQLUtil.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/graphql/GraphQLGtfsSchema.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/graphql/GraphQLGtfsSchema.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/model/FareMedia.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/model/FareMedia.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/model/FareTransferRule.java Outdated
Comment thread src/test/java/com/conveyal/gtfs/dto/RouteDTO.java Outdated
Comment thread src/test/java/com/conveyal/gtfs/graphql/GTFSGraphQLTest.java Outdated
Copy link
Copy Markdown

@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.

Just a few refactor requests for now, and I still need to run the code with the other stuff,
mainly split CsvReaderUtil.getCsvReaderFromMergedFiles, inling a few return, and cleaning up dead code. The other suggestions and comment additions would be nice to have.

Comment thread src/main/java/com/conveyal/gtfs/model/Route.java
/*
Check referential integrity without storing references.
*/
getRefField(AREA_ID_NAME, true, feed.areas);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What happens here if the referential integrity fails?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

A ReferentialIntegrityError is flagged. Processing is not halted.

Comment thread src/main/java/com/conveyal/gtfs/model/TimeFrame.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/util/CsvReaderUtil.java Outdated
Comment thread src/main/java/com/conveyal/gtfs/util/CsvReaderUtil.java Outdated
Comment thread src/test/java/com/conveyal/gtfs/GTFSFaresV2Test.java Outdated
Comment thread src/test/java/com/conveyal/gtfs/GTFSFaresV2Test.java Outdated
Comment thread src/test/java/com/conveyal/gtfs/TestUtils.java Outdated
Comment thread src/test/java/com/conveyal/gtfs/TestUtils.java Outdated
Comment thread src/test/java/com/conveyal/gtfs/TestUtils.java Outdated
@br648 br648 requested a review from binh-dam-ibigroup April 21, 2026 15:25
Comment on lines 71 to 81
@@ -84,107 +78,146 @@ void canDoRoundTripLoadAndWriteToZipFile() throws IOException {
feed.toFile(outZip.getAbsolutePath());
feed.close();
assertTrue(outZip.exists());

// assert that rows of data were written to files within the zipfile
ZipFile zip = new ZipFile(outZip);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Move this code to the actual test.

*/
@ParameterizedTest(name = "{1}")
@MethodSource("createFileTestCases")
void canDoRoundTripLoadAndWriteToZipFile(ZipFile zip, TestUtils.FileTestCase fileTestCase) throws IOException {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove the zip parameter, and move the creation of the zip file in this function.


@Override
public String toString() {
return "FileTestCase{" +
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use String.format.

Copy link
Copy Markdown

@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.

One more small change in the tests, then I will approve. The other changes seem fine and appear to work with datatools-server.

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