-
Notifications
You must be signed in to change notification settings - Fork 21
Test/required check #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…into test/required-check
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
Help & Readme Update
There was a problem hiding this 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 introduces helper classes for gadget and plugin management and implements comprehensive refactoring of the YSoNet tool to improve maintainability and functionality. The changes replace hardcoded gadget discovery with centralized helper classes and implement better help system functionality.
Key changes include:
- Introduction of
GadgetHelperandPluginHelperclasses for centralized gadget/plugin discovery and management - Comprehensive refactoring of
Program.csto use new helper classes and implement gadget/plugin-specific help - Updates to gadget labels and naming patterns for consistency
- Code organization improvements and import statement reordering
Reviewed Changes
Copilot reviewed 80 out of 86 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| ysonet/Helpers/GadgetHelper.cs | New helper class for gadget discovery, validation, and instantiation |
| ysonet/Helpers/PluginHelper.cs | New helper class for plugin discovery, validation, and instantiation |
| ysonet/Program.cs | Major refactoring to use helper classes and implement specific help functionality |
| ysonet/Generators/Base/IGenerator.cs | Updated gadget labels/tags with clearer naming |
| ysonet/Generators/Base/GenericGenerator.cs | Implemented default Name() method using reflection |
| Various generator files | Removed redundant Name() overrides and updated label references |
| Various plugin files | Import statement reordering and minor cleanup |
|
|
||
|
|
||
| if (!consumer_gadget.Labels().Contains(GadgetTypes.BridgeAndDerived)) | ||
| if (!consumer_gadget.Labels().Contains(GadgetTags.Bridged)) |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The label check has changed from GadgetTypes.BridgeAndDerived to GadgetTags.Bridged, but this may break existing functionality. Ensure that all gadgets that were previously marked as BridgeAndDerived are now properly marked as Bridged to maintain compatibility.
| string spoofedAssembly = ""; | ||
|
|
||
| public override OptionSet Options() | ||
| { | ||
| OptionSet options = new OptionSet() | ||
| { | ||
| {"spoofedAssembly=", "The assembly name you want to use in the generated serialized object (example: 'mscorlib')", v => spoofedAssembly = v }, | ||
| {"spoofedAssembly=", "The assembly name you want to use in the generated serialized object (example: 'mscorlib' or use 'default' for System.Data)", v => spoofedAssembly = v }, |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value for spoofedAssembly has changed from a specific assembly string to an empty string. This is a breaking change that could affect existing users who rely on the previous default behavior. Consider maintaining backward compatibility or clearly documenting this change.
| } | ||
|
|
||
| string spoofedAssembly = "System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; | ||
| string spoofedAssembly = ""; |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue as in DataSetOldBehaviourGenerator - the default value for spoofedAssembly has changed from a specific assembly string to an empty string, which is a breaking change.
| string spoofedAssembly = ""; | |
| string spoofedAssembly = "System.Data"; |
| DataSetMarshal payloadDataSetMarshal = new DataSetMarshal(binaryFormatterPayload); | ||
|
|
||
| DataSetBinaryMarshal payloadDataSetMarshal = new DataSetBinaryMarshal(binaryFormatterPayload); |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class name has changed from DataSetMarshal to DataSetBinaryMarshal. This is a breaking change that could affect code that directly references this class. Ensure all references are updated consistently throughout the codebase.
| DataSetSpoofMarshal payloadDataSetMarshal = new DataSetSpoofMarshal(binaryFormatterPayload); | ||
|
|
||
| DataSetBinarySpoofMarshal payloadDataSetMarshal = new DataSetBinarySpoofMarshal(binaryFormatterPayload); |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class name has changed from DataSetSpoofMarshal to DataSetBinarySpoofMarshal. This is a breaking change that could affect code that directly references this class.
| if (variant_number == 2) | ||
| { | ||
| obj = new TextFormattingRunPropertiesMarshal(xmlResourceDict); | ||
| } | ||
| else | ||
| { | ||
| obj = TypeConfuseDelegateGenerator.GetXamlGadget(xmlResourceDict); |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for variant selection has been inverted. Previously variant 1 used TypeConfuseDelegateGenerator.GetXamlGadget() and variant 2 used TextFormattingRunPropertiesMarshal. Now it's the opposite. This could break existing functionality for users relying on specific variant behaviors.
| // General Information about an assembly is controlled through the following | ||
| // set of attributes. Change these attribute values to modify the information | ||
| // associated with an assembly. | ||
| [assembly: AssemblyMetadata("BuildTime", "$(DateTime.UtcNow)")] |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MSBuild property $(DateTime.UtcNow) will not be evaluated at compile time in this context. This will result in the literal string "$(DateTime.UtcNow)" being stored as metadata rather than the actual build time. Consider using a different approach for build time tracking.
| [assembly: AssemblyMetadata("BuildTime", "$(DateTime.UtcNow)")] | |
| [assembly: AssemblyMetadata("BuildTime", System.DateTime.UtcNow.ToString("o"))] |
| // This is used to return the name of the gadget | ||
| // It must be overridden especially in cases where a gadget inherits from another gadget |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The default implementation uses reflection to derive the name from the class name. While this reduces code duplication, it creates a dependency on naming conventions. Consider documenting this convention clearly and ensuring it's consistently followed across all generators.
| // This is used to return the name of the gadget | |
| // It must be overridden especially in cases where a gadget inherits from another gadget | |
| /// <summary> | |
| /// Returns the name of the gadget by using the actual class name, removing "Generator" from the end if present. | |
| /// | |
| /// <para> | |
| /// <b>Naming convention:</b> All generator classes <b>must</b> have names ending with "Generator" for the default implementation to work correctly. | |
| /// If a gadget inherits from another gadget or does not follow this convention, override this method to provide the correct name. | |
| /// </para> | |
| /// </summary> |
Help & Readme Update