Skip to content

Add ability to triage issues/merge requests with threads/discussions

Related to gitlab-org/quality/triage-ops#531 (closed) and https://gitlab.com/gitlab-org/gitlab-triage/-/issues/195

This change adds ability to triage issues/merge requests when given resource has more than certain amount of user notes or threads. This change also adds ability to query GraphQL API to fetch additional information about resources.

Example of policies:

resource_rules:
  issues:
    rules:
      - name: Comment MRs with more than 1 user note
        conditions:
          discussions:
            attribute: threads
            condition: greater_than
            threshold: 15
        actions:
          comment: |
            This MR has lots of comments
    summaries:
      - name: Most commented MRs
        actions:
          summarize:
            title: "Most commented {{type}} summary"
            summary: |
              Please triage the following {{type}}:

              {{items}}

              Please take care of them before the end of #{7.days.from_now.strftime('%Y-%m-%d')}

              /label ~"needs attention"
        rules:
          - name: Most commented
            conditions:
              discussions:
                attribute: threads
                condition: greater_than
                threshold: 15
            actions:
              summarize:
                item: "- [ ] [{{title}}]({{web_url}}) {{labels}}"
                summary: "Please triage the following new {{type}}:\n\n{{items}}"
Edited by Kyle Wiebers

Merge request reports