polish: improve step names and logging clarity

- Rename step from 'Get dates for last week' to 'Get dates for last 14 days'
- Add consistent warning messages when metrics files are missing
- Use console.warn for missing file scenarios with [parse-metrics] prefix
- Improve debugging visibility for fallback behavior
This commit is contained in:
Ralph Khreish
2025-09-22 15:28:03 +02:00
parent d38b470572
commit aec5a80cfb
2 changed files with 6 additions and 4 deletions

View File

@@ -70,7 +70,7 @@ function main() {
'Time to close'
);
} else {
console.log('⚠️ No issue_metrics.md found');
console.warn('[parse-metrics] issue_metrics.md not found; using defaults.');
}
// Parse PR created metrics
@@ -87,7 +87,7 @@ function main() {
'Time to first response'
);
} else {
console.log('⚠️ No pr_created_metrics.md found');
console.warn('[parse-metrics] pr_created_metrics.md not found; using defaults.');
}
// Parse PR merged metrics (for more accurate merge data)
@@ -102,7 +102,7 @@ function main() {
// For merged PRs, "Time to close" is actually time to merge
metrics.pr_avg_merge_time = parseMetricsTable(prMergedContent, 'Time to close');
} else {
console.log('⚠️ No pr_merged_metrics.md found');
console.warn('[parse-metrics] pr_merged_metrics.md not found; falling back to pr_metrics.md.');
// Fallback: try old pr_metrics.md if it exists
if (existsSync('pr_metrics.md')) {
console.log('📄 Falling back to pr_metrics.md...');
@@ -115,6 +115,8 @@ function main() {
metrics.pr_avg_merge_time = maybeMergeTime !== 'N/A'
? maybeMergeTime
: parseMetricsTable(prContent, 'Time to close');
} else {
console.warn('[parse-metrics] pr_metrics.md not found; using defaults.');
}
}

View File

@@ -25,7 +25,7 @@ jobs:
with:
node-version: '20'
- name: Get dates for last week
- name: Get dates for last 14 days
run: |
set -Eeuo pipefail
# Last 14 days