[V3] Data Converter #1293

Merged
mikeshardmind merged 14 commits from V3/data-converter into V3/develop 2018-04-03 03:14:38 +02:00
mikeshardmind commented 2018-02-07 09:27:41 +01:00 (Migrated from github.com)

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Adds a data converter for cog creator use (and for core cogs too I guess)

### Type - [ ] Bugfix - [ ] Enhancement - [X] New feature ### Description of the changes Adds a data converter for cog creator use (and for core cogs too I guess)
palmtree5 (Migrated from github.com) reviewed 2018-02-07 09:27:41 +01:00
Twentysix26 (Migrated from github.com) reviewed 2018-02-07 09:27:41 +01:00
Tobotimus (Migrated from github.com) reviewed 2018-02-07 09:27:41 +01:00
Kowlin (Migrated from github.com) reviewed 2018-02-07 09:27:41 +01:00
Chovin (Migrated from github.com) reviewed 2018-02-07 09:27:41 +01:00
mikeshardmind commented 2018-02-07 09:28:49 +01:00 (Migrated from github.com)

The underlying logic should be sound, but this needs a bit more testing before use.

The underlying logic should be sound, but this needs a bit more testing before use.
mikeshardmind commented 2018-02-07 10:20:35 +01:00 (Migrated from github.com)

Additional note: This only handles global setting values currently, additional methods need to to be added for handling guild, member, user, channel, and role settings. (More to come on this PR)

Additional note: This only handles global setting values currently, additional methods need to to be added for handling guild, member, user, channel, and role settings. (More to come on this PR)
palmtree5 commented 2018-02-07 21:16:16 +01:00 (Migrated from github.com)

I have one question on this: how would the user specify the path to the data file? It's not like we have a consistent location for the actual location of Red in V2 which would mean that predefining the location of the data file for a cog is probably not a good idea

I have one question on this: how would the user specify the path to the data file? It's not like we have a consistent location for the actual location of Red in V2 which would mean that predefining the location of the data file for a cog is probably not a good idea
mikeshardmind commented 2018-02-07 21:23:31 +01:00 (Migrated from github.com)

I wasn't planning on this being entirely automated, it would still require a user defined path. (possibly with either a prompt or a file drop)

This just lays the groundwork for some mass config changes from a file. with minimal direct interaction with Config. Still a WIP.

Ideally, at some later point when more conversion tools are ready, you could point a V3 instance at an old V2 install location and have it import every setting which it knows how to (which would still require individual cog creators to specify a conversion spec, and the location their files were stored relative to the base path of V2)

If you think this doesn't belong in base red, I can package this as a coglib instead when the downloader and cog manager are ready to support that.

I wasn't planning on this being entirely automated, it would still require a user defined path. (possibly with either a prompt or a file drop) This just lays the groundwork for some mass config changes from a file. with minimal direct interaction with Config. Still a WIP. Ideally, at some later point when more conversion tools are ready, you could point a V3 instance at an old V2 install location and have it import every setting which it knows how to (which would still require individual cog creators to specify a conversion spec, and the location their files were stored relative to the base path of V2) If you think this doesn't belong in base red, I can package this as a coglib instead when the downloader and cog manager are ready to support that.
palmtree5 commented 2018-02-07 21:29:13 +01:00 (Migrated from github.com)

Yeah, I was clarifying there would be user interaction at some point in the process. I think the basic framework of this belongs in core though

Yeah, I was clarifying there would be user interaction at some point in the process. I think the basic framework of this belongs in core though
mikeshardmind commented 2018-02-11 18:44:28 +01:00 (Migrated from github.com)

I'm putting any further work on this one on hold until resolution of https://github.com/Cog-Creators/Red-DiscordBot/issues/1294 since I will need to work directly with some of config's internals for this.

I'm putting any further work on this one on hold until resolution of https://github.com/Cog-Creators/Red-DiscordBot/issues/1294 since I will need to work directly with some of config's internals for this.
tekulvw commented 2018-02-22 01:49:16 +01:00 (Migrated from github.com)

#1335 should help significantly with this.

#1335 should help significantly with this.
mikeshardmind commented 2018-02-22 02:18:34 +01:00 (Migrated from github.com)

get_raw and set_raw should make incorporating proper conversions for things at the correct scopes easier. I haven't forgotten about this PR, but I haven't worked on it since my prior comment either.

get_raw and set_raw should make incorporating proper conversions for things at the correct scopes easier. I haven't forgotten about this PR, but I haven't worked on it since my prior comment either.
mikeshardmind commented 2018-02-24 23:06:41 +01:00 (Migrated from github.com)

This has been significantly modified to use new config methods, properly scope data, and if not properly scoping the data, put the data in a custom data group.

With the modifications made, this requires fully retesting which I have not subjected it to yet.
I do not have time to do this today, so this will not be ready for b9 unless someone else has the time to test this.

This has been significantly modified to use new config methods, properly scope data, and if not properly scoping the data, put the data in a custom data group. With the modifications made, this requires fully retesting which I have not subjected it to yet. I do not have time to do this today, so this will not be ready for b9 unless someone else has the time to test this.
mikeshardmind commented 2018-03-05 03:26:01 +01:00 (Migrated from github.com)

Do not merge this even if it looks ready at any point until I update otherwise. This can be merged whenever now.

~~Do not merge this even if it looks ready at any point until I update otherwise.~~ This can be merged whenever now.
mikeshardmind commented 2018-03-12 07:30:00 +01:00 (Migrated from github.com)

This has been tested now. The following conversions are tested and working:

  1. Bank Accounts
  2. Custom Commands
  3. Economy Settings
  4. Filter
  5. Past Names
  6. Past Nicknames

I'd appreciate a second set of eyes on this though.

Modlog's conversion is not done, but it also is not available through a menu. If I didn't miss any issues with this, this can be merged as-is and have the modlog conversion added as a later PR as unlike the ones here, the modlog conversion will be non-destructive (All of the above imports override existing values (but should retain values without a setting in v2 data))

This also is not specific to any backend as it works directly with config. rather than with the drivers.

This has been tested now. The following conversions are tested and working: 1. Bank Accounts 2. Custom Commands 3. Economy Settings 4. Filter 5. Past Names 6. Past Nicknames I'd appreciate a second set of eyes on this though. Modlog's conversion is not done, but it also is not available through a menu. If I didn't miss any issues with this, this can be merged as-is and have the modlog conversion added as a later PR as unlike the ones here, the modlog conversion will be non-destructive (All of the above imports override existing values (but should retain values without a setting in v2 data)) This also is not specific to any backend as it works directly with config. rather than with the drivers.
tekulvw (Migrated from github.com) approved these changes 2018-04-03 03:12:01 +02:00
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!1293
No description provided.