Skip to content

docs: Define severity for each notice#726

Merged
barbeau merged 18 commits intomasterfrom
categorize-notices
Feb 19, 2021
Merged

docs: Define severity for each notice#726
barbeau merged 18 commits intomasterfrom
categorize-notices

Conversation

@lionel-nj
Copy link
Copy Markdown
Contributor

@lionel-nj lionel-nj commented Feb 5, 2021

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!

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Format the title like "feat: -new feature short description-" (PR title must follow the conventional commit specification)
  • Linked all relevant issues
  • [ ] Include screenshot(s) showing how this pull request works and fixes the issue(s)

@lionel-nj lionel-nj self-assigned this Feb 5, 2021
@lionel-nj lionel-nj requested a review from barbeau February 5, 2021 16:46
@lionel-nj
Copy link
Copy Markdown
Contributor Author

@barbeau
I did this first categorization of notices, what do you think about that?

Also:

🚩Tests are broken for now. They will be fixed once we agree on the category of each notice.

@aababilov
Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
Member

@barbeau barbeau left a comment

Choose a reason for hiding this comment

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

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.

# Conflicts:
#	core/src/main/java/org/mobilitydata/gtfsvalidator/notice/NonAsciiOrNonPrintableCharNotice.java
#	main/src/main/java/org/mobilitydata/gtfsvalidator/notice/InconsistentAgencyTimezoneNotice.java
@lionel-nj
Copy link
Copy Markdown
Contributor Author

Thanks @barbeau just updated this PR. I will wait for @MobilityData/transit-specs to confirm the comments I left unresolved.

lionel-nj added 4 commits February 11, 2021 16:09
- change several notice severity level
- change several notice severity level
# Conflicts:
#	main/src/main/java/org/mobilitydata/gtfsvalidator/notice/OverlappingFrequencyNotice.java
@lionel-nj lionel-nj marked this pull request as ready for review February 17, 2021 08:15
@lionel-nj
Copy link
Copy Markdown
Contributor Author

@barbeau this PR is now ready for review. Thanks @timMillet !

@barbeau barbeau changed the title chore: identify each type of notice docs: identify each type of notice Feb 17, 2021
Copy link
Copy Markdown
Member

@barbeau barbeau left a comment

Choose a reason for hiding this comment

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

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

@barbeau
Copy link
Copy Markdown
Member

barbeau commented Feb 18, 2021

@lionel-nj Could you resolve the conflicts here, and change DuplicatedColumnNotice to ERROR?

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
@aababilov
Copy link
Copy Markdown
Collaborator

That is a big contribution, Lionel. Thank you!

I left some comments mostly based on the real production feeds.

/**
* A CSV file is empty.
*
* <p>Severity: {@code SeverityLevel.ERROR}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We treat it as an ERROR at Google but it probably may be a WARNING in the upstream.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

/**
* {@code agency.agency_lang} and {@code feed_info.feed_lang} do not match
*
* <p>Severity: {@code SeverityLevel.WARNING}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

New issue on this matter: #762

* `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}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be a WARNING. This does not make the feed non-functional.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we can safely call this an ERROR. The spec says do not.

from #726 (comment)

@lionel-nj lionel-nj changed the title docs: identify each type of notice chore: identify each type of notice Feb 19, 2021
@barbeau barbeau changed the title chore: identify each type of notice docs: Identify severity for each notice Feb 19, 2021
@barbeau barbeau changed the title docs: Identify severity for each notice docs: Define severity for each notice Feb 19, 2021
@barbeau barbeau merged commit b7de88b into master Feb 19, 2021
@barbeau barbeau deleted the categorize-notices branch February 19, 2021 17:22
@aababilov
Copy link
Copy Markdown
Collaborator

Hi @lionel-nj

Please can you remove FieldParsingError.java file that resurrected in this PR?

Thanks!

@lionel-nj
Copy link
Copy Markdown
Contributor Author

Sure @aababilov! It's done in #775

@lionel-nj lionel-nj mentioned this pull request Feb 26, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants