Closed chazzlabs closed 6 years ago
I do think there should be some documentation, perhaps in the Contribute Code section? Wherever it makes sense to you :)
Still waiting for #105 to merged... I poked them earlier so hopefully it won't be too much longer :P
Are there more changes to this PR that you haven't pushed up yet?
@cannawen Are we still also waiting on #90 before merging this? You mentioned waiting on that issue and #97 in a previous comment.
I do still need to address the changes you brought up, but they should be quick and easy to knock out.
Sorry for the confusion, #90 is the issue, and #105 is the PR.
It's merged in now, so yay!
@cannawen Just wanted to give you a heads up that this will be complete in the next day. Sorry for the delay on this.
No worries! :)
@cannawen I was finally able to address the changes for this PR. I apologize again for the delay.
I'm not sure what the conflicts are. I thought I'd addressed them for package.json
and src/bot.js
. src/personality.js
no longer exists in my branch, so I'm not sure about resolving that conflict.
Taking a look at the files in my branch, it looks like there should be no issues, right?
https://github.com/chazzlabs/metric_units_reddit_bot/blob/personality-refactor/package.json#L12 https://github.com/chazzlabs/metric_units_reddit_bot/blob/personality-refactor/src/bot.js#L30
One thing I didn't change, however, is the case (in)sensitivity for personality matches. I'm not sure if we want to handle that as a change for this PR or as a separate issue.
I fixed the merge conflicts (since the branch was behind master) :) Thanks!
The bot is slightly shadowbanned right now, I asked the admins why and hopefully it'll get unbanned. But we probably won't do any work while it's banned
PR Checklist
closes #{issue number}
if appropriateThis PR includes the changes made for the personality architecture overhaul.
All unit tests are passing; since the personality module now randomly chooses a personality from all personalities that match the message, I modified the existing personality unit tests to check the actual replies against the entire list of possible replies for a given message.
Notable changes included in this PR:
personality.js
was moved tosrc/personality/index.js
personality.js
were removed and now exist in their own YAML configuration files insrc/personality/[robot, human]
postprocess
function; there is a singlepostprocess
function that is run on all responses, and the map which defines the supported values is returned in thecreatePostprocessMap
function.regex
properties in personality configurations can no longer be functions; instead they can be either a regex string or an array of regex strings. In the case that a personality configuration'sregex
is an array of strings, a message is considered a match if it matches all of the strings in the array.I apologize for the size of the changes in this PR, but it needs to be reviewed before being merged (plus I want that sweet t-shirt 😄 ).
Something to note: I originally had some detailed comments explaining the usage of the personality config files (the files that contained ordered lists for robot and human personalities). Since those files no longer exist, where should we put any appropriate documentation for personalities? Basically the documentation should give an overview of the properties contained in the YAML files for each personality (description, regex, responses, etc.). I can add the documentation and commit again before the PR is merged if we decide the it should be included.
Relevant link(s):
Resolves #28