-
Notifications
You must be signed in to change notification settings - Fork 471
[glean] 1535083: Use enums as extra keys on events #2403
Conversation
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.
LGTM! Let's merge this after tests have passed (pending the glean_parsers thing)
// a template parameter). | ||
if (it.size > 0) { | ||
val cls = it.keys.first().javaClass | ||
val method = cls.getDeclaredMethod("getValue") |
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.
Eugh, I hoped we could make it without it. But we can't :) No problem!
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.
LGTM, although I wish there was a way to avoid reflection.
Codecov Report
@@ Coverage Diff @@
## master #2403 +/- ##
============================================
- Coverage 83.74% 83.58% -0.16%
+ Complexity 2729 2672 -57
============================================
Files 334 325 -9
Lines 11355 11216 -139
Branches 1658 1637 -21
============================================
- Hits 9509 9375 -134
- Misses 1163 1166 +3
+ Partials 683 675 -8
Continue to review full report at Codecov.
|
This uses enums for the extra keys on events so they are checked at build time rather than run time.
This won't pass CI until mozilla/glean_parser#44 is merged and this PR is updated to use that.
Pull Request checklist