Skip to content

define channel defaults via a command and/or make configurable #141

Description

@gkspranger

as a YB dev/ops person,
i would like my channel defaults to be defined via an enabled command and/or configureable,
so that my channel settings are representative of my initial desired state

https://github.com/yetibot/yetibot.core/blob/master/src/yetibot/core/models/channel.clj#L19-L32

so let's talk about "defined via a command" .. i was looking at how you define a commands "category" via simple metadata ::

https://github.com/yetibot/yetibot.core/blob/master/src/yetibot/core/commands/echo.clj#L8

it would be neat if i had the option to create channel defaults in the same manner ::

{:yb/ch {:name "Greg"}}

image

and so if a command is enabled, when YB enters a channel -- it will have the aforementioned defaults ..

so let's talk about "configureable" .. i was looking at the config.edn example -- and i do see a reference to "jenkins" and "default" -- and as you are aware -- "jenkins-default" is a default channel setting ..

https://github.com/yetibot/yetibot.core/blob/master/config/config.sample.edn

but when i try and set this in my config.edn and restart YB -- when i check channel settings (<< even on new channel joins) -- i see that the channel setting is what is in the previously linked code ..

;; my simple test
:jenkins {:default {:job "hello world"}}

that makes sense, simply because the config is NOT a channel default, but a jenkins default -- and when checking YB code (<< note, not core) -- i think i see references to it ::

https://github.com/yetibot/yetibot/blob/master/src/yetibot/models/jenkins.clj#L29-L30

one thing i want to call out is that this default is getting set even tho i do not have any jenkins command enabled .. so it's possible a inexperienced YB user will look at their channel settings, see references to "jenkins" and "jira" and the like -- and wonder why there is a channel setting for it when said commands do not even exist to them ..

it would be great if there is a way to NOT show these defaults if the command doesn't exist AND/OR i simply don't want it there ..

finally -- if i had to choose between one or the other -- i think i would want to be able to define via a command's "metadata" >> sorry, i don't know want to call this line ::

https://github.com/yetibot/yetibot.core/blob/master/src/yetibot/core/commands/echo.clj#L8

i hope this all makes sense ..

thanks !!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions