Skip to content

Conversation

@irsdl
Copy link
Owner

@irsdl irsdl commented Aug 1, 2025

SharePoint plugin has been updated
Project has been restructured
Helpers for Gadgets and Plugins have been created to make the application cleaner
Tags have replaced GadgetTypes

irsdl and others added 8 commits July 26, 2025 23:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
SharePoint plugin has been updated
Project has been restructured
Helpers for Gadgets and Plugins have been created to make the application cleaner
Tags have replaced GadgetTypes
Copilot AI review requested due to automatic review settings August 1, 2025 20:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a significant refactoring of the YSoNet project structure with several key improvements focused on code organization, consistency, and maintainability.

  • Adds centralized helper classes (GadgetHelper and PluginHelper) to streamline gadget and plugin operations
  • Replaces GadgetTypes with GadgetTags for better categorization
  • Updates SharePoint plugin to support new CVE-2024-38018 vulnerability

Reviewed Changes

Copilot reviewed 80 out of 86 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
ysonet/ysonet.csproj Adds new helper files, reorganizes generator structure into Base/ and Patched/ folders, includes SharePoint DLL dependencies
ysonet/Program.cs Major refactoring to use new helper classes, improves argument validation and help system
ysonet/Helpers/GadgetHelper.cs New centralized helper for gadget discovery, validation, and instantiation
ysonet/Helpers/PluginHelper.cs New centralized helper for plugin discovery, validation, and instantiation
ysonet/Generators/Base/IGenerator.cs Replaces GadgetTypes with GadgetTags for better semantic categorization
ysonet/Plugins/SharePointPlugin.cs Adds support for CVE-2024-38018, updates gadget instantiation to use GadgetHelper
Multiple Generator files Removes Name() method overrides (now auto-generated), updates labels to use GadgetTags
Multiple Plugin files Reorganizes imports, updates to use new helper patterns

return null;
}
}
}
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding XML documentation for the public class GadgetHelper to describe its purpose and usage patterns.

Copilot uses AI. Check for mistakes.
.ToArray();
}
}
} No newline at end of file
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding XML documentation for the public class PluginHelper to describe its purpose and usage patterns.

Copilot uses AI. Check for mistakes.
private int variant_number = 1; // Add variant support
string spoofedAssembly = "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
string spoofedAssembly = "";
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using a const or readonly field for the default spoofedAssembly value instead of an empty string that gets conditionally set.

Suggested change
string spoofedAssembly = "";
private const string DefaultSpoofedAssembly = "";
string spoofedAssembly = DefaultSpoofedAssembly;

Copilot uses AI. Check for mistakes.
}

string spoofedAssembly = "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
string spoofedAssembly = "";
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using a const or readonly field for the default spoofedAssembly value instead of an empty string that gets conditionally set.

Suggested change
string spoofedAssembly = "";
private const string DefaultSpoofedAssembly = "";
string spoofedAssembly = DefaultSpoofedAssembly;

Copilot uses AI. Check for mistakes.
// --- Load Microsoft.SharePoint.dll ---
string spPath = Path.Combine(dllsFolder, "Microsoft.SharePoint.dll");
if (!File.Exists(spPath))
throw new FileNotFoundException("Microsoft.SharePoint.dll not found", spPath);
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

Consider providing a more helpful error message that includes the expected location and installation instructions for Microsoft.SharePoint.dll.

Suggested change
throw new FileNotFoundException("Microsoft.SharePoint.dll not found", spPath);
throw new FileNotFoundException(
$"Microsoft.SharePoint.dll not found at '{spPath}'.\n" +
"Please ensure that Microsoft.SharePoint.dll (from SharePoint Server 2019) is present in the following folder:\n" +
$" {dllsFolder}\n" +
"You can obtain this DLL from a SharePoint Server installation. " +
"Copy it from '[SharePoint Server Install Path]\\15\\ISAPI\\Microsoft.SharePoint.dll' to the above folder."
);

Copilot uses AI. Check for mistakes.
// --- Load Microsoft.SharePoint.ApplicationPages.dll ---
string appPagesPath = Path.Combine(dllsFolder, "Microsoft.SharePoint.ApplicationPages.dll");
if (!File.Exists(appPagesPath))
throw new FileNotFoundException("Microsoft.SharePoint.ApplicationPages.dll not found", appPagesPath);
Copy link

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

Consider providing a more helpful error message that includes the expected location and installation instructions for Microsoft.SharePoint.ApplicationPages.dll.

Suggested change
throw new FileNotFoundException("Microsoft.SharePoint.ApplicationPages.dll not found", appPagesPath);
throw new FileNotFoundException(
$"Microsoft.SharePoint.ApplicationPages.dll not found at '{appPagesPath}'.\n" +
$"Please ensure that the DLL is present in the expected folder: '{dllsFolder}'.\n" +
"You can obtain this DLL from a SharePoint installation (typically located in the SharePoint server's '15\\ISAPI' directory). " +
"Copy it to the specified dllsFolder and try again.",
appPagesPath);

Copilot uses AI. Check for mistakes.
@irsdl irsdl merged commit ba682c8 into master Aug 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants