leasAdd support for type: custom in summary rules

What does this MR do?

Closes #395 (closed)

Adds support for type: custom in summary rules, allowing summaries to be generated without fetching GitLab resources. This is useful for including external data sources (like ClickHouse, Prometheus, custom APIs) in triage reports.

Implementation

  1. Skip resource fetching: When type: custom is specified in a rule, Engine#resources_for_rule skips the fetch_resources call entirely
  2. Always valid: Modified SummaryBuilder#valid? to allow custom summaries to be valid without requiring resources
  3. Backward compatible: Existing policies work unchanged - type is optional and defaults to standard behavior

Example usage

resource_rules:
  issues:
    summaries:
      - name: Weekly Report
        rules:
          - name: Bug Heatmap
            conditions:
              labels:
                - bug
            actions:
              summarize:
                title: "Bugs"
                item: "- {{title}}"
                summary: "{{items}}"
          
          - name: Quarantined Tests
            type: custom  # Skip resource fetching
            actions:
              summarize:
                title: "Quarantined Tests"
                summary: |
                  #{ fetch_quarantined_tests_from_clickhouse() }
        actions:
          summarize:
            title: "Weekly Report"
            summary: "{{items}}"

Proof of work

See gitlab-org/quality/triage-ops!3812 (closed)

Edited by David Dieulivol

Merge request reports

Loading