Skip to content
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

Use Configurate or snakeyaml for yml parsing #2471

Open
AuroraLS3 opened this issue Jul 9, 2022 · 1 comment
Open

Use Configurate or snakeyaml for yml parsing #2471

AuroraLS3 opened this issue Jul 9, 2022 · 1 comment

Comments

@AuroraLS3
Copy link
Collaborator

I would like to be able to..

Split from #1363

Not use a custom yml parser (Leads to bugs #2297)

Is your feature request related to a problem? Please describe.

The previous ticket #1363 had unrelated stuff about moving to configurate in it. It is below

TODO

  • Prepare for configurate
    • Extract interface from Config and ConfigNode, (keep implementation with classes LegacyConfig and LegacyConfigNode)
    • Extract interface from and rename ConfigReader and ConfigWriter to LegacyConfigReader and LegacyConfigWriter
  • Write configurate based Config implementation
    • Add configurate as a dependency, shadow and relocate it
    • Implement ConfigNode and Config interfaces with configurate
    • Move everything that extends LegacyConfig to use ConfigurateConfig
      • Optional: If it is easier, change the configs to use composition instead of inheritance
    • Implement ConfigReader and ConfigWriter and writer for configurate.
    • Implement a ConfigReader and ConfigWriter that pass the read/write call to appropriate implementation
      • eg: If ConfigurateConfigReader fails to read the yml (Because it is not valid yml), read with LegacyConfigReader so that the modifications mentioned above can be applied.
      • eg: If Writer is passed a LegacyConfig it is written with LegacyConfigWriter

Acceptance criteria

At the end of this following classes should exist:

  • Config (interface)
  • ConfigNode (interface)
  • ConfigWriter
  • ConfigReader
  • LegacyConfig
  • LegacyConfigNode
  • LegacyConfigWriter
  • LegacyConfigReader
  • ConfigurateConfig
  • ConfigurateConfigNode
  • ConfigurateConfigWriter
  • ConfigurateConfigReader
  • _____ConfigReader (the reader that calls other readers)
  • _____ConfigWriter (the writer that calls other writers)

Validations:

  • Plan can enable with an old config (I think there is an unit test for this)
  • Old config is transformed during enable
  • Transformed yml is valid yml
  • Config does not lose comments when using configurate
  • Plan can enable with a new config without using LegacyConfig
@AuroraLS3 AuroraLS3 added this to Backlog Jul 9, 2022
@AuroraLS3 AuroraLS3 moved this to INBOX in Backlog Jul 9, 2022
@AuroraLS3 AuroraLS3 added this to the Configuration backend change milestone Jul 9, 2022
@Vankka
Copy link
Contributor

Vankka commented Jul 14, 2022

Config does not lose comments when using configurate

Won't be able to write files and have comments on yaml without SpongePowered/Configurate#175

@AuroraLS3 AuroraLS3 moved this from INBOX to Assigned to Milestone in Backlog Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Assigned to Milestone
Development

No branches or pull requests

2 participants