Fix custom rule content_available? to check for non-empty description

Context

Custom type rules were always considered to have content available, even when their summary template produced empty output (e.g., when the Ruby method returned nil). This caused parent summary reports to be created even when no child rules had actual content.

This issue was discovered in triage-ops where a ClickHouse-based quarantine helper returns nil when there are no quarantined tests. Despite this, reports were created for 75+ teams because content_available? always returned true for custom rules.

Related: gitlab-org/quality/triage-ops!3804 (merged)

What's in this MR?

  • Updates content_available? to check if the description contains any non-whitespace characters for custom rules, similar to how title_present? works
  • Removes unnecessary || false from Regexp#match? calls since match? already returns a boolean
def content_available?
  if @is_custom
    /\S+/.match?(description)
  else
    @resources.any?
  end
end

This ensures custom rules only contribute to parent summaries when they produce actual content.

Proof of Work

See triage-ops MR for complete proof of work: gitlab-org/quality/triage-ops!3846 (merged)

Edited by David Dieulivol

Merge request reports

Loading