Repository navigation
Gracefully handle nullable fields in TransitAlert - #5349
Merged
leonardehrenfried merged 10 commits intoSep 13, 2023
Merged
leonardehrenfried merged 10 commits into
leonardehrenfried merged 10 commits into
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5349 +/- ##
=============================================
+ Coverage 66.37% 66.44% +0.07%
- Complexity 15184 15211 +27
=============================================
Files 1787 1786 -1
Lines 69263 69236 -27
Branches 7339 7311 -28
=============================================
+ Hits 45974 46005 +31
+ Misses 20804 20751 -53
+ Partials 2485 2480 -5
☔ View full report in Codecov by Sentry. |
leonardehrenfried
force-pushed
the
nullable-alert-fields
branch
from
September 11, 2023 15:58
afccc99 to
56e938e
Compare
jtorin
previously approved these changes
Sep 12, 2023
optionsome
previously approved these changes
Sep 12, 2023
Comment on lines
+7
to
+16
| # these translations are a bit questionable, the above fields are already translated into the | ||
| # language selected in the request | ||
| alertDescriptionTextTranslations { | ||
| language | ||
| text | ||
| } | ||
| alertHeaderTextTranslations { | ||
| text | ||
| language | ||
| } |
Member
There was a problem hiding this comment.
I think we should deprecate these at some point and add lang parameter to the fields
leonardehrenfried
enabled auto-merge
September 12, 2023 15:26
Member
Author
|
@optionsome @jtorin Sorry for the repeated reviews - I noticed that I returned null where I should have returned the empty list. I also made the test more realistic. |
jtorin
previously approved these changes
Sep 13, 2023
…sx/PtSituationElementType.java Co-authored-by: Johan Torin <jtorin@users.noreply.github.com>
jtorin
previously approved these changes
Sep 13, 2023
leonardehrenfried
disabled auto-merge
September 13, 2023 09:06
leonardehrenfried
enabled auto-merge
September 13, 2023 10:25
jtorin
approved these changes
Sep 13, 2023
optionsome
approved these changes
Sep 13, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The return value of
TransitAlert#descriptionTextwas producing NPE's in the GTFS GraphQL API so I made it andurlreturn an explicitOptionalso that call sites are forced to deal with this fact.Since the API schema requires
descriptionTextto be non-null (which isn't the case for the GTFS-RT spec) I used some fallback logic so that it always returns a string.If we don't want the fallback logic we will have to modify the schema. Let's discuss this at the dev meeting.
Unit tests
Test added.