-
Notifications
You must be signed in to change notification settings - Fork 0
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
Config/data reorganization #18
Labels
cleanup
Code changes that improve maintainability without changing behavior
enhancement
New feature or request
Comments
nmlorg
added
enhancement
New feature or request
cleanup
Code changes that improve maintainability without changing behavior
labels
Nov 6, 2018
Closed
|
nmlorg
added a commit
that referenced
this issue
Dec 23, 2018
Followups will: - Add a cleanup filter to the converter logic to convert BOTNAME.moderator.'GROUPID' to BOTNAME.moderator.GROUPID. - Convert config/calendars.json to config/calendars.yaml (maybe; see #27). - Have BotConf expose its current data (bots.yaml) under a new 'bots' level (so BOTNAME.moderator -> bots.BOTNAME.moderator), and pull in any other config/*.yaml files (such as calendar.yaml) too. - Move all group state (but not group configuration) out of bots.BOTNAME.groups into a new top-level 'groups' (groups.yaml). See #18.
|
nmlorg
added a commit
that referenced
this issue
Dec 24, 2018
BotConf explicitly loads bots.yaml into self['bots']. A followup will have BotConf actually scan confdir for all *.yaml files, loading them in (and saving them out) based on their file names (so config/blah.yaml will be loaded as self['blah'], and changes to MultiBot.conf['blah'] will be written back out to config/blah.yaml, etc.). See #18.
nmlorg
added a commit
that referenced
this issue
Dec 24, 2018
…file name. config/bots.yaml is still loaded into (and saved from) self['bots'], but config/blah.yaml is now loaded into self['blah'], etc. As a side effect, confdir is created if it does not exist. See #18.
nmlorg
added a commit
that referenced
this issue
Dec 26, 2018
…d config/users.yaml files. /admin BOTNAME admin now uses the global users records to display friendly names, but group records are still duplicated in the per-bot groups and moderator records. See #18.
nmlorg
added a commit
that referenced
this issue
Jan 5, 2019
Copy pre-captured group data from per-bot trees into the global groups record. (This could create clashes, if for example two bots running under the same MultiBot were in the same group at one point, then one was removed, then the group's state was changed, then the MultiBot was restarted and the removed bot happens to be imported second.) A followup will change the `self['groups'][groupid][k] = groupconf[k]` to `self['groups'][groupid][k] = groupconf.pop(k)` once the per-bot copy is no longer used. There's a weird issue with language_code for users: sometimes it's provided, sometimes it isn't. I haven't yet identified the pattern--the same user could send two similar messages in a row, where one does not include language_code and the next one does. Even more strangely, two bots in the same group can witness the same message and one might include language_code while the other doesn't! For now, don't reset user (or group) records whenever data comes in, just blend the new data (which may be missing fields--like language_code) in with previous data. See #18.
(See #93.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cleanup
Code changes that improve maintainability without changing behavior
enhancement
New feature or request
Right now, at the bare minimum, bot runners need to manually create a
config/
directory to storemultibot.json
. To use the/events
module (via metabot.calendars.multicalendar.MultiCalendar), they also need to manually create acalendars/
directory and aconfig/calendars.json
file.config/
(andcalendars/
) for the user automatically.~/.metabot/
or~/.config/metabot/
. It might make sense to always use this, even inside a virtualenv. It probably makes sense to allow a directory to be the first argument (python -m metabot ~/mybotdata
), and might further make sense to prompt for the config/data directory rather than default toconfig/
or~/.config/metabot/
.This might also be a good time to consolidate multibot.json and calendars.json, so:
might look something like:
However, it might also be worth first working out an actual UI for adding new calendars, and change the format of the calendar cache files to include metadata like "title" (or even separate it entirely into per-bot configs) so the configuration process is just scanning the cache directory (
~/.config/metabot/calendars/
).The text was updated successfully, but these errors were encountered: