refactor: remove dead PLGX-related code#39
Conversation
- Remove PluginPackageFormat.Plgx; only DLL format is supported. - Remove PLGX detection from PluginPathResolver. - Remove PLGX asset URL handling from UpdateChecker. - Remove PLGX tests; dotnet test passes 51/51. - Remove *.plgx from .gitignore. Closes #35.
|
Warning Review limit reached
Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| return File.Exists(dllPath) ? PluginPackageFormat.Dll : PluginPackageFormat.Dll; | ||
| } |
There was a problem hiding this comment.
Logical Redundancy in Return Statement
The return statement in ResolveInstalledFormat uses a ternary operator to return PluginPackageFormat.Dll regardless of whether the file exists:
return File.Exists(dllPath) ? PluginPackageFormat.Dll : PluginPackageFormat.Dll;This is redundant and does not provide any meaningful distinction between the two cases. Consider handling the scenario where the DLL does not exist, either by throwing an exception, returning a different format, or logging an error for better maintainability and clarity.
| private static string BuildAssetUrl(string tagName, PluginPackageFormat format) | ||
| { | ||
| if (string.IsNullOrEmpty(tagName)) return ReleasesUrl; | ||
| string extension = format == PluginPackageFormat.Plgx ? ".plgx" : ".dll"; | ||
| return "https://github.com/hieuck/KeePassAutoReload/releases/download/" + tagName + "/KeePassAutoReload" + extension; | ||
| return "https://github.com/hieuck/KeePassAutoReload/releases/download/" + tagName + "/KeePassAutoReload.dll"; | ||
| } |
There was a problem hiding this comment.
Logic Issue:
The BuildAssetUrl method accepts a format parameter but does not use it, always returning the DLL asset URL. If multiple asset formats are supported, the method should use the format parameter to construct the correct URL. Otherwise, remove the parameter to avoid confusion.
Recommended Solution:
Update the method to handle different formats, e.g.:
switch (format) {
case PluginPackageFormat.Dll:
return $"https://github.com/hieuck/KeePassAutoReload/releases/download/{tagName}/KeePassAutoReload.dll";
// Add cases for other formats
default:
throw new ArgumentException("Unsupported format", nameof(format));
}| private static string BuildAssetUrl(string tagName, PluginPackageFormat format) | ||
| { | ||
| if (string.IsNullOrEmpty(tagName)) return ReleasesUrl; | ||
| string extension = format == PluginPackageFormat.Plgx ? ".plgx" : ".dll"; | ||
| return "https://github.com/hieuck/KeePassAutoReload/releases/download/" + tagName + "/KeePassAutoReload" + extension; | ||
| return "https://github.com/hieuck/KeePassAutoReload/releases/download/" + tagName + "/KeePassAutoReload.dll"; | ||
| } | ||
|
|
||
| private static string BuildReleaseUrl(string tagName) |
There was a problem hiding this comment.
Security/Consistency Issue:
Neither BuildAssetUrl nor BuildReleaseUrl validate or sanitize the tagName input. If tagName is derived from external sources, this could lead to malformed URLs or potential injection vulnerabilities.
Recommended Solution:
Sanitize tagName to ensure it contains only valid characters for a URL path segment before using it in URL construction.
Summary\r\nSince PLGX builds were removed from CI and the release pipeline now ships only DLL assets, all PLGX-related code is dead. This PR removes it.\r\n\r\n## Changes\r\n- Remove ; only remains.\r\n- Remove PLGX detection in .\r\n- Simplify to always use .\r\n- Remove PLGX-specific tests.\r\n- Remove from .\r\n\r\n## Tests\r\n- MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file. passes: 51/51.\r\n\r\nCloses #35.