Skip to content

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

Merged
pmachapman merged 4 commits into
mainfrom
source_refs
May 27, 2026
Merged

Specify sourceRefs and targetRefs in JSON sent to machine.py#946
pmachapman merged 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 65.60%. Comparing base (f31527b) to head (bb8af8b).

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   64.64%   65.60%   +0.95%     
==========================================
  Files         381      381              
  Lines       21694    21705      +11     
  Branches     2765     2766       +1     
==========================================
+ Hits        14024    14239     +215     
+ Misses       6645     6433     -212     
- Partials     1025     1033       +8     

☔ 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).

@pmachapman pmachapman force-pushed the source_refs branch 2 times, most recently from 0c252e5 to 096c522 Compare May 20, 2026 20:00
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).

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.

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


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

Previously, Enkidu93 (Eli C. Lowry) wrote…

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!

Done. No problem - I've removed this commit.

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.

Sorry for the delay approving this - I lost track that it was waiting on me.

:lgtm:

Thank you, Peter!

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


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

Previously, pmachapman (Peter Chapman) wrote…

Done. No problem - I've removed this commit.

Great! Thank you.

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 3 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on pmachapman).

@pmachapman pmachapman merged commit dc1b0db into main May 27, 2026
1 of 2 checks passed
@pmachapman pmachapman deleted the source_refs branch May 27, 2026 20:19
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