-
Notifications
You must be signed in to change notification settings - Fork 735
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
Fix issues related to introduction of new values in GHEvent #1159
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1159 +/- ##
============================================
+ Coverage 73.44% 73.47% +0.02%
- Complexity 1834 1839 +5
============================================
Files 185 185
Lines 6146 6148 +2
Branches 367 367
============================================
+ Hits 4514 4517 +3
+ Misses 1411 1410 -1
Partials 221 221
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case sensitivity is intentional. The values coming from GitHub are Pascal-cased and I want to match them specifically or not at all.
Please just add the new events in this PR.
Mkay. My big concern is that we have two nearly identical methods and the nullable behavior should be the only difference between the two. I don't mind how we fix it but I think we need to make the methods consistent in one way or another. I will remove this commit from the PR. |
@gsmet I think the reason I chose to do it that way was to match the exiting method's behavior (which was case-sensitive). The events area is not well tested, so I would like to err on the side of caution. Perhaps not it as an issue and link to 38460dc and we can come back to it? |
OK, I removed this commit and did the case change at the call sites. |
Is there anything I can do to help get this merged? |
I like this change, can this merge? |
We took a change that added an enum that was used purely for mapping from EventInfo.type to GHEvent. This seemed fine but that enum is used only by EventInfo. This change removed that enum and adds a map to EventInfo to do the required mapping. This avoids shoehorning mapping behavior in to the EnumUtils.
faf6e18
to
c00d562
Compare
@bitwiseman I decided to apply the same strategy we used for other things: use Strings for serialization/deserialization and only switch to enums for APIs. It's a bit less optimal but less risky. Another better option would be to have custom Jackson deserializer but that's probably something we need to keep for 2.0.
I also fixed an inconsistency in
EnumUtils
: one method was user uppercase values and not the other. This is a recipe for disaster.Better reviewed commit per commit as I kept them semantic.
I'm not exactly sure if it's worth adding tests as we would have to add tests with unknown values for each enum all over the place.
Fixes #1156