GitHub launched a bot for automatic problem moderation

As part of the Issuer project, a bot has been prepared for GitHub that solves the tasks of moderating automatically the tracking system on GitHub. On GitHub you can find repositories whose sole function is to coordinate people through the Issue system.

In some of them, when exiting Issue you are prompted to fill out a form, then I sawhave a moderator, check the correctness of completing the form and post tags according to those specified in the form (tags can only be hung by a privileged user if they are not specified in the template). An example of such a community is the Open Source Ideas community.

The moderator does not come instantly. Therefore, A GitHub action featured in the news has been prepared to validate forms and perform operations.

The bot is written in Python, but it still needs to be run through node.js, since GitHub only has 2 types of actions: node.js and docker and for docker, first the same container as node.js is loaded and it is loaded into the other container that It is long.

Considering that python3 and everything you need is in the container with node.js, it is rational to just load the dependencies into it as they are small.

This is a GitHub action with 3 functions connected for problem management.

Check if incoming problems match template in any way:

That the sections do not contain lines from the default template (usually present when a user has not bothered to complete the section).

That the sections containing checkboxes to be set as labels contain only the checkboxes present in the original template

That each section has a number of boxes marked in the range [min, max]

Set labels according to the checked boxes.

Automatically closes problems if the author has not fixed the problems highlighted by the linter within a certain period of time.

Using a dedicated person to assign labels is a burden, as it is best to allow users to do "self-service." Users can assign some labels to the issues of a restricted subset that can be done through a Markdown extension and checkboxes.

With that when a user checks the checkboxes or radio buttons the bot sets the labels accordingly.

Of the characteristics that stand out of this bot that has been prepared, are the following:

  • The action is controlled by YAML settings and the Markdown templates;
  • A block is added to each Markdown template that describes the conditions for the correct filling of the form and the desired actions;
  • A configuration file with global settings is added;
  • The forms are made up of sections.
  • There are 2 types of sections:
    Free text: The action can verify that the user has bothered to complete something. The meaning of the text is not automatically verified.
    In the checkboxes n number of flags can be requested and / or completed, so that 0 {= m1 {= n {= m2 {= total number of flags in the section.
  • The action verifies that the boxes match the boxes in the template. If the flags are set correctly, the action may hang on the problem tags, resp. Checkboxes.
  • If the form is completed incorrectly, the action instructs the user how to complete it correctly and adds a special tag.
  • If the form is not corrected within a specified time, the action may close the problem. Automatic user ban, removal, and relocation of the issue has yet to be implemented due to the lack of an official API for required actions and issues with storage status.
  • If the problem is fixed, the action removes the mark.
  • The response to action templates are, of course, customizable.

Finally if you are interested in knowing more about it, you can check the details by going to following link


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.