If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
Notes: Jira ticket
Currently, you can create bot accounts as a System Admin in one of two ways:
Another way to create a bot account is to convert an existing user to a bot. This is likely a common use case given many have created fake user accounts for integrations, and want to convert these to bots. This will be done through the following CLI command.
mattermost user modify {emails, usernames, userIds} --bot
When converting a bot to a user, the same options should be supported as when creating a user: https://docs.mattermost.com/administration/command-line-tools.html#mattermost-user-create.
working on this
To clarify this issue is about both user-to-bot and bot-to-user conversion?
That's correct @liusy182. Thanks for working on this! :rocket:
@liusy182 @hanzei This ticket is only for user-to-bot conversion.
We may later add the ability for bot-to-user conversion but need more thought around how authentication would work for the resulting user account.
thanks @jasonblais ! I thought about bot-to-user as well. Shouldn't it be very similar to mattermost user create command where a list of mandatory fields needs to be provided (such as password).
e.g.
// convert a bot to user
mattermost user modify botusername --password password --email [email protected] ...
I am thinking of calling userStore.Update(...) then userStore.UpdatePassword(...) so that all the provided fields are correctly populated.
Are there anything additional that need to be considered?
@liusy182 For Mattermost instances that don't have email/password login enabled (e.g. they may have LDAP or SAML), converting a bot to a user account may be more difficult, or at least involve additional steps that would need to be considered.
Really appreciate your help on this improvement by the way!
got it @jasonblais I think I can get the basic email/password auth working and return errors for other types of logins, just like how today's mattermost user create works. Should I proceed with that or defer it to future?
@liusy182 Interesting, that seems like a feasible approach to consider. Would you be open to creating two separate PRs, one for user-to-bot conversion and another for bot-to-user conversion?
In case the bot-to-user conversion takes longer time to review, I wouldn't want to block the progress on user-to-bot which is more clearly defined.
@jasonblais since both flows use the same command, I foresee there will be big code overlap. I will do user-to-bot first then. Once that is in I can follow up with bot-to-user with simple password use case.
@liusy182 I see, good to know. Agree with your approach, let's do that 馃憤
Hey @liusy182 for the user --> bot conversion, would you prefer to work off of this help wanted issue, or through a separate one?
sure i can work on this somewhere this week @jasonblais
Thanks @liusy182! I've created a separate issue for it here so we can track separately: https://github.com/mattermost/mattermost-server/issues/10800
Closing this one for supporting converting user accounts to bots.
Most helpful comment
sure i can work on this somewhere this week @jasonblais