-
Notifications
You must be signed in to change notification settings - Fork 17
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
Durable users - WIP / for discussion #78
base: master
Are you sure you want to change the base?
Conversation
6992671
to
ffd1f06
Compare
From @jcorrado via Slack:
|
Corollary: What if we just design everything as if there were only one adapter (while still capturing provenance)? Rationale:
This is essentially what I've been doing all along and it hasn't hindered me. The remaining TODOs for Users would still be:
I think of it as a stepping stone to the ideal "all or nothing" state. This means both sets of users show up in karma. Observers, Status, and Aliases are global. I think all of these are fine. I've always tried to let concrete use cases drive the design of Yetibot, and I don't think I have a strong enough multi adapter case (Yetibot public runs on Slack and IRC but no one uses it on IRC currently) to help drive its design while at the same time having a practical need for multi adapter. In the future if/when YB supports Gitter or other platforms it will likely listen on all, and I think we want most state to be global in that case. Same with Clojure community chats: if/when we get Yetibot into Clojurians, #clojure IRC, clojure/general on Gitter, etc. When that happens I think I'll either have motivation to go all in or the clarity and confidence to make the call go single adapter. |
Actively mulling this over... |
tldr: agree with all or nothing but want to defer the decision / work. |
We discussed this today starting at https://yetibot.slack.com/archives/C66AJ2EFL/p1554821184926700 Summary
Short term
User modeling
Mid term
In terms of simplifying adapters, maybe the adapter just needs to provide a function from uid to fully resolved user. |
Related: yetibot/yetibot#179 |
@@ -22,7 +22,8 @@ | |||
;; evaluation of piped expressions (i.e. %s instead of $s) | |||
expr (binding [*subst-prefix* method-like-replacement-prefix] | |||
(str command/config-prefix (pseudo-format-n cmd args))) | |||
results (record-and-run-raw expr user yetibot-user | |||
resolved-users nil ;; TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure aliases would ever mention users. Either way, we can defer this to a later PR if we want.
@@ -104,7 +104,8 @@ | |||
;; piping behavior | |||
rendered-cmd)) | |||
[{:keys [error? timeout? result] :as expr-result}] | |||
(record-and-run-raw expr user yetibot-user)] | |||
resolved-users nil ;; TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can defer.
@@ -234,6 +234,9 @@ | |||
yetibot? (= yetibot-uid (:user event)) | |||
user-model (assoc (users/get-user cs (:user event)) | |||
:yetibot? yetibot?) | |||
;; TODO - call (a/resolve-users event) to ensure users are resolved, | |||
;; then pass the resulting map along to `handle-raw` as | |||
;; `:resolved-users` below in addition to `:body`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a potential starting place.
- Add
a/resolve-users
function - call it via
(a/resolve-users adapter event)
- in
a/resolve-users
log theevent
and start looking at how we can pull users out of it and turn them into canonical persistent records
Opening this up as a place to discuss how we want to model users.
Goals of this discussion
Multi adapter
DB entities to consider:
Two extremes:
Current state
Currently Yetibot supports multiple adapters but it's somewhere between the two extremes.
Considerations
Current use cases of multiple adapters
Concluding thoughts
~devth
and my Slack ID is@U123123
- maybe this is akin to connecting an identity on a website to disparate oauth identity providers like twitter, fb, github, etc)username
is identical, thereby avoiding the problem with single-org multi-workspace users having different ids in each workspace. This could even be configurable (:attempt-to-stitch? true
).