Capture trace warnings from libpalaso verse and chapter parsing#867
Capture trace warnings from libpalaso verse and chapter parsing#867pmachapman wants to merge 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #867 +/- ##
==========================================
+ Coverage 66.57% 66.60% +0.02%
==========================================
Files 383 384 +1
Lines 20933 20948 +15
Branches 2720 2721 +1
==========================================
+ Hits 13937 13952 +15
Misses 6027 6027
Partials 969 969 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Enkidu93
left a comment
There was a problem hiding this comment.
Thank you, Peter!
I think you meant to link sillsdev/machine#372, not Serval 372.
I have two concerns about these warnings:
- If most of these are redundant (i.e., bad verse numbers), is it worth adding them at all? Is there a way we could filter them? If the only other category of error is bad chapter numbers, could we just extend the error detector to capture those?
- These warnings do not provide sufficient context for the developer or EITL team member to be able to find the problem. Is there a way we could inject more context?
My preference would be to extend the UsfmVersificationErrorDetector to flag bad chapter numbers (if possible) unless these traces include other types of errors that we could not easily detect. Maybe we can discuss this as a team in the meeting today and agree to a solution.
@Enkidu93 reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @pmachapman).
ddaspit
left a comment
There was a problem hiding this comment.
I took a quick look at the VerseRef code and it looks like the only trace warnings are for invalid chapter and verse numbers. An alternative to the trace listener is to check the ChapterNum or VerseNum values after creating the VerseRef. ChapterNum will be <= 0 if it is invalid and VerseNum will be < 0 if it is invalid. That seems like a less hacky way to capture these warnings.
@ddaspit made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @pmachapman).
Fixes sillsdev/machine#372
It seemed to make sense to implement this in Serval, rather than Machine as I couldn't see a clean way of maintaining the state of where the parser was to the TraceListener, without making the UsfmVersificationErrorDetector a bit more convoluted. The warnings (with the prefix in this PR) look like:
If you think this should be implemented in Machine not Serval, I will close this PR and reimplement there.
This change is