Skip to content

Avoid false 'multiple versifications' warnings - #1051

Merged
Enkidu93 merged 10 commits into
mainfrom
fix-multiple-versification-diagnostic
Oct 5, 2026
Merged

Enkidu93 merged 10 commits into
mainfrom
fix-multiple-versification-diagnostic

Conversation

@Enkidu93

@Enkidu93 Enkidu93 commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Requires sillsdev/machine#525.

Fixes #1043.


This change is Reviewable

@Enkidu93
Enkidu93 requested a review from pmachapman September 29, 2026 21:16

@pmachapman pmachapman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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


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

                        new Dictionary<string, object> { { "projectVersifications", projectVersifications } }
                    )
                );

Will this store the entire ScrVers objects in the diagnostics, which are written to Mongo? I think this should be:

diagnostics.Add(
	BuildDiagnosticService.CreateDiagnostic(
		"CONFIG-0002",
		new Dictionary<string, object>
		{
			{
				"projectVersifications",
				projectVersifications.ToDictionary(v => v.Key, v => v.Value.Name)
			},
		}
	)
);

Code quote:

                diagnostics.Add(
                    BuildDiagnosticService.CreateDiagnostic(
                        "CONFIG-0002",
                        new Dictionary<string, object> { { "projectVersifications", projectVersifications } }
                    )
                );

src/Machine/test/Serval.Machine.Translation.Tests/Services/PreprocessBuildJobTests.cs line 102 at r1 (raw file):

                    "pt-target1",
                    "1111",
                    ScrVers.Original,

This should be ScrVers.English (RunAsync_BuildWarnings fails)

Code quote:

ScrVers.Original,

@Enkidu93 Enkidu93 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@Enkidu93 made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on pmachapman).


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

Previously, pmachapman (Peter Chapman) wrote…

Will this store the entire ScrVers objects in the diagnostics, which are written to Mongo? I think this should be:

diagnostics.Add(
	BuildDiagnosticService.CreateDiagnostic(
		"CONFIG-0002",
		new Dictionary<string, object>
		{
			{
				"projectVersifications",
				projectVersifications.ToDictionary(v => v.Key, v => v.Value.Name)
			},
		}
	)
);

Done.


src/Machine/test/Serval.Machine.Translation.Tests/Services/PreprocessBuildJobTests.cs line 102 at r1 (raw file):

Previously, pmachapman (Peter Chapman) wrote…

This should be ScrVers.English (RunAsync_BuildWarnings fails)

Yes, sorry. Done.

@codecov-commenter

codecov-commenter commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.83%. Comparing base (1876794) to head (2f8a700).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1051      +/-   ##
==========================================
+ Coverage   72.82%   72.83%   +0.01%     
==========================================
  Files         391      391              
  Lines       21735    21745      +10     
  Branches     2824     2826       +2     
==========================================
+ Hits        15828    15838      +10     
  Misses       4785     4785              
  Partials     1122     1122              

☔ View full report in Codecov by Harness.
📢 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.

@pmachapman pmachapman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

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

@ddaspit ddaspit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be good to add a unit test that covers this issue.

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


src/Machine/src/Serval.Machine.Shared/Services/PreprocessBuildJob.cs line 309 at r2 (raw file):

        ScrVers? previousVersification = null;
        foreach (ScrVers versification in projectVersifications.Values)

Nit: The loop adds a diagnostic for every adjacent pair that is not equivalent, so it can emit more than one. For example, three projects using English, Original and English would produce two identical diagnostics. Would it be possible to compare each versification to the first one and add a single diagnostic if any of them are not equivalent?

@Enkidu93
Enkidu93 force-pushed the fix-multiple-versification-diagnostic branch from 8978ea4 to 89f5637 Compare September 30, 2026 19:08

@Enkidu93 Enkidu93 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

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


src/Machine/src/Serval.Machine.Shared/Services/PreprocessBuildJob.cs line 309 at r2 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

Nit: The loop adds a diagnostic for every adjacent pair that is not equivalent, so it can emit more than one. For example, three projects using English, Original and English would produce two identical diagnostics. Would it be possible to compare each versification to the first one and add a single diagnostic if any of them are not equivalent?

Done.

@ddaspit ddaspit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:lgtm:

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

@Enkidu93
Enkidu93 force-pushed the fix-multiple-versification-diagnostic branch from 89f5637 to a5ee275 Compare October 1, 2026 14:25

@ddaspit ddaspit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@Enkidu93
Enkidu93 force-pushed the fix-multiple-versification-diagnostic branch from 637b4f5 to c210fc0 Compare October 5, 2026 22:11
@Enkidu93
Enkidu93 merged commit c467e51 into main Oct 5, 2026
1 of 2 checks passed
@Enkidu93
Enkidu93 deleted the fix-multiple-versification-diagnostic branch October 5, 2026 22:28
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.

Versifications may be the same even when they have different names

4 participants