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

Move kits to kits.yml #1774

Merged
merged 8 commits into from
Jan 18, 2018
Merged

Move kits to kits.yml #1774

merged 8 commits into from
Jan 18, 2018

Conversation

drtshock
Copy link
Member

We will now use a separate kits.yml file.
Any kits that were defined in the config.yml will be migrated over to the kits.yml file automatically on startup.
Settings for createkitpastebin and first join kit were moved to this file as well.

Please let me know what your thoughts are on the implementation. I ran a test locally on the copying of kits multiple times and had no issues.

[23:37:08 INFO]: [Essentials] Converting tools2
[23:37:08 INFO]: [Essentials] Converting tools2.delay
[23:37:08 INFO]: [Essentials] Converting tools2.items
[23:37:08 INFO]: [Essentials] Converting dtools2
[23:37:08 INFO]: [Essentials] Converting dtools2.delay
[23:37:08 INFO]: [Essentials] Converting dtools2.items
[23:37:08 INFO]: [Essentials] Converting notch2
[23:37:08 INFO]: [Essentials] Converting notch2.delay
[23:37:08 INFO]: [Essentials] Converting notch2.items
[23:37:08 INFO]: [Essentials] Converting color2
[23:37:08 INFO]: [Essentials] Converting color2.delay
[23:37:08 INFO]: [Essentials] Converting color2.items
[23:37:08 INFO]: [Essentials] Converting firework2
[23:37:08 INFO]: [Essentials] Converting firework2.delay
[23:37:08 INFO]: [Essentials] Converting firework2.items

We will now use a separate kits.yml file.
Any kits that were defined in the config.yml will be migrated over to the kits.yml file automatically on startup.
Settings for createkitpastebin and first join kit were moved to this file as well.
@drtshock drtshock requested review from SupaHam and mdcfe January 17, 2018 07:38
@SupaHam
Copy link
Member

SupaHam commented Jan 17, 2018

Sorry, I do not approve of this current structure.

The idea of kits.yml is great, but a couple of changes need to be made to this implementation:

  1. Consider keeping all configuration in config.yml as per convention (the file does exist to hold all values)
  2. Add a kits root property that will be a 'list' of kit objects. e.g.
kits:
  foo:
    items: 2

Following these two points will enable us to utilise the yaml saving and not messing up config comments. Albeit, the primary rationale behind it should be the conventions.

One more thing, if i'm not mistaken "Attempting to convert old kits in config.yml to new kits.yml" will print on every start up. If so, could we do a check to see if kits exists in config.yml, if so, proceed?

Copy link
Member

@mdcfe mdcfe left a comment

Choose a reason for hiding this comment

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

Tried to review earlier to no avail, but the unfinished comment I wrote earlier and lost exactly reflects the changes SupaHam requested - keeping all kits under a kits key and config options staying in config.yml as comments will be lost when creating kits.

Also, something to bear in mind is @khobbits's suggestion that pastebin-createkit could now default to false, as it would lead to people not noticing the new feature.

Another thing to consider is to use EssentialsUpgrade as this appears to be the most relevant place for the config migration code to go, and allows us to track migrations easily through upgrades-done.yml.

For some reason, yaml doesn't like uppercase configuration section keys.
…s back to original.

This commit just needs to be rebased before the PR is merged.
@drtshock
Copy link
Member Author

All issues addressed. Please let me know if you guys have any further suggestions :)

@drtshock drtshock merged commit cd43355 into 2.x Jan 18, 2018
@mdcfe
Copy link
Member

mdcfe commented Jan 18, 2018

👍

@khobbits
Copy link
Contributor

#1775

@DoNotSpamPls
Copy link
Member

delete branch?

@drtshock drtshock deleted the kits branch March 14, 2018 16:53
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.

6 participants