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

LT-21706: Modify webonary status reporting #187

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

jasonleenaylor
Copy link
Contributor

@jasonleenaylor jasonleenaylor commented Oct 23, 2024

image
image
image


This change is Reviewable

@jasonleenaylor jasonleenaylor force-pushed the feature/newWebonaryStatus branch 3 times, most recently from 9a2d253 to 5a6ce3c Compare October 28, 2024 19:07
@jasonleenaylor jasonleenaylor enabled auto-merge (squash) October 28, 2024 20:23
Copy link
Contributor

@JakeOliver28 JakeOliver28 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 13 files reviewed, 1 unresolved discussion (waiting on @jasonleenaylor)


Src/xWorks/UploadToWebonaryController.cs line 157 at r1 (raw file):

		{
			// if the file is an image file, check for a license file
			if (file.EndsWith(".jpg", StringComparison.InvariantCultureIgnoreCase) ||

Could we consolidate this?

Code snippet:

var imageExtensions = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase)
{
	".jpg", ".jpeg", ".gif", ".png"
};

if (imageExtensions.Contains(Path.GetExtension(file))
{
	
}

Copy link
Contributor Author

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 13 files reviewed, 1 unresolved discussion (waiting on @JakeOliver28)


Src/xWorks/UploadToWebonaryController.cs line 157 at r1 (raw file):

Previously, JakeOliver28 (Jake Oliver) wrote…

Could we consolidate this?

Done.

@jasonleenaylor jasonleenaylor force-pushed the feature/newWebonaryStatus branch from 8c87915 to 3765fda Compare October 28, 2024 21:43
{
SaveToModel();
// Set the status to the greater of the current or the new update
m_uploadStatus = (WebonaryStatusCondition)Enum.ToObject(typeof(WebonaryStatusCondition),

Choose a reason for hiding this comment

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

why the call Enum.ToObject instead of just casting the result of Math.Max directly to the enum? I can't see any functional difference

Copy link
Contributor

@JakeOliver28 JakeOliver28 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 13 files reviewed, 3 unresolved discussions (waiting on @hahn-kev and @jasonleenaylor)


Src/xWorks/WebonaryLogViewer.cs line 60 at r1 (raw file):

			{
				// Read and deserialize JSON from file
				foreach (var line in File.ReadLines(filePath))

Should we remove the if statement from inside the loop?

Code snippet:

var nonEmptyLines = File.ReadLines(filePath)
                         .Where(line => !string.IsNullOrWhiteSpace(line));

foreach (var line in nonEmptyLines)
{
    try
    {
        var entry = JsonConvert.DeserializeObject<UploadLogEntry>(line);
        _logEntries.Add(entry);
    }
    catch (JsonException ex)
    {
        Console.WriteLine($"Error deserializing line: {ex.Message}");
    }
}

Copy link
Contributor Author

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 13 files reviewed, 3 unresolved discussions (waiting on @hahn-kev and @JakeOliver28)


Src/xWorks/UploadToWebonaryDlg.cs line 331 at r2 (raw file):

Previously, hahn-kev (Kevin Hahn) wrote…

why the call Enum.ToObject instead of just casting the result of Math.Max directly to the enum? I can't see any functional difference

No good reason apparently.


Src/xWorks/WebonaryLogViewer.cs line 60 at r1 (raw file):

Previously, JakeOliver28 (Jake Oliver) wrote…

Should we remove the if statement from inside the loop?

Done.

@JakeOliver28
Copy link
Contributor

Reviewable status: 0 of 13 files reviewed, 3 unresolved discussions (waiting on @hahn-kev and @JakeOliver28)

Src/xWorks/UploadToWebonaryDlg.cs line 331 at r2 (raw file):

Previously, hahn-kev (Kevin Hahn) wrote…
No good reason apparently.

Src/xWorks/WebonaryLogViewer.cs line 60 at r1 (raw file):

Previously, JakeOliver28 (Jake Oliver) wrote…
Done.

Were this change and the other change committed?

@jasonleenaylor jasonleenaylor force-pushed the feature/newWebonaryStatus branch from 5e42bf4 to 9e8156e Compare October 30, 2024 17:42
@jasonleenaylor
Copy link
Contributor Author

Src/xWorks/WebonaryLogViewer.cs line 60 at r1 (raw file):

Previously, JakeOliver28 (Jake Oliver) wrote…

Were this change and the other change committed?

Hmm, apparently not. They are now! 👍

Copy link
Contributor

@JakeOliver28 JakeOliver28 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 13 files reviewed, 3 unresolved discussions (waiting on @hahn-kev)

* Also remove zip file upload code and tests - it is no longer usefull
@jasonleenaylor jasonleenaylor force-pushed the feature/newWebonaryStatus branch from fcc1839 to f4cdde6 Compare October 30, 2024 21:11
@jasonleenaylor jasonleenaylor merged commit f3354e9 into release/9.1 Oct 30, 2024
4 of 5 checks passed
@jasonleenaylor jasonleenaylor deleted the feature/newWebonaryStatus branch October 30, 2024 21:36
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.

3 participants