Make global install filters and presets game-specific#4361
Merged
HebaruSan merged 14 commits intoMay 5, 2025
Merged
Conversation
29afca5 to
e66a076
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ZeroMiniAVC.dll, which is unnecessary for CKAN-installed mods because the filter itself blocks MiniAVC, but could be desirable for purging files from manually-installed mods.ModuleLabelandModuleLabelListlive exclusively in GUI but would be useful for other GUIs.Changes
/added to the front so they won't match parts of other file namesZeroMiniAVC.dllfrom being installed.Since ZeroMiniAVC and MiniAVC are both GPL-3.0, and the CKAN repo is MIT, we download the mods during the test and cache them in
_build/test/cache/<target framework>(the target framework is included to avoid problems with the test clobbering itself when running in parallel for different frameworks). This directory will be cached by the GitHub workflows to reduce network traffic.ModuleLabelandModuleLabelListare moved from GUI to Core.Side fixes
Now they're fixed.
Now we can set the
GITHUB_TOKENenvironment variable to a GitHub API auth token to solve this.RegistryLivetest can fail on Windows if our three target platforms attempt to run it simultaneously, because aFIle.Opencall inRepositoryDataholds an exclusive lock.Now that call uses
OpenReadinstead.CkanModulesfromregistry.jsonis parallelized for performance, and the construction of aCkanModulefor a DLC requires creating anUnmanagedModuleVersion, the constructor of which accesses an i18n resource, which is loaded on the fly and cached bySingleAssemblyResourceManager. If two DLCCkanModulesare loaded in parallel, they can end up loading the same resource set simultaneously in different threads and attempting to store both sets to the cache, which throws a duplicate key exception.Now
SingleAssemblyResourceManageruseslockto control access to its resource set cache so this won't happen.ModuleInstaller.DownloadandModuleInstaller.CachedOrDownloadare not used, so now they're removed.These functions were the only reason
ModuleInstaller's constructor needed a user agent, so that parameter is also removed.KSP-Defaultrepository is checked many times when the tests are run, even though in most cases we're not even trying to use that repo.Now the actual correct repo to used is passed all the way into the registry during tests, which pre-empts the attempt to check if
KSP-Defaultis cached. In addition,RegistryManagers used in tests will now beDisposed when done, which will ensure that the global in-process cache ofRegistryManagersdoesn't grow without bound.ModuleInstallergrabbed a reference to theJsonConfigurationinternally, global-variable style, which made it impossible to override those settings in tests.Now the configuration is a parameter instead of being acquired sneakily, so tests can control the settings used for the test.
RegistryManager.AscertainDefaultRepoduplicated some logic fromRepository.DefaultGameRepo.Now the former calls the latter instead.