Skip to content
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

MM-60420: treat bots as participants #1939

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

lieut-data
Copy link
Member

Summary

In support of the MS Teams Tab App, and to unlock other security workflows involving bot participation in runs, let's allow bots to be participants of playbook runs.

Ticket Link

Fixes: https://mattermost.atlassian.net/browse/MM-60420

@lieut-data lieut-data force-pushed the mm-60420-bots-as-run-participants branch from 49c5698 to d73826c Compare September 9, 2024 13:33
WHERE i2.Id = i.Id
AND rp.IsParticipant = true
AND rp.UserId NOT IN (SELECT UserId FROM Bots)
), ''
ORDER BY (CASE WHEN b.UserId IS NULL THEN 0 ELSE 1 END), rp.UserId
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still JOIN so we can order bots after human participants.

Comment on lines 896 to +897
// GetHistoricalPlaybookRunParticipantsCount returns the count of all members of a playbook run's channel
// since the beginning of the playbook run, excluding bots.
// since the beginning of the playbook run.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is effectively "retroactive."

@lieut-data lieut-data added 1: PM Review Requires review by a product manager 2: Dev Review Requires review by a core committer labels Sep 9, 2024
@lieut-data lieut-data marked this pull request as ready for review September 9, 2024 16:13
Copy link
Member

@JulienTant JulienTant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @lieut-data; I was wondering what was the reasoning behind preventing bots to become participants in the first place?

@lieut-data
Copy link
Member Author

LGTM @lieut-data; I was wondering what was the reasoning behind preventing bots to become participants in the first place?

The driving impetus in the past was to prevent the @playbooks bot from always being a participant in the run because the bot would join the channel and channel membership == run participation. But when we split those apart, we never revisited this decision -- new runs since that change (circa late 2022) won't have @playbooks as a participant despite the bot joining the channel.

@lieut-data lieut-data added QA Deferred and removed 1: PM Review Requires review by a product manager 2: Dev Review Requires review by a core committer labels Sep 13, 2024
@lieut-data lieut-data merged commit a4e5194 into master Sep 13, 2024
15 checks passed
@lieut-data lieut-data deleted the mm-60420-bots-as-run-participants branch September 13, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants