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
-
Skip resource fetching: When
type: customis specified in a rule,Engine#resources_for_ruleskips thefetch_resourcescall entirely -
Always valid: Modified
SummaryBuilder#valid?to allow custom summaries to be valid without requiring resources -
Backward compatible: Existing policies work unchanged -
typeis 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
Edited by David Dieulivol