Added backups of all data, restorable on another computer (#1008)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
j-erlerandThorsten Sommer authored and GitHub committed 2026-10-15 16:42:02 +02:00
1 parent ab45580473
commit 936043319c
144 files changed
+10417 -424

No files matched your search

@@ -60,7 +60,7 @@ public sealed class LeftOverConfigurationObjectsTests
[Test]
public async Task TheObjectsOfAPluginWhichDidNotStartStay()
{
var wasChanged = await PluginConfigurationObject.CleanLeftOverConfigurationObjects(PluginConfigurationObjectType.CHAT_TEMPLATE, x => x.ChatTemplates, [new AvailablePlugin()], new HashSet<Guid>(), new HashSet<Guid> { PLUGIN_ID }, []);
var wasChanged = await PluginConfigurationObjectDescriptors.CHAT_TEMPLATE.CleanLeftOverAsync([new AvailablePlugin()], new HashSet<Guid>(), new HashSet<Guid> { PLUGIN_ID }, []);
Assert.Multiple(() =>
{
@@ -72,7 +72,7 @@ public sealed class LeftOverConfigurationObjectsTests
[Test]
public async Task TheObjectsOfAPluginWhichStartedWithoutThemAreRemoved()
{
var wasChanged = await PluginConfigurationObject.CleanLeftOverConfigurationObjects(PluginConfigurationObjectType.CHAT_TEMPLATE, x => x.ChatTemplates, [new AvailablePlugin()], new HashSet<Guid>(), new HashSet<Guid>(), []);
var wasChanged = await PluginConfigurationObjectDescriptors.CHAT_TEMPLATE.CleanLeftOverAsync([new AvailablePlugin()], new HashSet<Guid>(), new HashSet<Guid>(), []);
Assert.Multiple(() =>
{
@@ -162,8 +162,8 @@ public sealed class ManagedTokenizerStateTests
throw new InvalidOperationException("The configuration of this test is not a Lua table.");
var configObjects = new List<PluginConfigurationObject>();
PluginConfigurationObject.TryParse(PluginConfigurationObjectType.LLM_PROVIDER, x => x.Providers, x => x.NextProviderNum, mainTable, PLUGIN_ID, ref configObjects, dryRun: false, PLUGIN_PATH);
PluginConfigurationObject.TryParse(PluginConfigurationObjectType.EMBEDDING_PROVIDER, x => x.EmbeddingProviders, x => x.NextEmbeddingNum, mainTable, PLUGIN_ID, ref configObjects, dryRun: false, PLUGIN_PATH);
PluginConfigurationObjectDescriptors.LLM_PROVIDER.TryParse(mainTable, PLUGIN_ID, configObjects, dryRun: false, PLUGIN_PATH);
PluginConfigurationObjectDescriptors.EMBEDDING_PROVIDER.TryParse(mainTable, PLUGIN_ID, configObjects, dryRun: false, PLUGIN_PATH);
return configObjects;
}
@@ -0,0 +1,28 @@
using AIStudio.Tools.PluginSystem;
namespace AIStudio.Tests.Tools.PluginSystem;
/// <summary>
/// Checks that every type of configuration object has its descriptor.
/// </summary>
/// <remarks>
/// Reading the objects from a configuration plugin and removing the left-over ones go through the
/// descriptors. A type without one would be read by neither: a configuration plugin could define such
/// objects without effect, and the ones a removed plugin left behind would stay in the settings.
/// </remarks>
[TestFixture]
public sealed class PluginConfigurationObjectDescriptorsTests
{
[Test]
public void EveryTypeHasExactlyOneDescriptor()
{
var describedTypes = PluginConfigurationObjectDescriptors.ALL.Select(descriptor => descriptor.Type).ToList();
var configurableTypes = Enum.GetValues<PluginConfigurationObjectType>().Where(type => type is not PluginConfigurationObjectType.NONE and not PluginConfigurationObjectType.UNKNOWN);
Assert.Multiple(() =>
{
Assert.That(describedTypes, Is.EquivalentTo(configurableTypes));
Assert.That(describedTypes, Is.Unique, "A type described twice would be read and cleaned up twice.");
});
}
}