<!--
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: 2025 The Linux Foundation
-->

# Table Comparison: Production vs New System

**Date:** January 12, 2026
**Purpose:** Document all table structure differences between production and new reporting systems

---

## Overview

Comparing tables in:

- **Production Report:** `onap-production-report.html` (generated by `lf-releng-project-reporting`)
- **New Report:** `onap-report.html` (generated by `test-lf-releng-project-reporting`)

---

## Section 1: Summary Table

### Production System (📈 Global Summary)

**Table Headers:**

```text
Metric | Count | Percentage
```text

**Sample Rows:**

- Total Gerrit Projects | 178 | 100%
- Current Gerrit Projects | 124 | 69.7%
- Total Commits | 2.8K | -
- Total Lines of Code | 478.1K | -

**Characteristics:**

- 3 columns
- Uses "Gerrit Projects" terminology
- Abbreviated numbers (K suffix)
- Simple structure

### New System (📈 Summary)

**Table Headers:**

```text
Metric | Value | Total | Percentage
```text

**Sample Rows:**

- Repositories Analyzed | 179 | 179 | 100.0%
- Current Repositories | 124 | — | 69.3%
- Total Commits | 107.0K | — | —
- Net Lines of Code | 1.1M | — | —

**Characteristics:**

- 4 columns (adds "Total" column)
- Uses "Repositories" terminology
- More detailed metrics (adds Contributors, Organizations, Lines Added/Removed)
- "—" for N/A values

### ⚠️ Issues to Fix

1. **Column mismatch:** Production has 3 columns, new has 4
2. **Terminology:** "Gerrit Projects" vs "Repositories"
3. **Metrics:** New system has extra rows not in production
4. **Number formatting:** Different abbreviation styles

### ✅ Recommended Fix

Update `src/templates/html/sections/summary.html.j2`:

- Remove "Total" column to match 3-column structure
- Use "Gerrit Projects" terminology instead of "Repositories"
- Match the exact metric rows from production
- Ensure number formatting matches (K, M suffixes)

---

## Section 2: Top Organizations Table

### Production System (🏢 Top Organizations)

**Table Headers:**

```text
Rank | Organization | Contributors | Commits | LOC | Δ LOC | Avg LOC/Commit | Unique Repositories
```text

**Sample Row:**

```text
1 | est.tech | 109 | 1453 | +79845 | 304653 | +55.0 | 88
```text

**Characteristics:**

- 8 columns
- Organization name only (domain extracted from email)
- Numbers not abbreviated
- Shows both LOC and Δ LOC

### New System (🏢 Top Organizations)

**Table Headers:**

```text
Rank | Organization | Domain | Contributors | Commits | LOC | Δ LOC | Avg LOC/Commit | Unique Repositories
```text

**Sample Row:**

```text
1 | est.tech | est.tech | 109 | 5.1K | +793273 | 1.3M | 156 | 88
```text

**Characteristics:**

- 9 columns (adds "Domain" column)
- Abbreviated numbers (K, M suffixes)
- Different commit counts and LOC values

### ⚠️ Issues to Fix

1. **Extra column:** "Domain" column not in production
2. **Number formatting:** Production uses raw numbers, new uses abbreviations
3. **Data values:** Commit counts and LOC values don't match

### ✅ Recommended Fix

Update `src/templates/html/sections/organizations.html.j2`:

- Remove "Domain" column
- Disable number abbreviation for this table
- Verify data aggregation matches production logic

---

## Section 3: Top Contributors Table

### Production System (👥 Top Contributors)

**Table Headers:**

```text
Rank | Contributor | Commits | LOC | Δ LOC | Avg LOC/Commit | Repositories | Organization
```text

**Sample Row:**

```text
1 | Fiete Ostkamp | 476 | +3807 | 179103 | +8.0 | 48 | telekom.de
```text

**Characteristics:**

- 8 columns
- Shows both LOC and Δ LOC
- Raw numbers (not abbreviated)
- Single table (not split by metric)

### New System (👥 Top Contributors)

**Table Headers:**

```text
Rank | Contributor | Email | Commits | Avg LOC/Commit | Repositories | Organization
```text

**Sample Row:**

```text
1 | Fiete Ostkamp | fiete.ostkamp@telekom.de | 1.0K | 223 | 48 | telekom.de
```text

**Characteristics:**

- 7 columns (adds Email, removes LOC and Δ LOC)
- Abbreviated commit counts
- Different Avg LOC/Commit values
- Has subsection "By Commit Count"

### ⚠️ Issues to Fix

1. **Column mismatch:** Email column added, LOC and Δ LOC columns removed
2. **Missing columns:** Need to restore LOC and Δ LOC
3. **Number formatting:** Should use raw numbers, not abbreviations
4. **Subsection:** Production has no subsections

### ✅ Recommended Fix

Update `src/templates/html/sections/contributors.html.j2`:

- Remove "Email" column
- Add back "LOC" and "Δ LOC" columns
- Disable number abbreviation
- Remove subsection wrapper

---

## Section 4: Gerrit Projects Table

### Production System (📊 Gerrit Projects)

**Table Headers:**

```text
Gerrit Project | Commits | LOC | Contributors | Days Inactive | Last Commit Date | Status
```text

**Sample Row:**

```text
cps | 679 | +19165 | 16 | 2 | 2026-01-10 | ✅
```text

**Characteristics:**

- 7 columns
- "Gerrit Project" as column header
- Raw numbers
- "Days Inactive" column
- Date format: YYYY-MM-DD

### New System (📊 Gerrit Projects)

**Section Title:** "Repository Activity Table" (subsection)

**Table Headers:**

```text
Repository | Total Commits | Lines Added | Contributors | Last Commit Age | Last Commit Date | Status
```text

**Sample Row:**

```text
doc | 27.8K | +10223 | 5 | 5m | 2025-08-13 | ✅
```text

**Characteristics:**

- 7 columns
- "Repository" as column header
- Abbreviated numbers
- "Last Commit Age" instead of "Days Inactive"
- Different sort order (not matching production)

### ⚠️ Issues to Fix

1. **Column headers:** "Repository" vs "Gerrit Project", "Total Commits" vs "Commits", "Lines Added" vs "LOC"
2. **Missing column:** "Days Inactive" replaced with "Last Commit Age" (different format)
3. **Number formatting:** Should use raw numbers
4. **Sort order:** Production sorts by commits descending, new system uses different order
5. **Subsection:** Remove "Repository Activity Table" subsection wrapper

### ✅ Recommended Fix

Update `src/templates/html/sections/repositories.html.j2`:

- Use "Gerrit Project" column header
- Use "Commits" not "Total Commits"
- Use "LOC" not "Lines Added"
- Use "Days Inactive" showing integer days, not formatted age
- Sort by commits descending
- Remove subsection wrapper

---

## Section 5: Repository Feature Matrix Table

### Production System (🔧 Gerrit Project Feature Matrix)

**Table Headers:**

```text
Gerrit Project | Type | Dependabot | Pre-commit | ReadTheDocs | .gitreview | G2G | Status
```text

**Sample Row:**

```text
cps | Java/Maven | ✅ | ❌ | ✅ | ✅ | ✅ | ✅
```text

**Characteristics:**

- 8 columns
- "Gerrit Project" as first column
- Actual project type shown (Java/Maven, Go, etc.)
- Simple boolean indicators (✅/❌)

### New System (🔧 Repository Feature Matrix)

**Table Headers:**

```text
Repository | Type | Dependabot | G2G | GitHub2Gerrit | .gitreview | Pre-commit | Type | ReadTheDocs | Sonatype Config | Workflows
```text

**Sample Row:**

```text
dcaegen2/collectors/restconf | N/A | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌
```text

**Characteristics:**

- 11 columns (adds GitHub2Gerrit, Sonatype Config, Workflows; duplicates "Type")
- "Repository" as first column
- Type shows "N/A" for all rows
- "Type" appears twice (columns 2 and 7)
- Extra features not in production

### ⚠️ Issues to Fix

1. **Column header:** "Repository" vs "Gerrit Project"
2. **Extra columns:** GitHub2Gerrit, Sonatype Config, Workflows not in production
3. **Duplicate column:** "Type" appears twice
4. **Type detection:** Shows "N/A" instead of actual types (Java/Maven, Go, etc.)
5. **Column order:** Different from production
6. **Missing Status column:** Production has Status, new doesn't

### ✅ Recommended Fix

Update `src/templates/html/sections/features.html.j2`:

- Use "Gerrit Project" column header
- Remove duplicate "Type" column
- Remove GitHub2Gerrit, Sonatype Config, Workflows columns
- Match column order: Type | Dependabot | Pre-commit | ReadTheDocs | .gitreview | G2G | Status
- Fix type detection to show actual project types
- Add Status column

