Apply badge plugin multi version compatibilty fixes.#7378
Open
steelhead31 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates createBadgeSummary in the Jenkins pipeline to work across Badge Plugin 1.x, 2.x, and 3.x by using the correct API per version and introducing an icon fallback mapping so newer Ionicons symbols can be downgraded to legacy .svg icon names when needed.
Changes:
- Added a static icon mapping to translate Badge Plugin 3.x Ionicons symbol strings into legacy
.svgicon names for 1.x/2.x. - Reworked
createBadgeSummaryto try the 3.x Pipeline step first, then fall back to 2.xmanager.addSummary, then 1.xmanager.createSummary. - Updated call sites to pass Ionicons symbol strings so 3.x works directly while older versions use the fallback map.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
|
Some Grinders here: |
steelhead31
marked this pull request as ready for review
July 17, 2026 13:57
smlambert
approved these changes
Jul 17, 2026
smlambert
left a comment
Contributor
There was a problem hiding this comment.
These changes almost feel like it should get upstreamed to fix the plugin directly. But happy to hold them here for now.
Contributor
|
@steelhead31 Is it worth chatting to the upstream project here? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7377
Fix
createBadgeSummarycompatibility with Badge Plugin 1.x, 2.x, and 3.xProblem
After upgrading to Badge Plugin 3.x, build summaries fail with:
The previous implementation assumed
manager.addSummary(iconName)was the Badge Plugin 3.x API.It is not — in 3.x,
addSummaryis a Pipeline DSL step invoked without amanager.prefix andtakes named parameters (
icon:,text:). Additionally, Badge Plugin 3.x ships no bundled imagefiles; icons must be provided via the
ionicons-apiplugin using symbol name strings.Root Cause
manager.createSummary(icon).svgfilenamemanager.addSummary(icon).svgfilenameaddSummary(icon: ..., text: ...)The previous code tried
manager.addSummary(iconName)first (not valid in any version as theprimary call) and fell back to
manager.createSummary(iconName)— passing a 3.x Ionicons symbolstring that older plugin versions cannot resolve.
Changes
buildenv/jenkins/JenkinsfileBaseimport groovy.transform.Fieldto support the new static map.ICON_LEGACY_FALLBACK— a static map translating Ionicons symbol strings to their.svgequivalents for use with Badge Plugin 1.x and 2.x.
createBadgeSummarywith a correct three-level fallback chain:addSummary(icon: iconName, text: '')(Pipeline DSL step)manager.addSummary(legacyIcon)(manager method,.svgicon name)manager.createSummary(legacyIcon)(Groovy Postbuild API,.svgicon name)createBadgeSummarycall sites to pass Ionicons symbol strings, which areautomatically downgraded to
.svgnames on older installs via the fallback map.appendSummaryTextis unchanged — its existingsetText/getText→appendTextfallbackalready handles the 1.x vs 2.x/3.x text API difference correctly.
Icon mapping
.svgfallback (1.x / 2.x)symbol-close-circle-outline plugin-ionicons-apierror.svgsymbol-warning-outline plugin-ionicons-apiwarning.svgsymbol-checkmark-circle-outline plugin-ionicons-apiaccept.svgsymbol-folder-open-outline plugin-ionicons-apifolder-delete.svgAssisted by IBM Bob