Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit dade41a

Browse files
Merge pull request #6143 from department-of-veterans-affairs/metrics-update-2026-04-17
📊 Update metrics dashboard data - 2026-04-17
2 parents 1743fd2 + 261eb0d commit dade41a

17 files changed

Lines changed: 1446 additions & 649 deletions

__tests__/collect-component-bug-metrics.test.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ describe('Component Bug Metrics Collector', () => {
6868
expect(key).not.toMatch(/^Va[A-Z]/);
6969
}
7070
});
71+
72+
test('includes React-only components via reverse lookup (e.g. VaStatementOfTruth → va-statement-of-truth)', () => {
73+
const usageMap = collector.loadUsageData();
74+
// These components only exist as React variants in the CSV,
75+
// so the reverse lookup must derive the va-* key from VaComponentName.
76+
const reactOnlyComponents = ['va-statement-of-truth', 'va-search-filter'];
77+
reactOnlyComponents.forEach(name => {
78+
if (usageMap.has(name)) {
79+
expect(typeof usageMap.get(name)).toBe('number');
80+
expect(usageMap.get(name)).toBeGreaterThan(0);
81+
}
82+
});
83+
});
7184
});
7285

7386
describe('countBugsByComponent', () => {
@@ -175,8 +188,8 @@ describe('Component Bug Metrics Collector', () => {
175188

176189
const result = collector.buildComponentMetrics(bugCounts, usageMap);
177190

178-
// (3/316)*100 = 0.9493... rounded to 0.95
179-
expect(result[0].defect_rate).toBe(0.95);
191+
// (3/316)*100 = 0.9493... → Math.round(0.9493 * 10) / 10 = 0.9
192+
expect(result[0].defect_rate).toBe(0.9);
180193
});
181194

182195
test('defect_rate is 0 for zero-bug components with usage', () => {

scripts/collect-component-bug-metrics.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,20 @@ function loadUsageData() {
8787
}
8888
});
8989

90+
// Reverse lookup: some components only have React variant rows in the
91+
// CSV (e.g. VaSearchFilter, VaStatementOfTruth) with no corresponding
92+
// va-* web component row. Derive the va-* key and add them.
93+
rawMap.forEach((count, name) => {
94+
if (/^Va[A-Z]/.test(name)) {
95+
// Convert VaComponentName → va-component-name
96+
const vaName = 'va-' + name.replace(/^Va/, '')
97+
.replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '');
98+
if (!usageMap.has(vaName)) {
99+
usageMap.set(vaName, count);
100+
}
101+
}
102+
});
103+
90104
console.log(`Loaded usage data for ${usageMap.size} component tags from CSV`);
91105
} catch (error) {
92106
console.warn('Could not load ds-components-latest.csv:', error.message);

src/_data/metrics/component-bug-metrics.json

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
{
1111
"name": "va-radio",
1212
"bug_count": 5,
13-
"usage_count": 141,
13+
"usage_count": 142,
1414
"defect_rate": 3.5,
1515
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-radio"
1616
},
1717
{
1818
"name": "va-alert",
1919
"bug_count": 4,
20-
"usage_count": 966,
20+
"usage_count": 976,
2121
"defect_rate": 0.4,
2222
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-alert"
2323
},
@@ -38,7 +38,7 @@
3838
{
3939
"name": "va-button",
4040
"bug_count": 3,
41-
"usage_count": 522,
41+
"usage_count": 525,
4242
"defect_rate": 0.6,
4343
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-button"
4444
},
@@ -87,24 +87,10 @@
8787
{
8888
"name": "va-modal",
8989
"bug_count": 2,
90-
"usage_count": 172,
90+
"usage_count": 173,
9191
"defect_rate": 1.2,
9292
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-modal"
9393
},
94-
{
95-
"name": "va-progress-bar",
96-
"bug_count": 2,
97-
"usage_count": 11,
98-
"defect_rate": 18.2,
99-
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-progress-bar"
100-
},
101-
{
102-
"name": "va-statement-of-truth",
103-
"bug_count": 2,
104-
"usage_count": null,
105-
"defect_rate": null,
106-
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-statement-of-truth"
107-
},
10894
{
10995
"name": "va-table",
11096
"bug_count": 2,
@@ -122,21 +108,21 @@
122108
{
123109
"name": "va-additional-info",
124110
"bug_count": 1,
125-
"usage_count": 457,
111+
"usage_count": 455,
126112
"defect_rate": 0.2,
127113
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-additional-info"
128114
},
129115
{
130116
"name": "va-alert-expandable",
131117
"bug_count": 1,
132-
"usage_count": 32,
133-
"defect_rate": 3.1,
118+
"usage_count": 31,
119+
"defect_rate": 3.2,
134120
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-alert-expandable"
135121
},
136122
{
137123
"name": "va-card",
138124
"bug_count": 1,
139-
"usage_count": 177,
125+
"usage_count": 176,
140126
"defect_rate": 0.6,
141127
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-card"
142128
},
@@ -157,24 +143,45 @@
157143
{
158144
"name": "va-icon",
159145
"bug_count": 1,
160-
"usage_count": 374,
146+
"usage_count": 376,
161147
"defect_rate": 0.3,
162148
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-icon"
163149
},
164150
{
165151
"name": "va-link",
166152
"bug_count": 1,
167-
"usage_count": 1366,
153+
"usage_count": 1381,
168154
"defect_rate": 0.1,
169155
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-link"
170156
},
157+
{
158+
"name": "va-on-this-page",
159+
"bug_count": 1,
160+
"usage_count": 26,
161+
"defect_rate": 3.8,
162+
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-on-this-page"
163+
},
164+
{
165+
"name": "va-progress-bar",
166+
"bug_count": 1,
167+
"usage_count": 11,
168+
"defect_rate": 9.1,
169+
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-progress-bar"
170+
},
171171
{
172172
"name": "va-search-filter",
173173
"bug_count": 1,
174174
"usage_count": null,
175175
"defect_rate": null,
176176
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-search-filter"
177177
},
178+
{
179+
"name": "va-statement-of-truth",
180+
"bug_count": 1,
181+
"usage_count": null,
182+
"defect_rate": null,
183+
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-statement-of-truth"
184+
},
178185
{
179186
"name": "va-summary-box",
180187
"bug_count": 1,
@@ -255,8 +262,8 @@
255262
{
256263
"name": "va-details",
257264
"bug_count": 0,
258-
"usage_count": null,
259-
"defect_rate": null,
265+
"usage_count": 2,
266+
"defect_rate": 0,
260267
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-details"
261268
},
262269
{
@@ -276,14 +283,14 @@
276283
{
277284
"name": "va-link-action",
278285
"bug_count": 0,
279-
"usage_count": 207,
286+
"usage_count": 208,
280287
"defect_rate": 0,
281288
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-link-action"
282289
},
283290
{
284291
"name": "va-loading-indicator",
285292
"bug_count": 0,
286-
"usage_count": 425,
293+
"usage_count": 428,
287294
"defect_rate": 0,
288295
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-loading-indicator"
289296
},
@@ -329,13 +336,6 @@
329336
"defect_rate": 0,
330337
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-omb-info"
331338
},
332-
{
333-
"name": "va-on-this-page",
334-
"bug_count": 0,
335-
"usage_count": 26,
336-
"defect_rate": 0,
337-
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-on-this-page"
338-
},
339339
{
340340
"name": "va-pagination",
341341
"bug_count": 0,
@@ -353,7 +353,7 @@
353353
{
354354
"name": "va-process-list",
355355
"bug_count": 0,
356-
"usage_count": 115,
356+
"usage_count": 116,
357357
"defect_rate": 0,
358358
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-process-list"
359359
},
@@ -381,7 +381,7 @@
381381
{
382382
"name": "va-select",
383383
"bug_count": 0,
384-
"usage_count": 59,
384+
"usage_count": 60,
385385
"defect_rate": 0,
386386
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-select"
387387
},
@@ -423,19 +423,19 @@
423423
{
424424
"name": "va-telephone",
425425
"bug_count": 0,
426-
"usage_count": 855,
426+
"usage_count": 865,
427427
"defect_rate": 0,
428428
"github_url": "https://github.com/department-of-veterans-affairs/vets-design-system-documentation/issues?q=is:issue+is:open+label:bug+label:va-telephone"
429429
}
430430
],
431431
"summary": {
432-
"total_components_with_bugs": 28,
433-
"total_bug_issues": 97,
432+
"total_components_with_bugs": 29,
433+
"total_bug_issues": 95,
434434
"total_components": 61,
435435
"highest_defect_rate_component": "va-header-minimal",
436436
"most_bugs_component": "va-memorable-date",
437-
"last_updated": "2026-04-10T18:24:08.161Z"
437+
"last_updated": "2026-04-17T18:24:31.506Z"
438438
},
439439
"data_source": "github-issues",
440-
"report_date": "2026-04-10"
440+
"report_date": "2026-04-17"
441441
}

0 commit comments

Comments
 (0)