Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions src/c#/CoreTest/Bootstrap/GeneralUpdateBootstrapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,6 @@ public void SetConfig_ReturnsBootstrapInstance()
Assert.Same(bootstrap, result);
}

/// <summary>
/// Tests that SetFieldMappings returns the bootstrap instance for chaining.
/// </summary>
[Fact]
public void SetFieldMappings_ReturnsBootstrapInstance()
{
// Arrange
var bootstrap = new GeneralUpdateBootstrap();
var fieldMappings = new Dictionary<string, string>
{
{ "field1", "value1" }
};

// Act
var result = bootstrap.SetFieldMappings(fieldMappings);

// Assert
Assert.Same(bootstrap, result);
}

/// <summary>
/// Tests that SetCustomSkipOption returns the bootstrap instance for chaining.
/// </summary>
Expand Down Expand Up @@ -199,7 +179,6 @@ public void MethodChaining_ConfigureBootstrap_ReturnsCorrectInstance()
UpdateUrl = "https://example.com/update",
ClientVersion = "1.0.0"
})
.SetFieldMappings(new Dictionary<string, string> { { "key", "value" } })
.SetCustomSkipOption(() => false)
.AddListenerException((sender, e) => { });

Expand Down
6 changes: 0 additions & 6 deletions src/c#/GeneralUpdate.Common/Shared/Object/GlobalConfigInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
/// Directory path containing driver files for update.
/// Used when DriveEnabled is true to locate driver files for installation.
/// </summary>
public string DriverDirectory { get; set; }

Check warning on line 107 in src/c#/GeneralUpdate.Common/Shared/Object/GlobalConfigInfo.cs

View workflow job for this annotation

GitHub Actions / build

'GlobalConfigInfo.DriverDirectory' hides inherited member 'BaseConfigInfo.DriverDirectory'. Use the new keyword if hiding was intended.

Check warning on line 107 in src/c#/GeneralUpdate.Common/Shared/Object/GlobalConfigInfo.cs

View workflow job for this annotation

GitHub Actions / build

'GlobalConfigInfo.DriverDirectory' hides inherited member 'BaseConfigInfo.DriverDirectory'. Use the new keyword if hiding was intended.

/// <summary>
/// Indicates whether differential patch update is enabled.
Expand All @@ -112,12 +112,6 @@
/// </summary>
public bool? PatchEnabled { get; set; }

/// <summary>
/// Dictionary for custom field name mappings.
/// Used for flexible configuration transformations in specific scenarios.
/// </summary>
public Dictionary<string, string> FieldMappings { get; set; }

/// <summary>
/// Directory path where the current version files are backed up before update.
/// Computed by combining InstallPath with a versioned directory name.
Comment on lines 113 to 117
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

GlobalConfigInfo is a public type; removing the FieldMappings property is a source-breaking change for any callers referencing it (and potentially for any reflection-based code). If this is an intentional breaking change, consider documenting it in release notes / bumping the appropriate package version, or providing a compatibility path if needed.

Copilot uses AI. Check for mistakes.
Expand Down
8 changes: 1 addition & 7 deletions src/c#/GeneralUpdate.Core/GeneralUpdateBootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,7 @@ public GeneralUpdateBootstrap SetConfig(Configinfo configInfo)
InitBlackList();
return this;
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Removing the public SetFieldMappings API is a breaking change for any consumers chaining this call. If backward compatibility matters, consider leaving a deprecated shim (e.g., marked obsolete) for at least one release or explicitly handling the versioning/release notes for this breaking change.

Suggested change
}
}
[Obsolete("SetFieldMappings is deprecated. Use SetConfig instead.")]
public GeneralUpdateBootstrap SetFieldMappings(Configinfo configInfo)
{
return SetConfig(configInfo);
}

Copilot uses AI. Check for mistakes.

public GeneralUpdateBootstrap SetFieldMappings(Dictionary<string, string> fieldMappings)
{
_configInfo.FieldMappings = fieldMappings;
return this;
}


public GeneralUpdateBootstrap SetCustomSkipOption(Func<bool>? func)
{
_customSkipOption = func;
Expand Down
3 changes: 0 additions & 3 deletions src/c#/GeneralUpdate.Upgrad/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ static async Task Main(string[] args)
//整个更新过程出现的任何问题都会通过这个事件通知
.AddListenerException(OnException)
.SetConfig(configinfo)
//设置字段映射表,用于解析所有驱动包的信息的字符串
//.SetFieldMappings(fieldMappingsCN)
//是否开启驱动更新
//.Option(UpdateOption.Drive, true)
//.Option(UpdateOption.Patch, false)
Expand Down Expand Up @@ -96,7 +94,6 @@ static async Task Main(string[] args)
.SetDriverFileExtension(fileExtension)
.SetOutPutDirectory(outPutPath)
.SetDriverDirectory(driversPath)
.SetFieldMappings(fieldMappingsCN)
.Build();

var processor = new DriverProcessor();
Expand Down
Loading