Skip to content
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

plugin modernization #58

Merged
merged 4 commits into from
May 19, 2023
Merged

plugin modernization #58

merged 4 commits into from
May 19, 2023

Conversation

mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented May 13, 2023

The plugin is currently on a very old Jenkins version (1.565). This implies dependencies to other plugins that have been extracted from core since then and prevents me from uninstalling these plugins.

bump to require jenkins 2.361.4
use ionicons
replace some deprecated things with recommended alternatives (e.g. javax.annotation)
fix optOut help for the job property
use newer maven in the test

Pane:
image

Retry link:
image

Dark Theme:
Pane:
image

Retry link:
image

Testing done

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Sorry, something went wrong.

bump to require jenkins 2.361.4
use ionicons
replace some deprecated things with recommended alternatives
fix optOut help for the job property
use newer maven in the test
javax.annotation is deprecated
@mawinter69 mawinter69 mentioned this pull request May 13, 2023
6 tasks
the default prevents an exception when checking the
regexpForMatrixStrategy after adding the naginator publisher for the
first time.
@@ -229,9 +226,6 @@ public DescriptorImpl getDescriptor() {
return (DescriptorImpl) super.getDescriptor();
}

@Extension
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Extension annotation is now directly on the NaginatorListener

Comment on lines -293 to -300
/**
* Creates a new instance of {@link NaginatorPublisher} from a submitted form.
*/
@Override
public Notifier newInstance(StaplerRequest req, JSONObject formData) throws FormException {
return req.bindJSON(NaginatorPublisher.class, formData);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default implementation is doing the same and properly handles the theoretically possible case that req is null

FreeStyleProject p = j.createFreeStyleProject();
FreeStyleBuild build1 = p.scheduleBuild2(0).get();
build1.setDisplayName("<div id=\"unescaped-displayname\">bad displayname</div>");
build1.setDisplayName("<div id=\"unescaped-displayname\">bad displayname</div>");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change note: Unprintable whitespace between setDisplayName and ( is removed.

@@ -1,4 +1,4 @@
<div>
By default, naginator offer a "rebuild" link to all failed builds. Some jobs anyway might not be designed to
By default, naginator offers a "retry" link to all failed builds. Some jobs anyway might not be designed to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -14,13 +14,18 @@
* @author <a href="mailto:nicolas.deloof@gmail.com">Nicolas De Loof</a>
*/
@Extension
public class NaginatorActionFactory extends TransientBuildActionFactory {
public class NaginatorActionFactory extends TransientActionFactory<AbstractBuild> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review note: TransientBuildActionFactory and TransientActionFactory is binary incompatible, but I believe OK
(OK means we don't need to change the major version to mark binary incompatible).
I believe external modules never depend on NaginatorActionFactory.

@@ -32,8 +32,7 @@
</f:entry>
<j:if test="${descriptor.isMatrixProject(it)}">
<f:entry title="${%How to apply the regular expression to matrix}" field="regexpForMatrixStrategy">
<!-- unfortunatelly, f:enum doesn't support doCheckXxxx -->
<f:select />
<f:select default="TestParent"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this when adding the Publisher for the first time an exception is thrown and the UI breaks.

Copy link
Member

@ikedam ikedam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the request.
The change almost looks good to me. I want to keep title for the icon if we could.

Could you attach screenshots for icons? I think I can try that in the next weekend (unfortunately, I don't have an appropriate environment now), but the screenshot will be helpful if that doesn't bother you.

Copy link
Member

@ikedam ikedam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updates and screenshots!

@ikedam ikedam merged commit 52670b4 into jenkinsci:master May 19, 2023
@ikedam ikedam mentioned this pull request May 19, 2023
6 tasks
@ikedam
Copy link
Member

ikedam commented May 19, 2023

I'm planning makina a new release tomorrow: #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants