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

feat: Validation for conditionally required/forbidden fare_rules.txt file. #1261

Closed

Conversation

bdferris-v2
Copy link
Collaborator

Summary:

Per updates introduced in the Fares v2 spec addition, we now check for the conditionally required/forbidden fare_rules.txt file.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues

@bdferris-v2 bdferris-v2 linked an issue Oct 3, 2022 that may be closed by this pull request
@bdferris-v2
Copy link
Collaborator Author

@isabelle-dr per discussion, here is a separate PR for the Fares v1 file checks.

Copy link
Collaborator

@KClough KClough left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@isabelle-dr isabelle-dr left a comment

Choose a reason for hiding this comment

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

2 minor changes in line.
Can you resolve the merge conflicts?
Then, I'll merge this PR!

RULES.md Outdated Show resolved Hide resolved
RULES.md Outdated Show resolved Hide resolved
@bdferris-v2
Copy link
Collaborator Author

@merge conflicts have been resolved

@isabelle-dr isabelle-dr added this to the v4.0 milestone Oct 4, 2022
@bdferris-v2
Copy link
Collaborator Author

Pasting this in manually:

❌ Invalid acceptance test.
New Errors: 62 out of 1363 datasets (~5%) are invalid due to code change, which is above the provided threshold of 1%.
Dropped Errors: 0 out of 1363 datasets (~0%) are invalid due to code change, which is less than the provided threshold of 1%.
1 out of 1364 sources (~0 %) are corrupted.
Corrupted sources:
de-unknown-ulmer-eisenbahnfreunde-gtfs-1081
Commit: e0746f5
Download the full acceptance test report here (report will disappear after 90 days).
❌ Invalid acceptance test.

I was curious what this was going to trigger. Taking a closer look.

@isabelle-dr
Copy link
Contributor

isabelle-dr commented Oct 4, 2022

Isn't having fare_rules.txt going from Optional to "Required if fare_attributes.txt is defined" (which was a pre-existing Optional file), a breaking change?
I'm not surprised that we have some existing datasets becoming invalid.

@bdferris-v2
Copy link
Collaborator Author

I'm a little confused by the change to the spec as well.

Looking back at the original Fares V1 example documentation (not really hosted anywhere anymore, but available at https://web.archive.org/web/20111207224351/https://code.google.com/p/googletransitdatafeed/wiki/FareExamples), having a fare_attributes.txt file with a single entry and no fare_rules.txt file was a supported use-case for systems that have a single base fare. This was actually brought up in a comment by @flocsy but I think his feedback was ignored?

And indeed, when I look through the acceptance report for this change, there are 62 feeds in the MobilityDatabase that have a fare_attributes.txt file but no fare_rules.txt file. Of those, 39 have a single entry in fare_attributes.txt, indicating a default fare.

That said, there are also 11 feeds where fare_attributes.txt has no entires (but still has a CSV row header). I'm not sure how that should be interpreted? A free fare? There are additionally 10 feeds that specify multiple fare_attributes.txt entries where fare_rules.txt looks like should legitimately be specified.

I'm tempted to say "pause" on this PR and get some feedback from the #gtfs-fares group before proceeding.

@isabelle-dr isabelle-dr added need spec clarification Needs a modification in the specification status: Blocked Can't work on it currently because of an external factor. labels Oct 5, 2022
@isabelle-dr
Copy link
Contributor

@bdferris-v2 I am closing this since we decided to modify the spec and not the validator for this one.
We can eventually keep the addition of forbidden_file to use in other cases. I'll let you decide if you'd like to open another PR for it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need spec clarification Needs a modification in the specification status: Blocked Can't work on it currently because of an external factor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add rules for the Fares v2 base implementation
3 participants