Overview
Recently some UI improvements around the Manage Jenkins page have been introduced. The visual changes are very subtle but behind them, there are interesting benefits.
Some of the goals that we have tried to achieve:
Applying a semantic HTML
Removing the tag usage for implementing layouts and content structures. Read this article if you want to know reasons and/or arguments.
Small re-styling focused on spacing, margins, composition, etc..
Accessibility
In order to provide a quick overview of the visual changes, let’s take a look at these screenshots.
System tray with administrative messages (before)
System tray with administrative messages (after)
Manage Jenkins page (before)
Manage Jenkins page (after)
Information about how this change can affect the current implementations of Administrative Monitors can be found in the following section
For core developers
Let’s use a real example for showing how this proposal works.
This is the original UI implementation of HudsonHomeDiskUsageMonitor.java :
${%blurb(app.rootDir)}
And this is the proposed change:
${%blurb(app.rootDir)}
Some highlights:
No more ad hoc UI compositions
No more custom CSS classes when Jenkins project is already using Bootstrap for many different things
Based on Bootstrap Alert
All administrative monitors defined in Jenkins core have been adapted as part of this proposal.
For plugin developers
No changes are really needed, but we do recommend you to adapt your plugins to this proposal so Jenkins users have a better user experience.
Taking into account that you want to keep backward compatibility, you will need some changes.
In your implementation of Administrative Monitor, add this helper method:
/**
* This method can be removed when the baseline is updated to 2.103
*
* @return If this version of the plugin is running on a Jenkins version where JENKINS-43786 is included.
*/
@Restricted(DoNotUse.class)
public boolean isTheNewDesignAvailable() {
if (Jenkins.getVersion().isNewerThan(new VersionNumber("2.103"))) {
return true;
}
return false;
}
In your view (a.k.a. Jelly file or Groovy file):
SSH Host Key Verifiers are not configured for all SSH agents on this Jenkins instance. This could leave these agents open to man-in-the-middle attacks. Update your agent configuration to resolve this.
SSH Host Key Verifiers are not configured for all SSH agents on this Jenkins instance. This could leave these agents open to man-in-the-middle attacks. Update your agent configuration to resolve this.
If you don’t want to keep a strict backward compatibility, the impact is minimal. In fact, you can see an example on GitHub Plugin.
Some helpful references:
JIRA issue where the proposal was tracked
Pull Request with the change in Jenkins core. You can find several screenshots
Pull Request for adapting SSH Agent Plugin
Do not hesitate to ping me if you decide to adapt your Administrative Monitors.