docs: Define severity for each notice#726
Conversation
|
@barbeau Also:
|
|
That would increase the amount of job for me. I see that you set severity of DuplicateKeyError and DuplicatedColumnNotice to INFO while they are ERRORs. That will lead to incorrect validation reports and to errors in the core code. Please let me set the priorities because I know what they should be and what we actually have in the production feeds in the world. |
barbeau
left a comment
There was a problem hiding this comment.
Thanks @lionel-nj! My comments on errors vs. warnings are in-line, following the approach of the canonical validator where only items that are explicitly required in the spec (based on RFC 2119 language definitions) can be errors. I believe some require the feedback of @MobilityData/transit-specs.
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/DuplicateKeyError.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/DuplicatedColumnNotice.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/NonAsciiOrNonPrintableCharNotice.java
Show resolved
Hide resolved
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/UnexpectedEnumValueError.java
Outdated
Show resolved
Hide resolved
...ain/java/org/mobilitydata/gtfsvalidator/notice/BlockTripsWithOverlappingStopTimesNotice.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/mobilitydata/gtfsvalidator/notice/SameNameAndDescriptionForRouteNotice.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/notice/StartAndEndDateOutOfOrderNotice.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/notice/StartAndEndTimeOutOfOrderNotice.java
Outdated
Show resolved
Hide resolved
.../mobilitydata/gtfsvalidator/notice/StopTimeWithArrivalBeforePreviousDepartureTimeNotice.java
Outdated
Show resolved
Hide resolved
...java/org/mobilitydata/gtfsvalidator/notice/StopTimeWithDepartureBeforeArrivalTimeNotice.java
Outdated
Show resolved
Hide resolved
# Conflicts: # core/src/main/java/org/mobilitydata/gtfsvalidator/notice/NonAsciiOrNonPrintableCharNotice.java # main/src/main/java/org/mobilitydata/gtfsvalidator/notice/InconsistentAgencyTimezoneNotice.java
|
Thanks @barbeau just updated this PR. I will wait for @MobilityData/transit-specs to confirm the comments I left unresolved. |
- change several notice severity level
- change several notice severity level
# Conflicts: # main/src/main/java/org/mobilitydata/gtfsvalidator/notice/OverlappingFrequencyNotice.java
|
@barbeau this PR is now ready for review. Thanks @timMillet ! |
barbeau
left a comment
There was a problem hiding this comment.
@lionel-nj This looks pretty good! I found two things that needs to be changed, plus another I'd like feedback on from @MobilityData/transit-specs.
main/src/main/java/org/mobilitydata/gtfsvalidator/notice/InconsistentAgencyTimezoneNotice.java
Outdated
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/notice/StartAndEndDateOutOfOrderNotice.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/DuplicatedColumnNotice.java
Outdated
Show resolved
Hide resolved
…idator into categorize-notices
|
@lionel-nj Could you resolve the conflicts here, and change If you do that, and update the notices merged in #756 (just the Javadocs, I think, to match those in this PR), then I think this should be ready to merge! |
# Conflicts: # core/src/main/java/org/mobilitydata/gtfsvalidator/notice/FieldParsingError.java
|
That is a big contribution, Lionel. Thank you! I left some comments mostly based on the real production feeds. |
core/src/main/java/org/mobilitydata/gtfsvalidator/notice/DuplicatedColumnNotice.java
Outdated
Show resolved
Hide resolved
| /** | ||
| * A CSV file is empty. | ||
| * | ||
| * <p>Severity: {@code SeverityLevel.ERROR} |
There was a problem hiding this comment.
We do not enforce that check at Google, so this should be rather a warning. This is not a blocker for using feed data if, e.g., there is an empty file pathways.txt. An empty file is practically equivalent to a missing file.
We have 3 situations that may be treated as equivalent:
- a file is missing
- a file has only headers
- a file is empty
GTFS marks certain files as required. I think that we should amend the GTFS reference and say that a required file must contain at least one record (not counting the headers).
There was a problem hiding this comment.
The Javadocs for CsvFile.isEmpty() currently say:
Tells if the file is empty, i.e. it has no rows and even no headers.
And GTFS says:
The first line of each file must contain field names.
...so this seems to align as an ERROR to me. Let's discuss in a new issue/PR if needed so we can get this merged - it's getting hard to manage this PR due to length.
| /** | ||
| * An enum has an unexpected value. | ||
| * | ||
| * <p>Severity: {@code SeverityLevel.WARNING} |
There was a problem hiding this comment.
We treat it as an ERROR at Google but it probably may be a WARNING in the upstream.
There was a problem hiding this comment.
@barbeau suggested to make that one a WARNING
I think this has to be a WARNING? There are a lot of examples where producers have extended enumeration values in their own feeds with values that don't exist in the spec. And to my knowledge the spec doesn't explicitly say you can't use non-standard enum values.
from #726 (comment)
...ain/java/org/mobilitydata/gtfsvalidator/notice/BlockTripsWithOverlappingStopTimesNotice.java
Show resolved
Hide resolved
main/src/main/java/org/mobilitydata/gtfsvalidator/notice/FeedExpirationDateNotice.java
Outdated
Show resolved
Hide resolved
| /** | ||
| * {@code agency.agency_lang} and {@code feed_info.feed_lang} do not match | ||
| * | ||
| * <p>Severity: {@code SeverityLevel.WARNING} |
There was a problem hiding this comment.
Let's make it an ERROR. If feed gives different agency_lang and feed_lang, the intended meaning of that is undefined. Google rejects such feeds.
There was a problem hiding this comment.
Let's discuss in a new issue/PR if needed so we can get this merged - it's getting hard to manage this PR due to length.
...rc/main/java/org/mobilitydata/gtfsvalidator/notice/SameNameAndDescriptionForRouteNotice.java
Outdated
Show resolved
Hide resolved
| * `routes.route_long_name`/`routes/route_short_name. | ||
| * <p>"Do not simply duplicate the name of the location." (http://gtfs.org/reference/static#routestxt) | ||
| * | ||
| * <p>Severity: {@code SeverityLevel.ERROR} |
There was a problem hiding this comment.
This should be a WARNING. This does not make the feed non-functional.
There was a problem hiding this comment.
I think we can safely call this an ERROR. The spec says do not.
from #726 (comment)
|
Hi @lionel-nj Please can you remove FieldParsingError.java file that resurrected in this PR? Thanks! |
|
Sure @aababilov! It's done in #775 |
closes #709
closes #472
closes #417
Summary:
This PR suggests a category for each specific notice.
Expected behavior:
Tests should pass.
Please make sure these boxes are checked before submitting your pull request - thanks!
gradle testto make sure you didn't break anything[ ] Include screenshot(s) showing how this pull request works and fixes the issue(s)