Loading sources/src/job-summary.ts +34 −11 Changes for sources/src/job-summary.ts: 34 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ function renderBuildResults(results: BuildResult[]): string { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr>${results.map(result => renderBuildResultRow(result)).join('')} </table> ` Loading @@ -134,23 +134,46 @@ function renderOutcome(result: BuildResult): string { return result.buildFailed ? ':x:' : ':white_check_mark:' } interface BadgeSpec { text: string alt: string color: string logo: boolean targetUrl: string } function renderBuildScan(result: BuildResult): string { if (result.buildScanFailed) { return renderBuildScanBadge( 'PUBLISH_FAILED', 'orange', 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting' ) return renderBuildScanBadge({ text: 'Publish failed', alt: 'Build Scan publish failed', color: 'orange', logo: false, targetUrl: 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting' }) } if (result.buildScanUri) { return renderBuildScanBadge('PUBLISHED', '06A0CE', result.buildScanUri) return renderBuildScanBadge({ text: 'Build Scan®', alt: 'Build Scan published', color: '06A0CE', logo: true, targetUrl: result.buildScanUri }) } return renderBuildScanBadge('NOT_PUBLISHED', 'lightgrey', 'https://scans.gradle.com') return renderBuildScanBadge({ text: 'Not published', alt: 'Build Scan not published', color: 'lightgrey', logo: false, targetUrl: 'https://scans.gradle.com' }) } function renderBuildScanBadge(outcomeText: string, outcomeColor: string, targetUrl: string): string { const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle` const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />` function renderBuildScanBadge({text, alt, color, logo, targetUrl}: BadgeSpec): string { const encodedText = encodeURIComponent(text) const badgeUrl = `https://img.shields.io/badge/${encodedText}-${color}${logo ? '?logo=Gradle' : ''}` const badgeHtml = `<img src="${badgeUrl}" alt="${alt}" />` return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>` } Loading sources/test/jest/job-summary.test.ts +13 −13 Changes for sources/test/jest/job-summary.test.ts: 13 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -47,14 +47,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> </table> `); Loading @@ -68,14 +68,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:x:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> </table> `); Loading @@ -90,14 +90,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://scans.gradle.com" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-NOT_PUBLISHED-lightgrey?logo=Gradle" alt="Build Scan NOT_PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Not%20published-lightgrey" alt="Build Scan not published" /></a></td> </tr> </table> `); Loading @@ -111,14 +111,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISH_FAILED-orange?logo=Gradle" alt="Build Scan PUBLISH_FAILED" /></a></td> <td><a href="https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Publish%20failed-orange" alt="Build Scan publish failed" /></a></td> </tr> </table> `); Loading @@ -133,21 +133,21 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:x:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> </table> `); Loading @@ -161,14 +161,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td><div title='check publishMyLongNamePluginPublicationToMavenCentral publishMyLongNamePluginPublicationToPluginPortal'>check publishMyLongNamePluginPublicationToMavenCentral publ…</div></td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> </table> `); Loading Loading
sources/src/job-summary.ts +34 −11 Changes for sources/src/job-summary.ts: 34 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ function renderBuildResults(results: BuildResult[]): string { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr>${results.map(result => renderBuildResultRow(result)).join('')} </table> ` Loading @@ -134,23 +134,46 @@ function renderOutcome(result: BuildResult): string { return result.buildFailed ? ':x:' : ':white_check_mark:' } interface BadgeSpec { text: string alt: string color: string logo: boolean targetUrl: string } function renderBuildScan(result: BuildResult): string { if (result.buildScanFailed) { return renderBuildScanBadge( 'PUBLISH_FAILED', 'orange', 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting' ) return renderBuildScanBadge({ text: 'Publish failed', alt: 'Build Scan publish failed', color: 'orange', logo: false, targetUrl: 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting' }) } if (result.buildScanUri) { return renderBuildScanBadge('PUBLISHED', '06A0CE', result.buildScanUri) return renderBuildScanBadge({ text: 'Build Scan®', alt: 'Build Scan published', color: '06A0CE', logo: true, targetUrl: result.buildScanUri }) } return renderBuildScanBadge('NOT_PUBLISHED', 'lightgrey', 'https://scans.gradle.com') return renderBuildScanBadge({ text: 'Not published', alt: 'Build Scan not published', color: 'lightgrey', logo: false, targetUrl: 'https://scans.gradle.com' }) } function renderBuildScanBadge(outcomeText: string, outcomeColor: string, targetUrl: string): string { const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle` const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />` function renderBuildScanBadge({text, alt, color, logo, targetUrl}: BadgeSpec): string { const encodedText = encodeURIComponent(text) const badgeUrl = `https://img.shields.io/badge/${encodedText}-${color}${logo ? '?logo=Gradle' : ''}` const badgeHtml = `<img src="${badgeUrl}" alt="${alt}" />` return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>` } Loading
sources/test/jest/job-summary.test.ts +13 −13 Changes for sources/test/jest/job-summary.test.ts: 13 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -47,14 +47,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> </table> `); Loading @@ -68,14 +68,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:x:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> </table> `); Loading @@ -90,14 +90,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://scans.gradle.com" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-NOT_PUBLISHED-lightgrey?logo=Gradle" alt="Build Scan NOT_PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Not%20published-lightgrey" alt="Build Scan not published" /></a></td> </tr> </table> `); Loading @@ -111,14 +111,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISH_FAILED-orange?logo=Gradle" alt="Build Scan PUBLISH_FAILED" /></a></td> <td><a href="https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Publish%20failed-orange" alt="Build Scan publish failed" /></a></td> </tr> </table> `); Loading @@ -133,21 +133,21 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> <tr> <td>root</td> <td>help</td> <td align='center'>8.0</td> <td align='center'>:x:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> </table> `); Loading @@ -161,14 +161,14 @@ describe('renderSummaryTable', () => { <th>Requested Tasks</th> <th>Gradle Version</th> <th>Build Outcome</th> <th>Build Scan®</th> <th>Build Scan®</th> </tr> <tr> <td>root</td> <td><div title='check publishMyLongNamePluginPublicationToMavenCentral publishMyLongNamePluginPublicationToPluginPortal'>check publishMyLongNamePluginPublicationToMavenCentral publ…</div></td> <td align='center'>8.0</td> <td align='center'>:white_check_mark:</td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-PUBLISHED-06A0CE?logo=Gradle" alt="Build Scan PUBLISHED" /></a></td> <td><a href="https://scans.gradle.com/s/abc123" rel="nofollow" target="_blank"><img src="https://img.shields.io/badge/Build%20Scan%C2%AE-06A0CE?logo=Gradle" alt="Build Scan published" /></a></td> </tr> </table> `); Loading