Skip to content

Specify sourceRefs and targetRefs in JSON sent to machine.py#946

Open
pmachapman wants to merge 4 commits into
mainfrom
source_refs
Open

Specify sourceRefs and targetRefs in JSON sent to machine.py#946
pmachapman wants to merge 4 commits into
mainfrom
source_refs

Conversation

@pmachapman
Copy link
Copy Markdown
Collaborator

@pmachapman pmachapman commented May 14, 2026

Fixes #940.

Requires sillsdev/machine.py#297.


This change is Reviewable

@pmachapman pmachapman requested review from Enkidu93 and ddaspit May 14, 2026 02:31
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 14, 2026

Codecov Report

❌ Patch coverage is 51.42857% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.62%. Comparing base (a010758) to head (6e5ab4d).

Files with missing lines Patch % Lines
...rc/Echo/src/EchoEngine/TranslationEngineService.cs 0.00% 7 Missing ⚠️
...e.Shared/Services/TranslationPreprocessBuildJob.cs 0.00% 5 Missing ⚠️
...Shared/Services/WordAlignmentPreprocessBuildJob.cs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #946      +/-   ##
==========================================
+ Coverage   66.69%   67.62%   +0.92%     
==========================================
  Files         381      381              
  Lines       21736    21747      +11     
  Branches     2773     2774       +1     
==========================================
+ Hits        14497    14706     +209     
+ Misses       6203     5999     -204     
- Partials     1036     1042       +6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

:lgtm:

I can't believe I missed this 😵. Thank you, Peter! Sorry about all this!

@Enkidu93 reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on ddaspit).

@Enkidu93
Copy link
Copy Markdown
Collaborator

src/Machine/src/Serval.Machine.Shared/Services/WordAlignmentPreprocessBuildJob.cs line 86 at r1 (raw file):

                    wordAlignmentWriter.WriteString("textId", row.TextId);
                    wordAlignmentWriter.WriteStartArray("sourceRefs");
                    foreach (object rowRef in row.TargetRefs)

Do you mean row.SourceRefs? Or is Reviewable's diff just throwing my eye?

Copy link
Copy Markdown
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

@ddaspit, we were previously testing this code here: https://github.com/sillsdev/serval/blob/fc1bffdfe797abd94f0ffe1df0635e572b58e975/src/Machine/test/Serval.Machine.Shared.Tests/Consumers/TranslationInsertPretranslationsConsumerTests.cs. Is there some equivalent place in the new monolith tests that it should be tested?

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

Copy link
Copy Markdown
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

This code now lives in ServalTranslationPlatformService. We should add a new test fixture for the class that tests the InsertInferenceResultsAsync method.

@ddaspit reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on pmachapman).

Copy link
Copy Markdown
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.

This code now lives in ServalTranslationPlatformService. We should add a new test fixture for the class that tests the InsertInferenceResultsAsync method.

I have ported the tests, and done some related clean up the tests exposed.

@pmachapman made 2 comments and resolved 1 discussion.
Reviewable status: 1 of 17 files reviewed, all discussions resolved (waiting on ddaspit and Enkidu93).


src/Machine/src/Serval.Machine.Shared/Services/WordAlignmentPreprocessBuildJob.cs line 86 at r1 (raw file):

Previously, Enkidu93 (Eli C. Lowry) wrote…

Do you mean row.SourceRefs? Or is Reviewable's diff just throwing my eye?

Done. Oh dear sorry about that.

@pmachapman pmachapman requested review from Enkidu93 and ddaspit May 20, 2026 23:54
Copy link
Copy Markdown
Collaborator

@Enkidu93 Enkidu93 left a comment

Choose a reason for hiding this comment

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

@Enkidu93 reviewed 16 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ddaspit and pmachapman).


src/Machine/src/Serval.Machine.Shared/Services/WordAlignmentPreprocessBuildJob.cs line 86 at r1 (raw file):

Previously, pmachapman (Peter Chapman) wrote…

Done. Oh dear sorry about that.

No worries. Glad we caught it now!


deploy/values.yaml line 12 at r2 (raw file):

lokiUrl: http://loki-distributed-gateway.loki.svc.cluster.local
servalImage: ghcr.io/sillsdev/serval:1.17.0
ClearMLDockerImage: ghcr.io/sillsdev/machine.py:1.13.0

For these yamls, typically, I've only updated them once that environment is live with that particular version (although a little less picky with int-qa). That forces me to make sure the Serval and machine.py versions match before releasing. I also figure it's a way to keep track of where we are in the release process from a repo perspective. In particular, when I'm moving from QA to prod, it makes it easy because I can rely on what it is in the QA yamls. I'm happy to change this process though if you think it'd be easier to update them along the way!

Copy link
Copy Markdown
Contributor

@ddaspit ddaspit left a comment

Choose a reason for hiding this comment

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

@ddaspit reviewed 16 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on pmachapman).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SourceRefs are not being specified for NMT pre-translations

4 participants