---

## Section 6: CI/CD Jobs Table

### Production System (🏁 Deployed CI/CD Jobs)

**Table Headers:**

```text
Gerrit Project | GitHub Workflows | Workflow Count | Jenkins Jobs | Job Count
```text

**Sample Row:**

```text
aai/aai-common | call-github2gerrit.yaml<br>github2gerrit.yaml | 2 | aai-aai-common-master-verify-java<br>aai-aai-common-master-merge-java<br>...(6 more) | 8
```text

**Characteristics:**

- 5 columns
- One row per Gerrit project
- Multiple workflows/jobs per cell (separated by `<br>`)
- Hyperlinked and color-coded job names

### New System (🏁 Deployed CI/CD Jobs) - BEFORE FIX

**Table Headers (BEFORE):**

```text
Job Name | Repository | Status
```text

**Characteristics (BEFORE):**

- 3 columns
- One row per individual job
- NOT grouped by repository

### New System (🏁 Deployed CI/CD Jobs) - AFTER FIX

**Table Headers (AFTER):**

```text
Gerrit Project | GitHub Workflows | Workflow Count | Jenkins Jobs | Job Count
```text

**Status:** ✅ **FIXED** - Now matches production format

---

## Section 7: INFO.yaml Reports

### Production System

**Sections:**

- 📋 Committer INFO.yaml Report
- (No lifecycle summary visible in sample)

### New System

**Sections:**

- 📋 Committer INFO.yaml Report
- 📊 INFO.yaml Lifecycle State Summary

**Characteristics:**

- Both systems have INFO.yaml committer report
- New system adds lifecycle summary section

### Status

Need to verify table structures match when both are present.

---

## Summary of Required Template Updates

### High Priority (Table Structure Mismatches)

1. **`src/templates/html/sections/summary.html.j2`**
   - Remove "Total" column (3 columns only)
   - Change "Repositories" to "Gerrit Projects"
   - Match exact metric rows

2. **`src/templates/html/sections/organizations.html.j2`**
   - Remove "Domain" column (8 columns only)
   - Disable number abbreviation

3. **`src/templates/html/sections/contributors.html.j2`**
   - Remove "Email" column
   - Add "LOC" and "Δ LOC" columns
   - Disable number abbreviation
   - Remove subsection wrapper

4. **`src/templates/html/sections/repositories.html.j2`**
   - Use "Gerrit Project" not "Repository"
   - Use "Commits" not "Total Commits"
   - Use "LOC" not "Lines Added"
   - Replace "Last Commit Age" with "Days Inactive" (integer)
   - Sort by commits descending
   - Remove subsection wrapper

5. **`src/templates/html/sections/features.html.j2`**
   - Use "Gerrit Project" not "Repository"
   - Remove duplicate "Type" column
   - Remove GitHub2Gerrit, Sonatype Config, Workflows columns
   - Reorder columns to match production
   - Fix type detection (currently shows "N/A")
   - Add Status column

6. **`src/templates/html/sections/workflows.html.j2`**
   - ✅ Already fixed to match production format

### Medium Priority (Data Issues)

1. **Type Detection** - Feature matrix shows "N/A" for all project types
2. **Number Formatting** - Inconsistent abbreviation (some tables use K/M, others don't)
3. **Data Aggregation** - Different commit/LOC counts in some tables

### Low Priority (Nice to Have)

1. **CSS Class Names** - Ensure table CSS classes match production
2. **Sort Orders** - Verify default sort matches production
3. **Number Formatting** - Standardize when to abbreviate vs show raw numbers

---

## Next Steps

1. Update each template file according to fixes above
2. Test with sample data to verify column structure
3. Run full ONAP report generation
4. Compare output side-by-side with production
5. Verify CSS styling works with updated table structures
6. Update tests to match new table structures

---

## Testing Checklist

- [ ] Summary table: 3 columns, correct terminology
- [ ] Organizations table: 8 columns, no abbreviations
- [ ] Contributors table: 8 columns, includes LOC/Δ LOC
- [ ] Repositories table: 7 columns, "Days Inactive" shown
- [ ] Feature Matrix: 8 columns, actual types shown, no duplicates
- [ ] CI/CD Jobs: 5 columns, grouped by project ✅
- [ ] All tables use "Gerrit Project" not "Repository" in headers
- [ ] Number formatting matches production (raw vs abbreviated)
- [ ] Sort orders match production defaults
