Skip to content

Conversation

@pmachapman
Copy link
Collaborator

@pmachapman pmachapman commented Jan 5, 2026

This PR:

  • Fixes a bug where trainingScriptureRanges and translationScriptureRanges were empty when retrieving builds from some endpoints, such as get last pre-translated build, and get all builds.
  • Fixes a bug where drafts were not being downloaded in their entirety when the book did not have all chapters configured in Scripture Forge

This change is Reviewable

@pmachapman pmachapman added the will require testing PR should not be merged until testers confirm testing is complete label Jan 5, 2026
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 97.11538% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.82%. Comparing base (dd2b2cb) to head (2059e82).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...SIL.XForge.Scripture/Services/MachineApiService.cs 97.11% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3620   +/-   ##
=======================================
  Coverage   82.82%   82.82%           
=======================================
  Files         610      610           
  Lines       37414    37420    +6     
  Branches     6152     6151    -1     
=======================================
+ Hits        30987    30992    +5     
+ Misses       5494     5481   -13     
- Partials      933      947   +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RaymondLuong3 RaymondLuong3 self-assigned this Jan 5, 2026
@RaymondLuong3 RaymondLuong3 changed the title Fix empty translationScriptureRanges for last completed build SF-3666 Fix empty translationScriptureRanges for last completed build Jan 5, 2026
Copy link
Collaborator

@RaymondLuong3 RaymondLuong3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me. Let's get this to testers.

@RaymondLuong3 reviewed 2 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @pmachapman).


src/SIL.XForge.Scripture/Services/MachineApiService.cs line 2574 at r1 (raw file):

        // Add the training scripture ranges
        if (buildDto.AdditionalInfo.TrainingScriptureRanges.Count == 0)

So this looks like it was the issue and we should not have been clearing and setting the Scripture ranges to the value stored on the project if it had previously been set via the event metrics. Did I read that correctly?

Code quote:

 if (buildDto.AdditionalInfo.TrainingScriptureRanges.Count == 0)

src/SIL.XForge.Scripture/Services/MachineApiService.cs line 2740 at r1 (raw file):

    /// <param name="preTranslate">If <c>true</c>, return NMT builds only; otherwise, return SMT builds.</param>
    /// <returns>The Serval build DTO.</returns>
    private async Task<ServalBuildDto> MapDtoAsync(

This makes a lot of sense to have this as a method on its own. Thanks for cleaning up the instances where the build DTO is retrieved and modified.

Code quote:

private async Task<ServalBuildDto> MapDtoAsync(

@RaymondLuong3 RaymondLuong3 added ready to test and removed will require testing PR should not be merged until testers confirm testing is complete labels Jan 5, 2026
Copy link
Collaborator Author

@pmachapman pmachapman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pmachapman made 1 comment and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @RaymondLuong3).


src/SIL.XForge.Scripture/Services/MachineApiService.cs line 2574 at r1 (raw file):

Previously, RaymondLuong3 (Raymond Luong) wrote…

So this looks like it was the issue and we should not have been clearing and setting the Scripture ranges to the value stored on the project if it had previously been set via the event metrics. Did I read that correctly?

Perhaps? I do remember you mentioning these values being wrong, and with this PR they should be now correct.

@pmachapman pmachapman added testing complete Testing of PR is complete and should no longer hold up merging of the PR and removed ready to test labels Jan 7, 2026
@pmachapman pmachapman merged commit db24607 into master Jan 7, 2026
37 of 38 checks passed
@pmachapman pmachapman deleted the fix/SF-3666 branch January 7, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing complete Testing of PR is complete and should no longer hold up merging of the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants