GroovyPostbuildRecorder.java: add a way to removeBadgesOnly() - #197
Open
jimklimov wants to merge 1 commit into
Open
GroovyPostbuildRecorder.java: add a way to removeBadgesOnly()#197jimklimov wants to merge 1 commit into
jimklimov wants to merge 1 commit into
Conversation
As discovered during investigation that led to jenkinsci/badge-plugin#362 this plugin's `removeBadges()` action actually removes both badges and summaries (is not limited to specifically `BadgeAction`). There are a couple of ways out of this: * Define a new method name for the new activity = least surprise for existing consumers that might rely on this (mis-)behavior. * Accept that this was a bug and redefine `removeBadges()` to remove only badges = least surprise for consumers of the current Badge API plugin, and more intuitively matching the name. * If anyone wanted a way to remove any derivative of `AbstractBadgeAction` in one go, a separate method specifically for that can be used, again more intuitively fitting. This would be effectively about swapping the names and updating javadocs of methods impacted by this PR's initial commit. For now, I went with the first option, but consider the second one superior (albeit a slightly breaking change, potentially). Up to maintainers :)
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.
As discovered during investigation that led to jenkinsci/badge-plugin#362 this plugin's
removeBadges()action actually removes both badges and summaries (is not limited to specificallyBadgeAction).There are a couple of ways out of this:
removeBadges()to remove only badges = least surprise for consumers of the current Badge API plugin, and more intuitively matching the name.AbstractBadgeActionin one go, a separate method specifically for that can be used, again more intuitively fitting; maybe add a namesake to Badge plugin too for easiest co-existence. This would be effectively about swapping the names and updating javadocs of methods impacted by this PR's initial commit.For now, I went with the first option, but consider the second one superior (albeit a slightly breaking change, potentially). Up to maintainers :)
Testing done
None yet, a theoretical fix.
Submitter checklist