machine icon indicating copy to clipboard operation
machine copied to clipboard

Better USFM parsing error visibility

Open johnml1135 opened this issue 1 year ago • 2 comments

https://github.com/sillsdev/serval/issues/388


This change is Reviewable

johnml1135 avatar May 14 '24 12:05 johnml1135

Codecov Report

Attention: Patch coverage is 60.97561% with 48 lines in your changes are missing coverage. Please review.

Project coverage is 67.19%. Comparing base (f4b27e5) to head (77d072e).

Files Patch % Lines
src/SIL.Machine/Corpora/UsfmParser.cs 14.28% 18 Missing :warning:
src/SIL.Machine/Corpora/UsfmParserException.cs 0.00% 10 Missing :warning:
...chine.AspNetCore/Services/NmtPreprocessBuildJob.cs 87.30% 6 Missing and 2 partials :warning:
src/SIL.Machine/Corpora/UsfmFileText.cs 40.00% 6 Missing :warning:
src/SIL.Machine/Corpora/UsfmZipText.cs 40.00% 6 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #199      +/-   ##
==========================================
- Coverage   67.25%   67.19%   -0.06%     
==========================================
  Files         441      442       +1     
  Lines       34940    35009      +69     
  Branches     4686     4691       +5     
==========================================
+ Hits        23498    23524      +26     
- Misses      10356    10399      +43     
  Partials     1086     1086              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar May 14 '24 12:05 codecov-commenter

We also have a request to add which corpus it's from.

johnml1135 avatar May 14 '24 21:05 johnml1135

src/SIL.Machine/Corpora/UsfmFileText.cs line 43 at r5 (raw file):

                    .SetValue(e, $"{_fileName}: {e.Message}");
                throw e;
            }

@ddaspit - what do you think about spitting out the filename like this?

johnml1135 avatar May 20 '24 18:05 johnml1135

I don't think it is necessary to output the filename. The verse ref should be sufficient to tell you what file in a project is having the issue.

ddaspit avatar May 20 '24 18:05 ddaspit

But if there are two sources and one target scripture, they don't know which one to look at. The ID of the paratext zip file should tell them more.

johnml1135 avatar May 21 '24 11:05 johnml1135

That is a good point. I will look at adding that. We might need to update the gRPC API to pass the file id.

ddaspit avatar May 21 '24 16:05 ddaspit

There's been a lot of churn on this PR, so I submitted a separate PR that throws an exception with all of the information we need. I'm going to close this PR.

ddaspit avatar May 21 '24 22:05 ddaspit