Skip to content

fix(roadmap-planner): drop invalid components from DORA metrics#201

Open
yhuan123 wants to merge 1 commit into
AlaudaDevops:mainfrom
yhuan123:fix/dora-invalid-components-main
Open

fix(roadmap-planner): drop invalid components from DORA metrics#201
yhuan123 wants to merge 1 commit into
AlaudaDevops:mainfrom
yhuan123:fix/dora-invalid-components-main

Conversation

@yhuan123

@yhuan123 yhuan123 commented Jun 4, 2026

Copy link
Copy Markdown

Problem

The component dimension of DORA metrics is polluted by two classes of invalid data:

  1. Unparsable version namesparseVersionName fell back to the whole version name when no component-X.Y.Z pattern matched, so legacy names like 0.3, v2.1, 1.0 each became a bogus component bucket in release_frequency / patch_ratio / lead_time.
  2. v3-era plugins (plan D6, previously unimplemented) — katanomi / knative / jenkins / tekton-operator releases diluted v4 team metrics.

Fix

  • parseVersionName returns an empty component instead of the whole-name fallback.
  • New metrics.exclude_plugins config (implements D6); Collector.dropInvalidComponentReleases drops releases with empty or excluded components right after the existing name_regex filter, so every calculator and the versionDates maps stay clean from one place. dropExcludedComponents strips D6 plugins from issue/epic component lists (cycle_time, time_to_patch, lead_time).
  • release_frequency / patch_ratio keep a defense line: component == "" is skipped instead of bucketed to "unknown".

Note: the same defense line for the Phase 2 lead_time.go rewrite ships with #197 (the calculator there is rewritten on that branch); on main, lead_time groups by issue components which are already cleaned by the collector.

Tests

  • TestParseVersionName — 9 boundary cases incl. 0.3, v2.1, Sprint 2024.
  • TestDropInvalidComponentReleases / TestDropExcludedComponents — both invalid classes.
  • TestReleaseFrequency_SkipsEmptyComponentReleases, TestPatchRatio_SkipsEmptyComponentReleases — lock the calculator guards against silent revert.
  • go test ./internal/metrics/... and go vet pass.

Accepted limitation

An issue whose only components are excluded v3 plugins still lands in the pre-existing "unknown" bucket of issue-based metrics (documented behavior in METRICS.md) rather than disappearing. Release-side metrics drop such data entirely.

Deployment note

exclude_plugins defaults to empty — production config must set it (see config.example.yaml) for the D6 exclusion to take effect.

🤖 Generated with Claude Code

- parseVersionName no longer falls back to the whole version name —
  legacy names ("0.3", "v2.1") stop polluting component buckets
- new metrics.exclude_plugins config (D6): v3-era plugins (katanomi,
  knative, jenkins, tekton-operator) dropped from all component
  dimensions at collection time
- calculators skip component=="" instead of bucketing to "unknown"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant