Dyml icon indicating copy to clipboard operation
Dyml copied to clipboard

Refactor YAML Insertion Logic (Auto-generated by Copilot)

Open wcy6457 opened this issue 4 months ago • 1 comments

This pull request — including logic improvements, structure refinements, and documentation — was fully generated and refined by GitHub Copilot. All changes, from the initial draft to the final code and description, were produced through Copilot’s automated suggestions and completions, with no manual edits except verification.

This pull request improves the logic for inserting new YAML sections into a unified list, making the placement of new modules and their parent fillers more robust and predictable. The changes ensure that modules with no shared prefix are appended at the end, and that filler parent sections are inserted correctly to maintain hierarchical structure.

Improvements to module insertion logic

  • Added handling for cases where new modules have no shared prefix with existing ones, ensuring they are always appended at the end of the unified list instead of being interleaved with top-level groups.
  • Refined the creation and insertion of filler parent modules by correctly setting the range of keys and their position, maintaining the intended hierarchy and order.
  • Updated the logic so that new top-level modules (single key, G0) are appended at the end to preserve natural order, rather than being inserted at the beginning.

Code clarity and maintainability

  • Removed outdated comments and clarified the purpose of key comparisons and module placement, making the code easier to understand and maintain.

wcy6457 avatar Oct 16 '25 09:10 wcy6457

@wcy6457 thanks for the PR, there seem to be issues with the ThreadSafety tests, please do a deep dive on that, they shouldn't fail. Maybe its something with the virtual CI environment, but it shouldn't be.

Osiris-Team avatar Oct 16 '25 14:10 Osiris-Team