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

Allow Games to define arbitrary GameFolderTypes (game path Ids) #656

Merged
merged 34 commits into from
Sep 21, 2023

Conversation

Al12rs
Copy link
Contributor

@Al12rs Al12rs commented Sep 20, 2023

fixes #492

TODO:

  • Change GameFolderType to ValueObject
    • Fix Serialization/deserialization
  • Add a LocationsManager
    • Detect nested locations and allow easy query
    • Properly initialize LocationsManager on setup
    • Add XML doc comments
    • Add Tests
  • Update AGame.GetLocations() to return dictionary to ensure unique GameFolderTypes
  • [ ] How to handle nested GamePaths moved to Properly support Game Locations with same or nested AbsolutePaths  #658
  • Fix tests (They work locally on both Linux and Windows)
  • Remove IGameLocator parameter from AGame.GetLocations()
  • Handle Location Ids that point to the same path ? Added to Properly support Game Locations with same or nested AbsolutePaths  #658 as well.
  • Rename GameFolderType to either LocationId
  • Investigate why CI is failing (CI was choking on the implicit conversion of paramerters to LocationId in the [Theory] tests)
@Al12rs Al12rs self-assigned this Sep 20, 2023
@Al12rs Al12rs marked this pull request as ready for review September 21, 2023 11:04
@Al12rs
Copy link
Contributor Author

Al12rs commented Sep 21, 2023

Removed draft to let tests run

@Al12rs
Copy link
Contributor Author

Al12rs commented Sep 21, 2023

Tests are failing strangely in the Advanced Installer project, but I can't reproduce locally. Any clues what is happening there?

as it is never used and shouldn't offer anything useful
Copy link
Member

@Sewer56 Sewer56 left a comment

Choose a reason for hiding this comment

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

After latest commit (f445583) , seems good to merge

@Sewer56
Copy link
Member

Sewer56 commented Sep 21, 2023

Tests are failing strangely in the Advanced Installer project, but I can't reproduce locally. Any clues what is happening there?

No idea, but no issues on Linux locally either.

The code in this PR shouldn't affect current Advanced Installer code on Main branch (only Suggestions/Common Folders, which is a future PR). Advanced Installer code doesn't have anything special; no shared, state, concurrency, etc. so if it failed, that would have been weird.

@Sewer56
Copy link
Member

Sewer56 commented Sep 21, 2023

CI failure seems to be caused by a lot of:

2023-09-21T13:05:45.1337779Z [xUnit.net 00:00:01.20] Catastrophic failure: System.ArgumentException : There is at least one object in this array that cannot be serialized (Parameter 'array')
2023-09-21T13:05:45.1344628Z [xUnit.net 00:00:01.20]     [FATAL ERROR] System.ArgumentException
2023-09-21T13:05:45.1408381Z [xUnit.net 00:00:01.21]       System.ArgumentException : There is at least one object in this array that cannot be serialized (Parameter 'array')
2023-09-21T13:05:45.1412170Z [xUnit.net 00:00:01.21]       Stack Trace:
2023-09-21T13:05:45.1416019Z [xUnit.net 00:00:01.21]         /_/src/xunit.runner.utility/Extensions/MessageSinkMessageExtensions.cs(39,0): at MessageSinkMessageExtensions.Dispatch[TMessage](IMessageSinkMessage message, HashSet`1 messageTypes, MessageHandler`1 callback)

Something fails to log in CI, unclear if caused by chances to main, or changes to branch.

Not related to AdvancedInstaller

@Sewer56
Copy link
Member

Sewer56 commented Sep 21, 2023

I can't repro it locally either. Not in release or debug mode.

We've been updating a lot of dependencies in main lately. Maybe something we use broke specifically in CI under some weird circumstance.

@Sewer56 Sewer56 force-pushed the extensible_game_paths_ids branch 2 times, most recently from 291c79c to f445583 Compare September 21, 2023 14:14
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #656 (2893e89) into main (68544d9) will increase coverage by 0.03%.
The diff coverage is 76.05%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #656      +/-   ##
==========================================
+ Coverage   64.12%   64.16%   +0.03%     
==========================================
  Files         622      624       +2     
  Lines       17472    17569      +97     
  Branches     1120     1131      +11     
==========================================
+ Hits        11204    11273      +69     
- Misses       5992     6016      +24     
- Partials      276      280       +4     
Flag Coverage Δ
Linux 63.50% <76.05%> (+0.05%) ⬆️
Windows 63.36% <76.05%> (+0.14%) ⬆️
clean_environment_tests 64.15% <76.05%> (+0.03%) ⬆️
network_tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage
...LegendaryEdition/SkyrimLegendaryEditionGameTool.cs 0.00%
...yrimSpecialEdition/SkyrimSpecialEditionGameTool.cs 0.00%
...ames/NexusMods.Games.RedEngine/RedModDeployTool.cs 0.00%
.../NexusMods.Games.Reshade/ReshadePresetInstaller.cs 0.00%
...s.Games.StardewValley/Installers/SMAPIInstaller.cs 0.00%
src/NexusMods.DataModel/Games/RunGameTool.cs 0.00%
...c/NexusMods.DataModel/Games/Unknown/UnknownGame.cs 0.00%
...NexusMods.StandardGameLocators.Tests/BasicTests.cs 0.00%
...meLocators.TestHelpers/StubbedGames/StubbedGame.cs 37.50%
...s/NexusMods.Games.DarkestDungeon/DarkestDungeon.cs 46.66%
... and 32 more
@Al12rs Al12rs merged commit 2b8fd5d into main Sep 21, 2023
6 checks passed
@Al12rs Al12rs deleted the extensible_game_paths_ids branch September 21, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants