yetibot / yetibot

🤖 Extreme chatops bot for Slack, Discord, Mattermost, IRC 🔧 New contributors welcome 🏗

Home Page:https://yetibot.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a way to remove keys on 'my' command

yetibot-admin opened this issue · comments

to let's tease this out a little more ..

imagine i have some personal state -- app = login .. when i am in the login channel and i want to deploy the login app, this is not an issue :: !deploy app to dev uses the stateful context (channel or my), both are inline with one another, all is AOK ..

however, when i am in the logout channel and i want to deploy the logout app, this becomes an issue :: !deploy app to dev .. my assumption is the login app will deployed because my takes precedence or channel state .. if i did not have app defined in my settings -- this would not be an issue .. so i need a way to unset a my setting ..

maybe not the greatest example, but one that pops into my brain ..

NOW THEN -- let's poke this a little more ..

as a YB user, using my is not hard -- because i can easily set and soon unset .. buuuuut -- what if i don't want to do unset individual keys, what if i want to unset everything related to me ?? should we have a command for that as well ??

let's take this a step further -- what if i just want to temporarily "disable" my state so i will absorb whatever is in the channel/adapter/globally ?? i can imagine a scenario where my day to day is very specific to a certain set of my values, but at times i am called into certain "scenarios" (<< i.e. channels) where it would just be easier for me to assume the settings of the channel and not have to fight with my settings ..

does that make sense ?? i am definitely reaching for corner cases here -- but i can see where some of these features would make the life of the YB user more enjoyable ..

Good thoughts. At one point I considered settings that were specific to the user AND the channel. Just not sure if we need that level of granularity.

!deploy app to dev could specifically rely only on channel settings, e.g.:

!alias deploy = "channel settings server | ssh %s git pull && service restart app"

That way you can run !deploy in any channel and it uses whatever channel's settings you're in to ssh to the correct server.

My plan for the thing that gets config while taking into account overrides is a new command called resolve, e.g.:

!resolve server

This would pull from the narrowest scope in order of:

  • my
  • our
  • channel
  • adapter
  • global

So it's up to you whether your alias uses resolve or specifically pulls from channel or my or our etc.

My thought was that my would be used for a setting that follows a user around everywhere and does not vary from channel to channel, such as "my location" or "my favorite stocks" or "my github username".

yeah, i am definitely reaching with the my vs channel settings -- and prolly best to ignore me there .. i am merely thinking of the questions i might get :: "why does cmd X always do Y when i expect it to do Z because i am in channel ABC" .. i think setting the proper expectations, like you defined, would be a better approach ..

and now i am even 2nd guessing my "mass unset" command -- because i don't want people to be asking me "where did all my personal vars go??" buuuuuuut then ..

anyhoo