Skip to content

Commit 4937c01

Browse files
committed
fix: handle skipped benchmark cases in create-release.ts
- Added logic to format release descriptions when benchmark results are missing, providing clear messaging about the absence of data. - Updated release name generation to reflect when benchmarks are skipped, ensuring accurate representation in release notes. - This change improves the clarity and usability of release information in scenarios where no performance data is available.
1 parent 73739f4 commit 4937c01

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

scripts/create-release.ts

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@ function formatReleaseDescription(
5353
day: 'numeric',
5454
});
5555

56+
// Handle case when benchmark was skipped (empty results)
57+
if (!results || !results.tools) {
58+
return `# 📊 Monorepo Tools Benchmark Results - ${date}
59+
60+
## ⚠️ No Benchmark Data Available
61+
62+
The benchmark was skipped in this run. No performance data is available.
63+
64+
## Tool Versions
65+
66+
| Tool | Version |
67+
|------|---------|
68+
| Nx | ${versions.nx} |
69+
| Turbo | ${versions.turbo} |
70+
| Lerna | ${versions.lerna} |
71+
| Lage | ${versions.lage} |
72+
| Node.js | ${versions.node} |
73+
| PNPM | ${versions.pnpm} |
74+
75+
---
76+
77+
*This release was automatically generated by the daily benchmark workflow. The benchmark was skipped for this run.*`;
78+
}
79+
5680
return `# 📊 Monorepo Tools Benchmark Results - ${date}
5781
5882
## Performance Results
@@ -107,9 +131,15 @@ function generateReleaseInfo(results: BenchmarkResults): ReleaseInfo {
107131
day: 'numeric',
108132
});
109133

134+
// Handle case when benchmark was skipped
135+
const releaseName =
136+
!results || !results.tools
137+
? `📊 Benchmark Results - ${date} (No Data - Benchmark Skipped)`
138+
: `🚀 Benchmark Results - ${date} (Nx ${versions.nx}, Turbo ${versions.turbo})`;
139+
110140
return {
111141
tagName,
112-
releaseName: `🚀 Benchmark Results - ${date} (Nx ${versions.nx}, Turbo ${versions.turbo})`,
142+
releaseName,
113143
description: formatReleaseDescription(results, versions),
114144
};
115145
}

0 commit comments

Comments
 (0)