Skip to content

Commit 97bc8ef

Browse files
author
Dan Gil
committed
Make baseline dependency count dynamic based on previous extraction
- Use previous CSV's dependency count as baseline instead of fixed number - Only fall back to config value (251) if no previous CSV exists - Updated config comments to clarify this behavior Signed-off-by: Dan Gil <[email protected]>
1 parent 81f5bbe commit 97bc8ef

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/extract_dependency_versions.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,15 @@ def load_previous_csv(self, csv_path: Path, csv_type: str = "latest") -> None:
208208
# Create unique key for each dependency
209209
key = f"{row.get('Component', '')}:{row.get('Category', '')}:{row.get('Dependency Name', '')}"
210210
target_dict[key] = row
211-
print(f"Loaded {len(target_dict)} dependencies from previous {csv_type} CSV: {csv_path.name}")
211+
212+
# Use the count from previous CSV as the baseline for warnings
213+
# (only if this is the latest CSV, not release)
214+
if csv_type == "latest" and len(target_dict) > 0:
215+
self.baseline_count = len(target_dict)
216+
print(f"Loaded {len(target_dict)} dependencies from previous {csv_type} CSV: {csv_path.name}")
217+
print(f"Set baseline count to {self.baseline_count} (from previous extraction)")
218+
else:
219+
print(f"Loaded {len(target_dict)} dependencies from previous {csv_type} CSV: {csv_path.name}")
212220
except Exception as e:
213221
self.warnings.append(f"Error loading previous {csv_type} CSV: {e}")
214222

.github/workflows/extract_dependency_versions_config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ github:
66
branch: "main"
77

88
baseline:
9+
# Fallback baseline count for warnings (if no previous CSV exists)
10+
# The script automatically uses the previous extraction's count as the baseline
911
dependency_count: 251
1012

1113
critical_dependencies:

0 commit comments

Comments
 (0)