def add_action()

in bugbot/rules/inactive_ni_pending.py [0:0]


    def add_action(self, bug):
        users_num = len(set([flag["requestee"] for flag in bug["inactive_ni"]]))

        if bug["action"] == NeedinfoAction.FORWARD:
            autofix = {
                "flags": (
                    self._clear_inactive_ni_flags(bug)
                    + self._needinfo_triage_owner_flag(bug)
                ),
                "comment": {
                    "body": (
                        f'Redirect { plural("a needinfo that is", bug["inactive_ni"], "needinfos that are") } pending on { plural("an inactive user", users_num, "inactive users") } to the triage owner.'
                        f'\n:{ bug["triage_owner_nic"] }, {self._request_from_triage_owner(bug)}'
                    )
                },
            }

        elif bug["action"] == NeedinfoAction.CLEAR:
            autofix = {
                "flags": self._clear_inactive_ni_flags(bug),
                "comment": {
                    "body": (
                        f'Clear { plural("a needinfo that is", bug["inactive_ni"], "needinfos that are") } pending on { plural("an inactive user", users_num, "inactive users") }.'
                        "\n\nInactive users most likely will not respond; "
                        "if the missing information is essential and cannot be collected another way, "
                        "the bug maybe should be closed as `INCOMPLETE`."
                    ),
                },
            }

        elif bug["action"] == NeedinfoAction.CLOSE_BUG:
            autofix = {
                "flags": self._clear_inactive_ni_flags(bug),
                "status": "RESOLVED",
                "resolution": "INCOMPLETE",
                "comment": {
                    "body": (
                        "A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. "
                        "Given that the bug is still `UNCONFIRMED`, closing the bug as incomplete."
                    )
                },
            }

        autofix["comment"]["body"] += f"\n\n{self.get_documentation()}\n"
        self.add_prioritized_action(bug, bug["triage_owner"], autofix=autofix)