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

Renamed project to SIL.Windows.Forms.Archiving #1317

Merged
merged 19 commits into from
Aug 15, 2024

Conversation

josephmyers
Copy link
Collaborator

@josephmyers josephmyers commented Apr 25, 2024

This change is Reviewable

To align with all other WinForms projects
@josephmyers josephmyers marked this pull request as ready for review April 25, 2024 08:49
Copy link
Contributor

@tombogle tombogle 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 68 files at r1, all commit messages.
Reviewable status: 1 of 68 files reviewed, 1 unresolved discussion (waiting on @josephmyers)


Palaso.sln line 30 at r1 (raw file):

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SIL.Windows.Forms.Archiving", "SIL.Windows.Forms.Archiving\SIL.Windows.Forms.Archiving.csproj", "{BCE1F124-5479-4B23-90B1-B7A4EBE44FA3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SIL.Windows.Forms.Archiving.Tests", "SIL.Windows.Forms.Archiving.Tests\SIL.Windows.Forms.Archiving.Tests.csproj", "{892C7F20-FBBB-4AB3-BAC2-E40A135567B6}"

Now I'm wondering if we should actually be trying to split this stuff into Forms vs. non-Forms DLLs. None of the unit tests depend on WinForms, so all the classes they are testing could be in a non-Forms dependent DLL. I'm not sure if they do anything useful enough on their own to warrant this though.

@tombogle
Copy link
Contributor

Palaso.sln line 30 at r1 (raw file):

Previously, tombogle (Tom Bogle) wrote…

Now I'm wondering if we should actually be trying to split this stuff into Forms vs. non-Forms DLLs. None of the unit tests depend on WinForms, so all the classes they are testing could be in a non-Forms dependent DLL. I'm not sure if they do anything useful enough on their own to warrant this though.

Looking at the code, the ArchivingDlg classes (abstract base and two concrete implementations) are the only things that really need to depend on WinForms. The models do, but only minimally and in a way they really shouldn't. If we were to fix those design issues, then those models could be used to back a non WinForms implementation.

Copy link
Contributor

@megahirt megahirt left a comment

Choose a reason for hiding this comment

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

The changelog should not be included in the find/replace and there should also be a line for this rename in the changelog. Thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@megahirt megahirt left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @josephmyers

Copy link
Contributor

@megahirt megahirt left a comment

Choose a reason for hiding this comment

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

Reviewed 67 of 68 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @josephmyers)

@josephmyers
Copy link
Collaborator Author

@tombogle, any chance we'll see progress here this week or next?

@josephmyers josephmyers self-assigned this May 10, 2024
@tombogle
Copy link
Contributor

Not sure when I'll be able to get to this.

@josephmyers josephmyers linked an issue May 20, 2024 that may be closed by this pull request
8 tasks
@josephmyers
Copy link
Collaborator Author

I discovered today that SIL.Media is a WinForms project. So a bit more to come on this

@megahirt
Copy link
Contributor

I discovered today that SIL.Media is a WinForms project. So a bit more to come on this

@josephmyers we can rename SIL.Media in a separate PR.

Copy link
Contributor

@megahirt megahirt 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: all files reviewed, 1 unresolved discussion (waiting on @josephmyers)

Copy link
Contributor

@megahirt megahirt 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: all files reviewed, 1 unresolved discussion (waiting on @josephmyers and @tombogle)


Palaso.sln line 30 at r1 (raw file):

Previously, tombogle (Tom Bogle) wrote…

Looking at the code, the ArchivingDlg classes (abstract base and two concrete implementations) are the only things that really need to depend on WinForms. The models do, but only minimally and in a way they really shouldn't. If we were to fix those design issues, then those models could be used to back a non WinForms implementation.

@tombogle how about we just leave this PR as a simple rename and if you'd like to circle back on a refactor that you can do that in a separate PR? I'd like to get this merged.

@josephmyers
Copy link
Collaborator Author

I discovered today that SIL.Media is a WinForms project. So a bit more to come on this

@josephmyers we can rename SIL.Media in a separate PR.

#1325

@tombogle
Copy link
Contributor

I'm doing some fixing in this area currently, so this might actually be a good time for me to try to break it into two parts. Give me a couple days, and if I can't, then we'll go ahead and merge as is.

This helps clarify some unexpected behavior in SayMore tests.
…SIL.Core

Added optional parameter to OlacSystem.GetRoles to allow caller to provide its own XML
@tombogle tombogle force-pushed the sil.windows.forms.archiving branch from 155148d to b3b018a Compare July 17, 2024 15:59
…ndows.Forms.Archiving

Included significant refactoring and replacing clunky cancellation of background process (which required calls to Application.DoEvents) with a proper async approach.
# Conflicts:
#	SIL.Media.Tests/SIL.Media.Tests.csproj
Copy link

github-actions bot commented Aug 1, 2024

LibPalaso Tests

   17 files  ±0     17 suites  ±0   9m 34s ⏱️ - 2m 50s
4 890 tests +6  4 659 ✅ +6  231 💤 ±0  0 ❌ ±0 
4 909 runs  +6  4 665 ✅ +6  244 💤 ±0  0 ❌ ±0 

Results for commit 67b1ecd. ± Comparison against base commit d85edaa.

