-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring for new major version #151
Refactoring for new major version #151
Conversation
9bfa8fe
to
54b1fae
Compare
I like that idea
That will break compatibility with existing Pipeline scripts. Jenkins plugins should not break compatibility with existing Pipelines unless there is a very strong reason to do so. I'd very much prefer that we retain |
I totally understand that but am wondering: How could I deprecate / remove pipeline steps provided in a graceful manner? What about parameters that need to change? Another point that came up was changing the |
As far as I can tell, we can't remove Pipeline steps without breaking users and Jenkins users depend on not being broken by changes from plugin maintainers.
Changing the |
Alright, I will try to work around any breaking changes and see what I end up with. I think starting a new plugin is not really what I was aiming for 👍🏼 One thing I wanted to take a closer look at is the |
54b1fae
to
76a89a1
Compare
@strangelookingnerd it is much more simple, then you think. You can provide warning, in the function (step) now. Like this step si deprecated and will be removed end of September ... . Or something like that. You can also add new jenkins warnings for Jeniins adminsistrator like "Java 11 end of life in Jenkins" does now. That means, the jenkins administrators, have "enought" time to provide changes. but general I 100% agree with @MarkEWaite . It is not good to deprecate some pipeline step. I as Jenkins admin in my company will be verry unhappy, when we need to update Jenkins ASAP (because of some security issue fix) and the I need to spend many hours to fix things, like deprecated functions. The minimum is in that case "Breaking change" description in the PR. |
I just pushed the latest changes that are slowly going towards a final state. I did my very best to keep backwards compatibility for existing pipeline scripts as well as already persisted In order to actually validate the compatibility I used the latest state (db43b1b) to create test jobs for every documentated pipeline step configuration. I guess that should cover everything that may or may not be working right and show how my new approach handles it. Once the jobs where created and run I took screenshots. Then I took my current branch and used the exact same jobs to find out what may have changed. This is mostly visually and some things like mouseovers are missing in the screenshot but be assured I validated them manually. Here is the comparision using sliders, so it's easier to see what changed. Please notice that everyghing is zoomed in by 150%:
As for the alignments, I suspect that it is because of the Please let me know what you think and I will in the meantime tackle the test coverage 👍🏼 |
You shall resove you merge conflicts |
@strangelookingnerd it is really hard to review all the changes. pls resolve your conflicts, afterwards, I can download the plugin and try it on my test-instance. A full review is more or less not possible. Sorry |
The conflicts have been resolved. |
The PR is ready for review. I updated the description to reflect a high level view of the changes that are contained. Excited to hear what @jenkinsci/badge-plugin-developers think about this. |
939f2d7
to
8c07d48
Compare
It would be good to validate the changes against jenkinsci/jenkins#9148 which does a complete rewrite of the history widget |
@mawinter69 That's a great idea! Thanks for bringing it up. I'm just checking the current state against the incremental (2.460-rc35013.a_441f2fd8c5c). The only thing I find a little odd is the build status icon now being 20x20 instead of 16x16 (class Things start to get a little messy once you have many badges: Once there are many badges they start to break the surrounding |
@jenkinsci/badge-plugin-developers I would love to get this merged soon-ish especially since jenkinsci/jenkins#9148 will make a visual change to the build history that I would love to use as a baseline for an upcoming 2.0 release of the I know the change set is quite huge however I would feel better if another pair of eyes would take a look at these changes and approve them. |
I'm afraid that I won't be able to review it for several months. The Spring Security 6.x Upgrade project needs to have most of my attention for the next several months. Please be mindful of the importance of compatibility to Jenkins users. Compatibility is so important to Jenkins users that it is included in the Jenkins governance documents where it says:
Retaining compatibility is hard work but it matters deeply to Jenkins users. |
I see, maybe some of the other maintainers can step up and give it a shot. As for the compatibility, I'm very confident that my changes will not cause issues for existing pipelines or build configurations. There are some minor visual changes (see #151 (comment)) that - in my opinion - should be considered improvements that do not have any negative impact. I put in great effort to ensure the compatibility with automated as well as manual tests, using the current stable version as well as the future 2.0 version in combination with different Jenkins versions and possible scenarios. Still it would be good to have another pair of eyes to take a look at my changes. |
@strangelookingnerd did you seen my comments from the last review? |
Not sure what you are referring to. Can you link me the comments? |
@strangelookingnerd I marked you in all of them |
If you are referring to #151 (comment): I have recently updated the PR description to reflect the current / final state of my changes. There are no breaking changes but only deprecations. |
I actually don’t, sorry. Maybe you need to finish your review by approving/requesting changes for them to become public? |
src/main/resources/com/jenkinsci/plugins/badge/action/BadgeAction/badge.jelly
Show resolved
Hide resolved
src/main/resources/com/jenkinsci/plugins/badge/action/BadgeAction/badge.jelly
Show resolved
Hide resolved
src/main/resources/com/jenkinsci/plugins/badge/action/BadgeSummaryAction/summary.jelly
Show resolved
Hide resolved
src/main/resources/com/jenkinsci/plugins/badge/dsl/AddBadgeStep/help-cssClass.html
Outdated
Show resolved
Hide resolved
34debcc
to
b70b248
Compare
* Isolate code base * Remove documentation * Add migration message to build log
* expose fields for css style and class that are used in an enclosing span for each badge
* use toString in tests to allow easier abstraction
b70b248
to
0e8b260
Compare
Merging the changes and creating |
/* Action methods */ | ||
public String getUrlName() { | ||
return ""; | ||
public BadgeSummaryAction(String id, String icon, String text, String cssClass, String style, String link) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an incompatible change. It breaks https://github.com/jenkinsci/groovy-postbuild-plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please crate new issue for that. This change was merged now, so we need to fix it in new PR.
Over the last days I began refactoring the code base, aiming to provide a "fresh start" for this plugin and introducing a new major version.
Fixes https://issues.jenkins.io/browse/JENKINS-73167 and #149 alongside #148 and likely many other regressions introduced in the last version through #130 and other changes that we have not uncovered yet.
Changes
See #151 (comment)
Start new major version 2.0
addBadge
reworkedtext
can be plain text or HTML (withSafe HTML
MarkupFormatter enabled)addInfoBadge
,addWarningBadge
,addErrorBadge
reworkedaddBadge
New
addSummary
createSummary
and has all feature the other badges haveManipulate a badge during build time
HTML formatting delegated to global Jenkins MarkupFormatter
Jenkins.get().getMarkupFormatter().translate()
Deprecations
addHtmlBadge
(can be substituted byaddBadge
)addShortText
(can be substituted byaddBadge
)createSummary
(can be substituted byaddSummary
)Testing
Documentation
@jenkinsci/badge-plugin-developers Please let me know what you think, happy to get some feedback.
Submitter checklist