-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1093 lines (988 loc) · 41.8 KB
/
Copy pathindex.html
File metadata and controls
1093 lines (988 loc) · 41.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CodeRabbit Adoption Dashboard - OpenShift Repos</title>
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<style>
:root {
--red: #e74c3c;
--orange: #f39c12;
--green: #27ae60;
--blue: #2980b9;
--dark: #2c3e50;
--light: #ecf0f1;
--gray: #95a5a6;
--purple: #8e44ad;
--teal: #1abc9c;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
background: #f5f6fa;
color: var(--dark);
line-height: 1.5;
}
/* Header */
.header {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
color: white;
padding: 40px 60px;
display: flex;
justify-content: space-between;
align-items: center;
gap: 30px;
}
.header-content {
flex: 1;
text-align: left;
}
.header h1 { font-size: 2.2em; font-weight: 700; margin-bottom: 8px; }
.header .subtitle { font-size: 1.1em; opacity: 0.8; }
.header .date { font-size: 0.9em; opacity: 0.6; margin-top: 8px; }
.header .back-link { color: #93c5fd; text-decoration: none; font-size: 0.85em; }
.header .back-link:hover { text-decoration: underline; }
/* KPI Cards */
.kpi-strip {
display: flex;
gap: 20px;
padding: 30px 60px;
flex-wrap: wrap;
justify-content: center;
margin-top: -20px;
}
.kpi-card {
background: white;
border-radius: 12px;
padding: 24px 32px;
text-align: center;
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
min-width: 150px;
flex: 1;
max-width: 220px;
}
.kpi-card .number { font-size: 2.8em; font-weight: 800; line-height: 1; }
.kpi-card .label {
font-size: 0.82em; color: var(--gray); margin-top: 6px;
text-transform: uppercase; letter-spacing: 0.5px;
}
.kpi-card.red .number { color: var(--red); }
.kpi-card.orange .number { color: var(--orange); }
.kpi-card.blue .number { color: var(--blue); }
.kpi-card.green .number { color: var(--green); }
.kpi-card.purple .number { color: var(--purple); }
.kpi-card.teal .number { color: var(--teal); }
.kpi-card.gray .number { color: var(--gray); }
/* Sections */
.section {
padding: 40px 60px;
max-width: 1400px;
margin: 0 auto;
}
.section h2 {
font-size: 1.6em;
margin-bottom: 8px;
color: var(--dark);
border-left: 4px solid var(--blue);
padding-left: 16px;
}
.section .section-sub {
color: var(--gray);
margin-bottom: 24px;
padding-left: 20px;
font-size: 0.95em;
}
/* Cards / Containers */
.card {
background: white;
border-radius: 12px;
padding: 32px;
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
margin-bottom: 28px;
overflow-x: auto;
}
.card h3 { font-size: 1.15em; margin-bottom: 16px; color: var(--dark); }
.card .mermaid { display: flex; justify-content: center; }
/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 900px) {
.grid-2, .grid-3 { grid-template-columns: 1fr; }
.section { padding: 24px 20px; }
.header { padding: 24px 20px; }
.kpi-strip { padding: 16px 20px; }
}
/* Callouts */
.callout {
border-left: 4px solid;
padding: 16px 20px;
margin: 16px 0;
border-radius: 0 8px 8px 0;
font-size: 0.95em;
}
.callout.danger { border-color: var(--red); background: #fdf0f0; }
.callout.warning { border-color: var(--orange); background: #fef9e7; }
.callout.info { border-color: var(--blue); background: #eaf2f8; }
.callout.success { border-color: var(--green); background: #eafaf1; }
.callout strong { display: block; margin-bottom: 4px; }
/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.tbl th {
background: var(--dark); color: white;
padding: 12px 16px; text-align: left; font-weight: 600;
cursor: pointer; user-select: none;
}
.tbl th:hover { background: #34495e; }
.tbl td { padding: 10px 16px; border-bottom: 1px solid #eee; }
.tbl tr:hover { background: #f8f9fa; }
.tbl td a { color: var(--blue); text-decoration: none; }
.tbl td a:hover { text-decoration: underline; }
/* Badges */
.badge {
display: inline-block; padding: 3px 10px; border-radius: 12px;
font-size: 0.8em; font-weight: 600; color: white;
}
.badge.red { background: var(--red); }
.badge.orange { background: var(--orange); }
.badge.green { background: var(--green); }
.badge.blue { background: var(--blue); }
.badge.gray { background: var(--gray); }
.badge.purple { background: var(--purple); }
.badge.teal { background: var(--teal); }
/* Summary bar */
.bar { display: flex; height: 40px; border-radius: 8px; overflow: hidden; margin: 16px 0; }
.bar div {
display: flex; align-items: center; justify-content: center;
color: white; font-size: 0.82em; font-weight: 600;
}
.legend { display: flex; gap: 20px; margin-top: 8px; font-size: 0.85em; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
/* Filters */
.filter-row {
display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px;
}
.filter-row .flabel {
font-size: 0.8em; color: var(--gray); text-transform: uppercase;
letter-spacing: 0.5px; margin-right: 2px;
}
.filter-btn {
background: white; border: 1px solid #ddd; color: #555;
padding: 5px 14px; border-radius: 6px; cursor: pointer;
font-size: 0.82em; transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.active { background: var(--blue); border-color: var(--blue); color: white; }
.search-box {
border: 1px solid #ddd; padding: 5px 14px; border-radius: 6px;
font-size: 0.82em; width: 200px; outline: none;
}
.search-box:focus { border-color: var(--blue); }
.footer {
text-align: center; padding: 30px; color: var(--gray); font-size: 0.85em;
}
/* Tabs - Segmented Control Style */
.tabs-container {
display: flex;
justify-content: flex-end;
align-items: center;
}
.tab-segment {
display: inline-flex;
background: rgba(255, 255, 255, 0.15);
border-radius: 10px;
padding: 5px;
gap: 5px;
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
backdrop-filter: blur(10px);
}
.tab {
padding: 12px 40px;
cursor: pointer;
font-size: 1em;
font-weight: 600;
color: rgba(255, 255, 255, 0.7);
background: transparent;
border: none;
border-radius: 7px;
transition: all 0.25s ease;
user-select: none;
text-align: center;
white-space: nowrap;
}
.tab:hover {
color: rgba(255, 255, 255, 0.95);
background: rgba(255, 255, 255, 0.1);
}
.tab.active {
color: #2c3e50;
background: white;
box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.1);
}
.tab.active:hover {
color: #1a252f;
}
@media (max-width: 900px) {
.header {
flex-direction: column;
align-items: flex-start;
padding: 24px 20px;
}
.header-content {
text-align: left;
}
.tabs-container {
width: 100%;
justify-content: center;
margin-top: 16px;
}
.tab-segment {
flex-direction: row;
width: auto;
}
.tab {
padding: 10px 24px;
font-size: 0.95em;
}
}
</style>
</head>
<body>
<div class="header">
<div class="header-content">
<h1>CodeRabbit Adoption Dashboard</h1>
<div class="subtitle" id="headerSubtitle"> OpenShift GitHub Repos: Config Files, Active PR Reviews, and Coverage Gaps</div>
<div class="date" id="headerDate">April 2026 | Source: OpenShift Team Repos</div>
</div>
<!-- Tabs Navigation - In header on right side -->
<div class="tabs-container">
<div class="tab-segment">
<div class="tab active" data-tab="openshift">Openshift</div>
<div class="tab" data-tab="eee">EEE</div>
</div>
</div>
</div>
<!-- KPI Strip - populated by JS -->
<div class="kpi-strip" id="kpiStrip"></div>
<!-- SECTION 1: Adoption Overview -->
<div class="section">
<h2>1. CodeRabbit Adoption Overview</h2>
<p class="section-sub">Three categories: repos with active PR reviews, repos with config files, and repos with no CodeRabbit presence</p>
<div class="card">
<h3>Adoption Breakdown</h3>
<div id="adoptionBar"></div>
</div>
<div class="card">
<h3>How CodeRabbit Integrates with Repos</h3>
<pre class="mermaid">
%%{init: {'theme': 'base', 'themeVariables': {'fontSize': '14px', 'primaryColor': '#2980b9', 'primaryTextColor': '#fff', 'lineColor': '#2c3e50'}}}%%
flowchart LR
subgraph REPO["GitHub Repository"]
direction TB
PR["Pull Request Opened"]
CFG[".coderabbit.yaml\n(Optional Config)"]
end
subgraph CR["CodeRabbit AI"]
direction TB
BOT["coderabbitai bot\nAnalyzes PR diff"]
REV["Posts Review Comments\non PR"]
end
subgraph OUT["Outcome"]
direction TB
O1["Automated Code Review"]
O2["Bug Detection"]
O3["Style & Best Practices"]
end
PR --> BOT
CFG -.->|"Customizes\nbehavior"| BOT
BOT --> REV
REV --> O1
REV --> O2
REV --> O3
style REPO fill:#eaf2f8,stroke:#2980b9,color:#2c3e50
style CR fill:#eafaf1,stroke:#27ae60,color:#2c3e50
style OUT fill:#fef9e7,stroke:#f39c12,color:#2c3e50
style PR fill:#2980b9,stroke:#2471a3,color:white
style CFG fill:#8e44ad,stroke:#7d3c98,color:white
style BOT fill:#27ae60,stroke:#229954,color:white
style REV fill:#27ae60,stroke:#229954,color:white
style O1 fill:#f39c12,stroke:#e67e22,color:white
style O2 fill:#f39c12,stroke:#e67e22,color:white
style O3 fill:#f39c12,stroke:#e67e22,color:white
</pre>
</div>
<div id="calloutSection"></div>
</div>
<!-- SECTION: Historical Trends -->
<div class="section">
<h2>📈 Historical Trends & Insights</h2>
<p class="section-sub">Track CodeRabbit adoption progress over the last 1-2 weeks</p>
<div class="grid-2">
<div class="card">
<h3>Fully Active Repositories (Last 2 Weeks)</h3>
<canvas id="fullyActiveChart" style="max-height: 300px;"></canvas>
</div>
<div class="card">
<h3>Total PRs Reviewed (Last 2 Weeks)</h3>
<canvas id="totalPRsChart" style="max-height: 300px;"></canvas>
</div>
</div>
<div class="grid-2">
<div class="card">
<h3>CodeRabbit First Review Rate (Last 2 Weeks)</h3>
<canvas id="firstReviewChart" style="max-height: 300px;"></canvas>
</div>
<div class="card">
<h3>Weekly Summary</h3>
<div id="weeklySummary" style="padding: 20px; font-size: 0.95em;"></div>
</div>
</div>
</div>
<!-- SECTION 2: By Team & Domain -->
<div class="section">
<h2>2. Adoption by Team & Domain</h2>
<p class="section-sub">Which teams and domains have CodeRabbit reviewing their PRs</p>
<div class="grid-2" id="breakdownSection"></div>
</div>
<!-- SECTION 3: By Repo Status -->
<div class="section">
<h2>3. Adoption by Repo Status</h2>
<p class="section-sub">Active, Maintenance, and Deprecated repos compared</p>
<div class="card">
<h3>CodeRabbit Coverage by Repo Status</h3>
<div id="statusBreakdown"></div>
</div>
</div>
<!-- SECTION 4: Full Repo Table -->
<div class="section">
<h2>4. Full Repository Details</h2>
<p class="section-sub">All GitHub repos with CodeRabbit status, config file presence, and PR review activity</p>
<div class="card">
<div class="filter-row">
<span class="flabel">CodeRabbit:</span>
<div id="crFilters"></div>
<span class="flabel" style="margin-left:12px;">Status:</span>
<div id="statusFilters"></div>
<span class="flabel" style="margin-left:12px;">Team:</span>
<div id="teamFilters"></div>
<input type="text" class="search-box" id="searchInput" placeholder="Search repos...">
</div>
<table class="tbl">
<thead>
<tr>
<th data-sort="name">Repository</th>
<th data-sort="has_coderabbit_reviews">PR Reviews</th>
<th data-sort="coderabbit_pr_count">PRs Reviewed</th>
<th data-sort="coderabbit_first_review_count">Bot-First</th>
<th data-sort="has_config">Config File</th>
<th data-sort="category">Category</th>
<th data-sort="status">Status</th>
<th data-sort="team">Team</th>
</tr>
</thead>
<tbody id="repoTableBody"></tbody>
</table>
</div>
</div>
<!-- SECTION 5: Bottom Line -->
<div class="section">
<h2>5. The Bottom Line</h2>
<p class="section-sub">Key findings and recommended actions</p>
<div class="grid-3" id="bottomLine"></div>
</div>
<!-- SECTION 6: Metrics Explanation -->
<div class="section">
<h2>6. Understanding the Metrics</h2>
<p class="section-sub">How bot-first and PRs reviewed are calculated</p>
<div class="grid-2">
<div class="card">
<h3>What is "Bot-First"?</h3>
<p style="margin-bottom: 12px; line-height: 1.6;">
A PR is <strong>"bot-first"</strong> when CodeRabbit reviews <strong>before any human</strong>.
The script compares timestamps of all CodeRabbit activity vs. human activity.
</p>
<div class="callout success" style="margin: 0;">
<strong>✅ Example</strong>
<ul style="margin-top: 8px; margin-left: 20px; line-height: 1.6; font-size: 0.9em;">
<li>CodeRabbit reviews: <code>10:05 AM</code> 👈 First</li>
<li>Human reviews: <code>2:30 PM</code></li>
</ul>
<div style="margin-top: 8px; padding: 6px 10px; background: #d5f4e6; border-radius: 6px; font-size: 0.85em;">
Result: Bot-first ✓
</div>
</div>
<div class="callout warning" style="margin-top: 12px;">
<strong>⚠️ Limitation:</strong> Draft PRs are included but CodeRabbit doesn't review drafts.
Human comments on drafts count as "human first," artificially lowering the bot-first percentage.
</div>
</div>
<div class="card">
<h3>How is "PRs Reviewed" Calculated?</h3>
<div class="callout warning" style="margin-bottom: 12px;">
<strong>⚠️ 50 PR Limit</strong><br>
Only the <strong>50 most recently updated PRs</strong> are analyzed per repo.
<div style="margin-top: 6px; font-size: 0.9em;">
Example: Repo has 100 PRs, all reviewed → metric shows <strong>max 50</strong>
</div>
</div>
<p style="margin-bottom: 12px; line-height: 1.6; font-size: 0.95em;">
A PR counts as "reviewed" if CodeRabbit posted ANY activity: reviews, comments, or walkthrough summaries.
</p>
<div style="background: #f8f9fa; padding: 12px; border-radius: 8px; font-size: 0.9em;">
<strong>Analyzed PRs:</strong> Up to 50 most recent (open + closed + draft)
<div style="margin-top: 6px; color: #555;">
Script fetches 30 closed + 30 open, then takes 50 most recent
</div>
</div>
<div class="callout info" style="margin-top: 12px;">
<strong>Why closed PRs?</strong> Shows complete activity history. Fast-merging repos would show artificially low numbers if only open PRs counted.
</div>
</div>
</div>
</div>
<div class="footer" id="footerText">
CodeRabbit Adoption Dashboard | <span id="footerDate">April 2026</span> | <span id="footerDataSource">Data source: OpenShift Team Repos, GitHub API</span>
</div>
<script>
let allRepos = [];
let activeFilters = { coderabbit: 'all', status: 'all', team: 'all' };
let currentSort = { key: 'name', dir: 'asc' };
let activeTab = 'openshift';
const tabConfig = {
openshift: {
dataFile: 'data/coderabbit-openshift-status.json',
title: 'OpenShift GitHub Repos: Config Files, Active PR Reviews, and Coverage Gaps',
source: 'OpenShift Team Repos'
},
eee: {
dataFile: 'data/coderabbit-EEE-status.json',
title: 'EEE GitHub Repos: Config Files, Active PR Reviews, and Coverage Gaps',
source: 'EEE Team Repos'
}
};
async function init() {
await loadTabData(activeTab);
setupTabListeners();
}
async function loadTabData(tab) {
try {
const config = tabConfig[tab];
const resp = await fetch(config.dataFile);
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const data = await resp.json();
allRepos = data.repos;
// Update header
document.getElementById('headerSubtitle').textContent = config.title;
// Reset filters when switching tabs
activeFilters = { coderabbit: 'all', status: 'all', team: 'all' };
// Render all sections
renderKPIs(data);
renderAdoptionBar(data);
renderCallout(data);
await renderHistoricalTrends(tab, data);
renderBreakdowns();
renderStatusBreakdown();
buildFilters();
renderTable();
renderBottomLine(data);
const dateStr = data.generated_at
? new Date(data.generated_at).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })
: 'April 2026';
document.getElementById('headerDate').textContent = dateStr + ' | Source: ' + config.source;
document.getElementById('footerDate').textContent = dateStr;
document.getElementById('footerDataSource').textContent = 'Data source: ' + config.source + ', GitHub API';
} catch (err) {
document.getElementById('repoTableBody').innerHTML =
`<tr><td colspan="8" style="text-align:center;padding:2rem;color:#e74c3c;">Failed to load data: ${err.message}</td></tr>`;
}
}
let charts = { fullyActive: null, totalPRs: null, firstReview: null };
async function renderHistoricalTrends(tab, currentData) {
try {
// Destroy existing charts
Object.values(charts).forEach(chart => chart?.destroy());
// Load historical data from manifest
const historicalData = [];
try {
// Fetch the manifest file
const manifestResp = await fetch('data/historical-manifest.json');
if (!manifestResp.ok) throw new Error('Manifest not found');
const manifest = await manifestResp.json();
const fileList = tab === 'openshift' ? manifest.openshift : manifest.eee;
// Load each file from the manifest
for (const fileInfo of fileList) {
try {
const resp = await fetch(fileInfo.path);
if (resp.ok) {
const data = await resp.json();
historicalData.push({
timestamp: fileInfo.timestamp,
data: data
});
}
} catch (e) {
console.warn(`Failed to load ${fileInfo.path}:`, e);
}
}
} catch (manifestError) {
console.warn('Manifest not found, using fallback:', manifestError);
// Fallback: try hardcoded list for backward compatibility
const prefix = tab === 'openshift' ? 'coderabbit-openshift-status' : 'coderabbit-EEE-status';
const timestamps = [
'20260525_155422', '20260526_005847', '20260527_012826', '20260527_163914',
'20260528_014438', '20260528_154338', '20260529_014928', '20260529_154137',
'20260530_014719', '20260601_175314', '20260602_033127', '20260602_162000',
'20260603_022035', '20260603_165826', '20260604_031617', '20260605_024918',
'20260605_153335', '20260606_011247'
];
for (const ts of timestamps) {
try {
const resp = await fetch(`data/${prefix}_${ts}.json`);
if (resp.ok) {
const data = await resp.json();
historicalData.push({ timestamp: ts, data });
}
} catch (e) {
// Skip
}
}
}
// Sort by timestamp
historicalData.sort((a, b) => a.timestamp.localeCompare(b.timestamp));
if (historicalData.length === 0) {
document.getElementById('weeklySummary').innerHTML = `
<div class="callout info">
<strong>No historical data available</strong>
Historical trend data will appear here once multiple data snapshots are collected.
</div>
`;
return;
}
// Prepare chart data
const labels = historicalData.map(h => {
const date = h.timestamp.substring(0, 8);
const time = h.timestamp.substring(9, 15);
return `${date.substring(4, 6)}/${date.substring(6, 8)} ${time.substring(0, 2)}:${time.substring(2, 4)}`;
});
const fullyActiveData = historicalData.map(h => h.data.fully_active || 0);
const totalPRsData = historicalData.map(h => h.data.total_prs_reviewed || 0);
const firstReviewPctData = historicalData.map(h => h.data.coderabbit_first_review_pct || 0);
// Create charts
const chartConfig = {
type: 'line',
options: {
responsive: true,
maintainAspectRatio: true,
plugins: {
legend: { display: false }
},
scales: {
y: { beginAtZero: true }
}
}
};
charts.fullyActive = new Chart(document.getElementById('fullyActiveChart'), {
...chartConfig,
data: {
labels,
datasets: [{
label: 'Fully Active Repos',
data: fullyActiveData,
borderColor: '#27ae60',
backgroundColor: 'rgba(39, 174, 96, 0.1)',
fill: true,
tension: 0.3
}]
}
});
charts.totalPRs = new Chart(document.getElementById('totalPRsChart'), {
...chartConfig,
data: {
labels,
datasets: [{
label: 'Total PRs Reviewed',
data: totalPRsData,
borderColor: '#2980b9',
backgroundColor: 'rgba(41, 128, 185, 0.1)',
fill: true,
tension: 0.3
}]
}
});
charts.firstReview = new Chart(document.getElementById('firstReviewChart'), {
...chartConfig,
data: {
labels,
datasets: [{
label: 'First Review %',
data: firstReviewPctData,
borderColor: '#8e44ad',
backgroundColor: 'rgba(142, 68, 173, 0.1)',
fill: true,
tension: 0.3
}]
},
options: {
...chartConfig.options,
scales: {
y: { beginAtZero: true, max: 100 }
}
}
});
// Calculate weekly summary
const oneWeekAgo = historicalData.length >= 7 ? historicalData[historicalData.length - 7] : historicalData[0];
const latest = historicalData[historicalData.length - 1];
const fullyActiveDiff = latest.data.fully_active - oneWeekAgo.data.fully_active;
const prsDiff = latest.data.total_prs_reviewed - oneWeekAgo.data.total_prs_reviewed;
const firstReviewDiff = latest.data.coderabbit_first_review_pct - oneWeekAgo.data.coderabbit_first_review_pct;
document.getElementById('weeklySummary').innerHTML = `
<div style="margin-bottom: 16px;">
<strong style="font-size: 1.1em; color: var(--dark);">Last Week's Progress</strong>
</div>
<div style="display: flex; flex-direction: column; gap: 12px;">
<div style="display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee;">
<span>Fully Active Repos</span>
<span style="font-weight: 600; color: ${fullyActiveDiff >= 0 ? 'var(--green)' : 'var(--red)'}">
${fullyActiveDiff > 0 ? '+' : ''}${fullyActiveDiff}
<span style="font-size: 0.85em; color: var(--gray); margin-left: 4px;">
(${oneWeekAgo.data.fully_active} → ${latest.data.fully_active})
</span>
</span>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee;">
<span>Total PRs Reviewed</span>
<span style="font-weight: 600; color: ${prsDiff >= 0 ? 'var(--green)' : 'var(--red)'}">
${prsDiff > 0 ? '+' : ''}${prsDiff}
<span style="font-size: 0.85em; color: var(--gray); margin-left: 4px;">
(${oneWeekAgo.data.total_prs_reviewed} → ${latest.data.total_prs_reviewed})
</span>
</span>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; padding: 8px 0;">
<span>First Review Rate</span>
<span style="font-weight: 600; color: ${firstReviewDiff >= 0 ? 'var(--green)' : 'var(--red)'}">
${firstReviewDiff > 0 ? '+' : ''}${firstReviewDiff.toFixed(1)}%
<span style="font-size: 0.85em; color: var(--gray); margin-left: 4px;">
(${oneWeekAgo.data.coderabbit_first_review_pct}% → ${latest.data.coderabbit_first_review_pct}%)
</span>
</span>
</div>
</div>
<div style="margin-top: 16px; padding: 12px; background: #f8f9fa; border-radius: 6px; font-size: 0.9em; color: var(--gray);">
<strong>Data points:</strong> ${historicalData.length} snapshots over ${Math.ceil((new Date(latest.timestamp.replace('_', 'T')) - new Date(historicalData[0].timestamp.replace('_', 'T'))) / (1000 * 60 * 60 * 24))} days
</div>
`;
} catch (err) {
console.error('Error rendering historical trends:', err);
document.getElementById('weeklySummary').innerHTML = `
<div class="callout warning">
<strong>Unable to load historical data</strong>
${err.message}
</div>
`;
}
}
function setupTabListeners() {
document.querySelectorAll('.tab').forEach(tab => {
tab.addEventListener('click', async () => {
const tabName = tab.dataset.tab;
if (tabName === activeTab) return;
// Update active tab
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
tab.classList.add('active');
activeTab = tabName;
// Load new data
await loadTabData(tabName);
});
});
}
function renderKPIs(data) {
const active = allRepos.filter(r => r.status === 'Active');
const activeReviewing = active.filter(r => r.has_coderabbit_reviews);
const pct = data.total > 0 ? Math.round(data.has_reviews_total / data.total * 100) : 0;
const totalPRs = data.total_prs_reviewed || 0;
const crFirst = data.total_coderabbit_first_reviews || 0;
const crFirstPct = data.coderabbit_first_review_pct || 0;
document.getElementById('kpiStrip').innerHTML = `
<div class="kpi-card blue"><div class="number">${data.total}</div><div class="label">Total GitHub Repos</div></div>
<div class="kpi-card green"><div class="number">${data.has_reviews_total}</div><div class="label">Active Repos</div></div>
<div class="kpi-card red"><div class="number">${data.not_configured}</div><div class="label">No CodeRabbit</div><div style="font-size:0.7em;color:#999;margin-top:6px;line-height:1.4;">9 Repos Archived<br>3 Repos CR Installation WIP</div></div>
<div class="kpi-card orange"><div class="number">${crFirst}</div><div class="label">CodeRabbit FirstPass Review</div></div>
<div class="kpi-card teal"><div class="number">${crFirstPct}%</div><div class="label">Bot-First Rate</div></div>
<div class="kpi-card purple"><div class="number">${data.has_config_total}</div><div class="label">Have Config File</div></div>
<div class="kpi-card gray"><div class="number">${totalPRs}</div><div class="label">Total PRs Reviewed</div></div>
`;
}
function renderAdoptionBar(data) {
const pctFull = (data.fully_active / data.total * 100) || 0;
const pctRevOnly = (data.reviewing_no_config / data.total * 100) || 0;
const pctCfgOnly = (data.config_no_reviews / data.total * 100) || 0;
const pctNone = (data.not_configured / data.total * 100) || 0;
let barHtml = '<div class="bar">';
if (pctFull > 0) barHtml += `<div style="width:${pctFull}%;background:var(--green);">${data.fully_active} Full</div>`;
if (pctRevOnly > 0) barHtml += `<div style="width:${pctRevOnly}%;background:var(--teal);">${data.reviewing_no_config} Reviewing</div>`;
if (pctCfgOnly > 0) barHtml += `<div style="width:${pctCfgOnly}%;background:var(--purple);">${data.config_no_reviews} Config Only</div>`;
barHtml += `<div style="width:${pctNone}%;background:var(--red);">${data.not_configured} None</div>`;
barHtml += '</div>';
barHtml += `<div class="legend">
<div class="legend-item"><div class="legend-dot" style="background:var(--green)"></div> Fully Active: config + reviewing (${data.fully_active})</div>
<div class="legend-item"><div class="legend-dot" style="background:var(--teal)"></div> Reviewing PRs, no config file (${data.reviewing_no_config})</div>
<div class="legend-item"><div class="legend-dot" style="background:var(--purple)"></div> Config file only, no reviews (${data.config_no_reviews})</div>
<div class="legend-item"><div class="legend-dot" style="background:var(--red)"></div> No CodeRabbit at all (${data.not_configured})</div>
</div>`;
document.getElementById('adoptionBar').innerHTML = barHtml;
}
function renderCallout(data) {
const reviewing = data.has_reviews_total;
const noConfig = data.reviewing_no_config;
const none = data.not_configured;
const totalPRs = data.total_prs_reviewed || 0;
const crFirst = data.total_coderabbit_first_reviews || 0;
const crFirstPct = data.coderabbit_first_review_pct || 0;
let html = '';
if (crFirst > 0 && totalPRs > 0) {
html += `<div class="callout info">
<strong>🤖 CodeRabbit reviewed ${crFirst} of ${totalPRs} PRs BEFORE any human reviewer (${crFirstPct}%)</strong>
In these PRs, CodeRabbit provided the first code review, catching potential issues before human reviewers
even looked at the code. This demonstrates CodeRabbit's value in providing immediate, automated feedback
and reducing the initial review burden on human maintainers.
</div>`;
}
if (noConfig > 0) {
html += `<div class="callout warning">
<strong>${noConfig} repos have CodeRabbit reviewing PRs but no .coderabbit.yaml config file</strong>
These repos benefit from CodeRabbit's default Red Hat Organization setting. Adding a <code>.coderabbit.yaml</code> file
would allow teams to customize review rules, ignore paths, set review language, and fine-tune the AI reviewer.
</div>`;
}
if (none > 0) {
html += `<div class="callout danger">
<strong>${none} of ${data.total} repos (${Math.round(none/data.total*100)}%) have no CodeRabbit presence</strong>
These repos receive no automated AI code review on pull requests. Enabling CodeRabbit
can catch bugs, enforce patterns, and reduce review burden for maintainers.
</div>`;
}
if (reviewing > 0) {
html += `<div class="callout success">
<strong>${reviewing} repos already have CodeRabbit actively reviewing PRs</strong>
The coderabbitai bot is posting review comments on pull requests in these repositories,
providing automated code analysis and suggestions.
</div>`;
}
document.getElementById('calloutSection').innerHTML = html;
}
function renderBreakdowns() {
// By Team
const teamData = {};
const domainData = {};
allRepos.forEach(r => {
const t = r.team;
if (!t) return;
if (!teamData[t]) teamData[t] = { total: 0, reviewing: 0 };
teamData[t].total++;
if (r.has_coderabbit_reviews) teamData[t].reviewing++;
const d = r.domain && r.domain !== 'None' ? r.domain : 'None';
if (d !== 'None') {
if (!domainData[d]) domainData[d] = { total: 0, reviewing: 0 };
domainData[d].total++;
if (r.has_coderabbit_reviews) domainData[d].reviewing++;
}
});
const maxTeam = Math.max(...Object.values(teamData).map(v => v.total), 1);
const maxDomain = Math.max(...Object.values(domainData).map(v => v.total), 1);
function makeBarRows(data, max, colorReview, colorTotal) {
return Object.entries(data)
.sort((a,b) => b[1].total - a[1].total)
.map(([k, v]) => {
const pct = v.reviewing / Math.max(v.total, 1) * 100;
return `<div style="display:flex;align-items:center;margin-bottom:8px;font-size:0.9em;">
<span style="width:150px;flex-shrink:0;color:#555;">${k}</span>
<div style="flex:1;height:22px;background:#eee;border-radius:4px;overflow:hidden;margin:0 8px;position:relative;">
<div style="height:100%;width:${v.total/max*100}%;background:${colorTotal};border-radius:4px;position:absolute;"></div>
<div style="height:100%;width:${v.reviewing/max*100}%;background:${colorReview};border-radius:4px;position:absolute;"></div>
</div>
<span style="width:60px;text-align:right;font-weight:600;color:#555;font-size:0.85em;">${v.reviewing}/${v.total}</span>
</div>`;
}).join('');
}
document.getElementById('breakdownSection').innerHTML = `
<div class="card">
<h3>CodeRabbit Adoption by Team</h3>
<div style="margin-bottom:12px;">
<div class="legend">
<div class="legend-item"><div class="legend-dot" style="background:var(--teal)"></div> Reviewing PRs</div>
<div class="legend-item"><div class="legend-dot" style="background:#ddd"></div> Total repos</div>
</div>
</div>
${makeBarRows(teamData, maxTeam, 'var(--teal)', '#ddd')}
</div>
`;
}
function renderStatusBreakdown() {
const statusData = {};
allRepos.forEach(r => {
const s = r.status || 'Unknown';
if (!statusData[s]) statusData[s] = { total: 0, reviewing: 0, config: 0, none: 0 };
statusData[s].total++;
if (r.has_coderabbit_reviews) statusData[s].reviewing++;
if (r.has_config) statusData[s].config++;
if (!r.has_coderabbit_reviews && !r.has_config) statusData[s].none++;
});
const statusColors = { 'Active': 'var(--green)', 'Maintenance': 'var(--orange)', 'Deprecated': 'var(--red)' };
let html = '';
Object.entries(statusData).sort((a,b) => b[1].total - a[1].total).forEach(([status, d]) => {
const pctReviewing = d.total > 0 ? (d.reviewing / d.total * 100).toFixed(0) : 0;
const pctNone = d.total > 0 ? (d.none / d.total * 100).toFixed(0) : 0;
const barColor = statusColors[status] || 'var(--blue)';
html += `
<div style="margin-bottom:20px;">
<div style="display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px;">
<span style="font-weight:600;font-size:1em;">${status}</span>
<span style="font-size:0.85em;color:var(--gray);">${d.reviewing} reviewing / ${d.total} total (${pctReviewing}% adoption)</span>
</div>
<div class="bar" style="height:28px;margin:4px 0;">
${d.reviewing > 0 ? `<div style="width:${d.reviewing/d.total*100}%;background:var(--teal);">${d.reviewing}</div>` : ''}
${d.config > 0 ? `<div style="width:${(d.config-d.reviewing)/d.total*100}%;background:var(--purple);">${d.config}</div>` : ''}
${d.none > 0 ? `<div style="width:${d.none/d.total*100}%;background:#ddd;color:#555;">${d.none}</div>` : ''}
</div>
</div>`;
});
document.getElementById('statusBreakdown').innerHTML = html;
}
// Filters
function buildFilters() {
const crOptions = ['Reviewing PRs', 'Has Config', 'No CodeRabbit'];
const statuses = [...new Set(allRepos.map(r => r.status).filter(Boolean))].sort();
const teams = [...new Set(allRepos.map(r => r.team).filter(Boolean))].sort();
renderFilterGroup('crFilters', 'coderabbit', crOptions);
renderFilterGroup('statusFilters', 'status', statuses);
renderFilterGroup('teamFilters', 'team', teams);
}
function renderFilterGroup(containerId, key, values) {
const container = document.getElementById(containerId);
let html = `<button class="filter-btn active" data-key="${key}" data-value="all">All</button>`;
values.forEach(v => { html += `<button class="filter-btn" data-key="${key}" data-value="${v}">${v}</button>`; });
container.innerHTML = html;
container.querySelectorAll('.filter-btn').forEach(btn => {
btn.addEventListener('click', () => {
activeFilters[btn.dataset.key] = btn.dataset.value;
container.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
renderTable();
});
});
}
function getFilteredRepos() {
const search = document.getElementById('searchInput').value.toLowerCase();
return allRepos.filter(r => {
if (activeFilters.coderabbit === 'Reviewing PRs' && !r.has_coderabbit_reviews) return false;
if (activeFilters.coderabbit === 'Has Config' && !r.has_config) return false;
if (activeFilters.coderabbit === 'No CodeRabbit' && (r.has_coderabbit_reviews || r.has_config)) return false;
if (activeFilters.status !== 'all' && r.status !== activeFilters.status) return false;
if (activeFilters.team !== 'all' && r.team !== activeFilters.team) return false;
if (search && !r.name.toLowerCase().includes(search)) return false;
return true;
});
}
function sortRepos(repos) {
return [...repos].sort((a, b) => {
let va = a[currentSort.key];
let vb = b[currentSort.key];
if (va === undefined || va === null) va = '';
if (vb === undefined || vb === null) vb = '';
if (typeof va === 'boolean') { va = va ? 1 : 0; vb = vb ? 1 : 0; }
if (typeof va === 'string') { va = va.toLowerCase(); vb = vb.toLowerCase(); }
if (va < vb) return currentSort.dir === 'asc' ? -1 : 1;
if (va > vb) return currentSort.dir === 'asc' ? 1 : -1;
return 0;
});
}
function getCategoryBadge(r) {
if (r.has_config && r.has_coderabbit_reviews) return '<span class="badge green">Fully Active</span>';
if (r.has_coderabbit_reviews) return '<span class="badge teal">Reviewing (No Config)</span>';