This pull request removes 54 and adds 60 tests. Note that renamed tests count towards both.
SIL.Archiving.Tests.RampArchivingDlgViewModelTests ‑ GetMode_FwbackupFileWithMultipleTypesInList_ReturnsCorrectMetsList
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_AllSame_ReturnsTrue
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_DatesDifferent_ReturnsFalse
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_LicensesDifferent_ReturnsFalse
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_NamesDifferent_ReturnsFalse
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_NotesDifferent_ReturnsFalse
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_OtherIsNull_ReturnsFalse
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_RolesDifferent_ReturnsFalse
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ Clone_ReturnsDifferentNonNullObject
SIL.Windows.Forms.Tests.ClearShare.ContributionTests ‑ Clone_ReturnsSameContent
…
SIL.Archiving.Tests.ArchivingLanguageTests ‑ Compare_DifferentCodeOrLanguageName_ReturnsNonZero("eng","English","frg","Froggish")
SIL.Archiving.Tests.ArchivingLanguageTests ‑ Compare_DifferentCodeOrLanguageName_ReturnsNonZero("som","Some Language","unk","Some Language")
SIL.Archiving.Tests.ArchivingLanguageTests ‑ Compare_DifferentCodeOrLanguageName_ReturnsNonZero("zzz","Zyzzyvian","zzz","Scrabbilian")
SIL.Archiving.Tests.ArchivingLanguageTests ‑ Compare_SameCodeAndLanguageName_ReturnsZero
SIL.Archiving.Tests.LanguageListTests ‑ FindByEnglishName_ExistingLanguage_GetsExpectedNameCodeAndId("English","eng")
SIL.Archiving.Tests.LanguageListTests ‑ FindByISO3Code_ExistingLanguageWithNoOtherName_GetsExpectedNameCodeAndId("eng","English")
SIL.Archiving.Tests.RampArchivingDlgViewModelTests ‑ GetMode_FwBackupFileWithMultipleTypesInList_ReturnsCorrectMetsList
SIL.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_AllSame_ReturnsTrue
SIL.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_DatesDifferent_ReturnsFalse
SIL.Tests.ClearShare.ContributionTests ‑ AreContentsEqual_LicensesDifferent_ReturnsFalse
…

♻️ This comment has been updated with latest results.

…ves.

Improved documentation and did code cleanup for some of the IMDI stuff. Closed some loopholes to make it easier for clients to create valid packages
@tombogle tombogle closed this Aug 5, 2024
@tombogle tombogle reopened this Aug 5, 2024
@tombogle
Copy link
Contributor

tombogle commented Aug 5, 2024

I have completed my work on splitting this into two DLLs. Ready for review.

Copy link
Contributor

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

there's some issues with how async works at the moment, but it looks good otherwise.

ArchivingTestApp/ArchivingTestApp.csproj Outdated Show resolved Hide resolved
SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs Outdated Show resolved Hide resolved
SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs Outdated Show resolved Hide resolved
SIL.Archiving/RampArchivingDlgViewModel.cs Outdated Show resolved Hide resolved
SIL.Archiving/RampArchivingDlgViewModel.cs Outdated Show resolved Hide resolved
SIL.Archiving/RampArchivingDlgViewModel.cs Outdated Show resolved Hide resolved
SIL.Core/ClearShare/OlacSystem.cs Outdated Show resolved Hide resolved
SIL.Core/ClearShare/OlacSystem.cs Outdated Show resolved Hide resolved
@tombogle
Copy link
Contributor

tombogle commented Aug 6, 2024

Palaso.sln line 30 at r1 (raw file):

Previously, megahirt (Christopher Hirt) wrote…

@tombogle how about we just leave this PR as a simple rename and if you'd like to circle back on a refactor that you can do that in a separate PR? I'd like to get this merged.

No longer relevant

@tombogle
Copy link
Contributor

tombogle commented Aug 6, 2024

What sort of issues?

@tombogle
Copy link
Contributor

tombogle commented Aug 6, 2024

Never mind. I see there are some github comments that Reviewable knows nothing about.

Changed OlacSystem.GetRoles to report a non-fatal exception if the custom XML file cannot be loaded.
Removed ArchivingPackage and AddSession from ArchivingDlgViewModel and RampArchivingDlgViewModel
Copy link
Contributor

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

Looks good, I agree _imdiData.CreateIMDIPackage() in IMDI view model should also be awaited, nice catch.

SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

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

Looks good to me. I'll leave it up to you @tombogle how you handle the conversation on IMDIArchivingDlgViewModel.cs

@josephmyers josephmyers removed a link to an issue Aug 15, 2024
8 tasks
Copy link
Contributor

@hahn-kev hahn-kev 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 73 files at r1, 102 of 119 files at r3, 7 of 22 files at r4, 5 of 6 files at r5, 4 of 8 files at r6, 1 of 1 files at r7, 2 of 2 files at r8, 4 of 4 files at r11, 2 of 2 files at r12, all commit messages.
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @josephmyers and @megahirt)

Copy link
Contributor

@tombogle tombogle left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @hahn-kev, @josephmyers, and @megahirt)


SIL.Archiving/IMDI/IMDIArchivingDlgViewModel.cs line 189 at r7 (raw file):

Previously, tombogle (Tom Bogle) wrote…

In reality, most of this stuff is pretty fast on modern hardware, so unless you have a lot of files or some really big files, it's probably going to finish before you've had much of a chance to think about canceling.

I went ahead and made CreateIMDIPackage take a cancellation token and return Task, so now it checks the cancellation state before each IO call. Technically it's still synchronous

Copy link
Contributor

@tombogle tombogle 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: all files reviewed, 10 unresolved discussions (waiting on @hahn-kev and @josephmyers)

@tombogle tombogle merged commit fad4b64 into master Aug 15, 2024
3 of 4 checks passed
@tombogle tombogle deleted the sil.windows.forms.archiving branch August 15, 2024 12:38
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