Hamburger Cross Icon
Ticket Coverage Collector - Lunar Collector

Ticket Coverage Collector

Collector Experimental Vcs

Record what share of a component's recent pull requests referenced an issue-tracker ticket. Runs on the default branch over Lunar's own history, so change-management coverage reads as a trend on the component rather than only as a verdict on each individual pull request.

Add ticket-coverage to your lunar-config.yml:
uses: github://earthly/lunar-lib/collectors/ticket-coverage@v1.0.5

What This Integration Collects

This integration includes 1 collector that gather metadata from your systems.

Collector code

ticket-coverage

Runs on the default branch. Queries Lunar's SQL API for the pull requests recorded against this component within a trailing window, counts how many carried a resolved ticket id at .vcs.pr.ticket.id, and writes the totals and percentage to .vcs.ticket_coverage. Default-branch by design: every Lunar rollup reads default-branch state only, so per-PR ticket results never reach an initiative score. This turns that history into a default-branch fact, so ticket coverage can be scored. Reads only Lunar's own data — no issue-tracker or Git-platform API call and no token, so it behaves the same on any Git platform. Skips rather than fails when it cannot produce a number: in PR context, or when the SQL API is unreachable.

ticket change management coverage adoption trend default branch
Book a demo

How Collectors Fit into Lunar

Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.

Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.

Learn How Lunar Works
1
Collectors Gather Data This Integration
Triggered by code changes or CI pipelines, collectors extract metadata from config files, tool outputs, test results, and scans
2
{ } Centralized as JSON
All data merged into each component's unified metadata document
3
Guardrails Enforce Standards
Real-time feedback in PRs and AI workflows

Example Collected Data

This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:

{ } component.json Component JSON
{
  "vcs": {
    "ticket_coverage": {
      "window_days": 30,
      "prs_total": 24,
      "prs_with_ticket": 21,
      "percentage": 87.5
    }
  }
}

Configuration

Configure this collector in your lunar-config.yml.

Inputs

Input Required Default Description
window_days Optional 30 Trailing window, in days, over which to measure ticket coverage. A window shorter than the component's release cadence will often contain no pull requests, and the metric skips rather than reporting a misleading zero.

Documentation

View on GitHub

Ticket Coverage Collector

Record what share of a component's recent pull requests referenced an issue-tracker ticket.

Overview

Per-PR ticket checks answer "did this pull request link a ticket?". This collector answers "how consistently does this component link tickets at all?" — it runs on the default branch and asks Lunar's SQL API what fraction of the component's recent pull requests carried a resolved ticket id. That placement is the point: every Lunar rollup reads default-branch state only, so per-PR results never reach an initiative score, and a component with a spotless linking record can still score zero. It reads only Lunar's own data — no issue-tracker or Git-platform API call and no token — so it behaves the same on any Git platform.

Collected Data

Path Type Description
.vcs.ticket_coverage.window_days number Trailing window the metric was computed over, in days
.vcs.ticket_coverage.prs_total number Distinct pull requests recorded for this component in the window
.vcs.ticket_coverage.prs_with_ticket number How many of those carried a resolved ticket id
.vcs.ticket_coverage.percentage number | null prs_with_ticket / prs_total as a percentage; null when the window holds no pull requests

Collectors

Collector Description
ticket-coverage Runs on the default branch. Queries the SQL API for the component's pull requests in the trailing window and writes the coverage totals and percentage. Skips in pull-request context and when the SQL API is unreachable. An empty window is recorded with a null percentage rather than skipped, so "no pull requests in the window" stays distinguishable from "this collector never ran" — the policy skips on it either way.

Installation

collectors:
  - uses: github://earthly/lunar-lib/collectors/ticket-coverage@main
    with:
      window_days: "30"

Requires a per-PR ticket collector such as jira or linear — this aggregates the .vcs.pr.ticket.id those write, so without one there is nothing to aggregate.

The window is bounded by the hub's own history: a freshly installed hub reports on the pull requests seen since install, not the repository's full past. And a window shorter than the component's release cadence will often be empty, in which case the metric skips rather than reporting a misleading zero — widen window_days for low-traffic components.

Open Source

This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.

View Repository

Ready to Automate Your Standards?

See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 200+ built-in guardrails.

Works with any process
check AI agent rules & prompt files
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Paste your AGENTS.md or manual process doc and get guardrails in minutes
Book a Demo