Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added serval release version to translation build #517

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

mudiagaobrikisil
Copy link
Collaborator

@mudiagaobrikisil mudiagaobrikisil commented Oct 18, 2024

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.69%. Comparing base (bdf43fa) to head (80682ba).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #517      +/-   ##
==========================================
+ Coverage   56.67%   56.69%   +0.01%     
==========================================
  Files         299      299              
  Lines       15626    15632       +6     
  Branches     2154     2155       +1     
==========================================
+ Hits         8856     8862       +6     
  Misses       6114     6114              
  Partials      656      656              

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

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

Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @mudiagaobrikisil)


src/Serval/src/Serval.ApiServer/ServalSettings.cs line 0 at r1 (raw file):
This looks like a duplicate class.


src/Serval/src/Serval.Shared/Configuration/ServalSettings.cs line 3 at r1 (raw file):

namespace Serval.Shared.Configuration;

public class ServalSettings

I don't think we need a separate class for this. We can just add the property to ApiOptions. Also, I would rename the property to ServalVersion.


src/Serval/src/Serval.Translation/Contracts/TranslationBuildDto.cs line 30 at r1 (raw file):

    /// </example>
    public object? Options { get; init; }
    public string? ServalReleaseVersion { get; init; }

I would name this ServalVersion.


src/Serval/src/Serval.Translation/Models/Build.cs line 18 at r1 (raw file):

    public DateTime? DateFinished { get; init; }
    public IReadOnlyDictionary<string, object>? Options { get; init; }
    public string? ServalReleaseVersion { get; set; }

I would just name this ServalVersion.


src/Serval/test/Serval.E2ETests/ServalApiTests.cs line 50 at r1 (raw file):

    [Test]
    public async Task GetServalReleaseVersion()

I don't think we need an E2E test for this. We could just add an extra check in the TranslationEngineTests.StartBuildForEngineByIdAsync integration test.

@mudiagaobrikisil
Copy link
Collaborator Author

mudiagaobrikisil commented Oct 18, 2024 via email

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

Reviewed 4 of 10 files at r2, 3 of 6 files at r3, 4 of 4 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mudiagaobrikisil)


src/Serval/src/Serval.Translation/Models/Build.cs line 18 at r4 (raw file):

    public DateTime? DateFinished { get; init; }
    public IReadOnlyDictionary<string, object>? Options { get; init; }
    public string? DeploymentVersion { get; set; } = "Unknown";

This doesn't need to have a default value. I would just make this { get; init; }.


src/Serval/test/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs line 2000 at r4 (raw file):

        private readonly IServiceScope _scope;
        private readonly MongoClient _mongoClient;
        public readonly IOptionsMonitor<ApiOptions> ApiOptions;

Is this still needed?

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

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mudiagaobrikisil)


src/Serval/test/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs line 2000 at r4 (raw file):

Previously, ddaspit (Damien Daspit) wrote…

Is this still needed?

You can remove these commented lines.

@johnml1135
Copy link
Collaborator

src/Serval/src/Serval.Translation/Controllers/TranslationEnginesController.cs line 1306 at r6 (raw file):

    private Build Map(Engine engine, TranslationBuildConfigDto source)
    {
        string deploymentVersion = configuration.GetValue<string>("DeploymentVersion") ?? "Unknown";

I think it is a little unclear pulling the Deployment version from within the map function. I would like to see it in the main controller function - either passing it as a parameter to the map function or adding to the Build it after it has been created.

@johnml1135
Copy link
Collaborator

src/Serval/test/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs line 1996 at r6 (raw file):

    }

    public class TestEnvironment : DisposableBase

Does this need to be public?

Copy link
Collaborator

@johnml1135 johnml1135 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 10 files at r1, 4 of 10 files at r2, 2 of 6 files at r3, 2 of 4 files at r4, 1 of 2 files at r5, 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @mudiagaobrikisil)


src/Serval/src/Serval.ApiServer/appsettings.json line 19 at r6 (raw file):

  },
  "ServalSettings": {
    "ReleaseVersion": "1.0.0"

This should be removed - we are using DeploymentVersion.

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

Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @mudiagaobrikisil)

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

Reviewed 3 of 3 files at r7, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @mudiagaobrikisil)


src/Serval/src/Serval.Translation/Controllers/TranslationEnginesController.cs line 12 at r7 (raw file):

    IPretranslationService pretranslationService,
    IOptionsMonitor<ApiOptions> apiOptions,
    IConfiguration configuration,

This should be assigned to a private readonly field.

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.

4 participants