Skip to content

Allow users to be marked as service users in the database

Problem to solve

Code Review Analytics is currently unable to ignore comments from non-human users like DangerBot, because there is no way to distinguish non-human users from human users. We want to fix that for the gitlab project as part of our effort to learn more about service users.

Further details

This would be a very small change, and would only be used internally at GitLab.

Revised proposal v2

  • Allow User records to be marked as a ServiceUser using a user_type enum column in the database. See detailed discussion if needed.
  • Update @gitlab-bot to be a service user.

Revised proposal

  • Allow User records to be marked as a service_user using a boolean column in the database. (Not using the bot_type attribute due to unexpected side effects, and not adding UI because this is not intended to be user-facing.)
  • Update @gitlab-bot as a service_user.

Original proposal

  • Allow User records to be marked as a non-human users via database queries (no UI). That could be accomplished by adding a 4th bot_type enum value like custom.
  • Make a list of users in gitlab-org that should be marked as non-human users (to be used to update the records after this change is released).

Permissions and Security

This "feature" would require console or database access, so would be limited to admins.

Documentation

This feature would be deliberately un-documented, because it is only for internal GitLab use at this time.

What does success look like, and how can we measure that?

Success is when Code Review Analytics for the gitlab project ignores all comments by non-human users.

Links / references

This is a reduced solution to the problem compared to the proposal to Allow admins to mark Users as service users, courtesy of @tipyn.

Usage

user.update(user_type: 4)
Edited by Pavel Shutsin