Skip to content

Conversation

@recena
Copy link
Contributor

@recena recena commented Sep 14, 2017

JENKINS-43786

Downstream of jenkinsci/jenkins#2857

Screenshot

screenshot-2017-9-14 manage jenkins jenkins

@jenkinsci/code-reviewers

@rtyler
Copy link
Member

rtyler commented Sep 14, 2017

looks pretty 👍

@recena
Copy link
Contributor Author

recena commented Sep 14, 2017

@rtyler Thanks for your feedback. I've tried to provide an improvement in the UI by using a progressive enhancement approach. The previous one works and the maintainers will be able to adapt their plugins step by step.

@daniel-beck
Copy link
Member

How does it look on Jenkins before the core PR?

@recena
Copy link
Contributor Author

recena commented Sep 15, 2017

@daniel-beck I can prepare a screenshot but you can see an example jenkinsci/jenkins#2857 (comment).

@daniel-beck
Copy link
Member

@recena To clarify, plugins that include a change like this one (i.e. the class attribute) will look exactly like admin monitors in core in the respective core releases? If old core, looks like old admin monitors; and if new core (once the PR is merged), it'll look like new core monitors?

@recena
Copy link
Contributor Author

recena commented Sep 19, 2017

@daniel-beck This is a screenshot by using the changes on this PR and Jenkins LTS 2.60.1.

screenshot-2017-9-19 manage jenkins jenkins

Although we could find some bad results.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

alert and alert-warning CSS classes have been introduced in Jenkins 1.633. jenkinsci/jenkins@83a8d54

The plugin baseline is 1.625.x now. It is fine to bump the baseline IMHO, but it has to be done in order to make this PR acceptable.

🐛

@recena
Copy link
Contributor Author

recena commented Sep 21, 2017

@oleg-nenashev You can close this PR if you don't want to use this new design provided by the core. Nothing has been removed, hence, you can continue using the previus implementation.

Maintainers can decide when starting to use this new UI design.

@recena
Copy link
Contributor Author

recena commented Sep 21, 2017

@oleg-nenashev According to the stats, I don't see your concern like something critical 😄

@oleg-nenashev
Copy link
Member

@recena I do not understand how your response about "don't want" is related to my review feedback, please read it again.

  • I just said that the PR is not ready, because it uses styles not available in the baseline.
  • I explicitly said the baseline upgrade is fine

@recena
Copy link
Contributor Author

recena commented Sep 21, 2017

@oleg-nenashev You agree, I was not clear with my explanation. What I wanted to say is the maintainer decides how and when he wants to adapt his plugin.

Sure, I'm going to bump the baseline to 1.633.

@oleg-nenashev
Copy link
Member

Sure, I'm going to bump the baseline to 1.633.

Please use 1.642.3 LTS then. It's better to build against LTS releases, and nobody cares much about such old weeklys for sure

* @return If this version of the plugin is running on a Jenkins version where JENKINS-43786 is included.
*/
public boolean isTheNewDesignAvailable() {
if (Jenkins.getVersion().isNewerThan(new VersionNumber("2.88"))) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

2.88 is only an example. it depends when jenkinsci/jenkins#2857 is merged and released.

@recena
Copy link
Contributor Author

recena commented Oct 29, 2017

@oleg-nenashev @daniel-beck @jglick

You can see one way on how the plugins could use jenkinsci/jenkins#2857

*
* @return If this version of the plugin is running on a Jenkins version where JENKINS-43786 is included.
*/
public boolean isTheNewDesignAvailable() {
Copy link
Member

Choose a reason for hiding this comment

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

@Restricted(DoNotUse.class)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@daniel-beck Done.

</div>
<j:jelly xmlns:j="jelly:core">

<j:if test="${!it.isTheNewDesignAvailable}">
Copy link
Member

Choose a reason for hiding this comment

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

Should just be made into a Groovy view so there's no change to plugin classes needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@daniel-beck Agree although I'm not fan of Groovy for that purpose. I wanted to offer to two different examples. This one, and this jenkinsci/github-plugin#179, where the maintainers are already using Groovy.

Copy link
Member

Choose a reason for hiding this comment

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

I am fine with a non-Groovy implementation. As we discussed with @recena in the chat, we rather need a macro or tag, which would check the Jenkins core version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oleg-nenashev Yes, a Jelly tag would be helpful. I'll find some of time for it.

Copy link
Contributor

Choose a reason for hiding this comment

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

could use j:choose + j:when + j:otherwise
And should use a var to avoid code duplication

Copy link
Contributor Author

@recena recena Jun 6, 2018

Choose a reason for hiding this comment

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

@ndeloof A var for what?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remember, we are considering two cases just temporarily. When the baseline is updated, we don't need it.

Copy link
Contributor

Choose a reason for hiding this comment

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

a var to define the css class to be used.

<j:choose>
  <j:when test="${it.isTheNewDesignAvailable}">
     <j:set var="css" value="warning">
  </j:when>
  <j:otherwise>
     <j:set var="css" value="alert alert-warning">
  </j:otherwise>
</j:choose>
<div class="${css}">
...

makes me wonder, but it seems one could even use this simpler form:

<div class="${it.isTheNewDesignAvailable() ? 'alert alert-warning' : 'warning'}">
...

by the way, using isNewDesignAvailable() as method name would allow to use property style notation ${it.isNewDesignAvailable} (adding "The" sounds weird to me).

I'm pretty sure this has been intensively investigated, but can't the CSS just target "warning" class efficiently enough within an administrative monitor context so all this isn't required ? I would understand this is required it he DOM structure was different, but here this sounds to only be a question of CSS alias.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to be you are not taking into account the paragraph <p>, needed in the first case.

By the way, as you can read in the article, this is temporal. It could be removed when the baseline is updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And by the way, this is the simplest case where the content is more or less similar (but not identical). However, you will find more complex cases here jenkinsci/jenkins#2857

I don't see the value of using a var.

@lanwen
Copy link
Member

lanwen commented Oct 30, 2017

Is it dismissable?

@daniel-beck
Copy link
Member

@lanwen No button for this one (even before), but there's an Administrative Monitors section on Configure System to disable or enable them individually.

@recena
Copy link
Contributor Author

recena commented Oct 30, 2017

@lanwen As @daniel-beck has mentioned, I am not changing the functionality, only the appearance.

@recena
Copy link
Contributor Author

recena commented Oct 30, 2017

@oleg-nenashev Could you update your review, please?

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

🐝 works for me, but it needs the Jenkins core release first

*/
@Restricted(DoNotUse.class)
public boolean isTheNewDesignAvailable() {
if (Jenkins.getVersion().isNewerThan(new VersionNumber("2.88"))) {
Copy link
Member

Choose a reason for hiding this comment

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

This version needs to be updated to the actual one when upstream changes are integrated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, for that reason this PR is downstream of jenkinsci/jenkins#2857

@oleg-nenashev
Copy link
Member

@recena 2.103 has been released. Would you be able to update the PR so that we could ship it?

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

🐝

@recena
Copy link
Contributor Author

recena commented Jan 23, 2018

The tests are passing locally:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running hudson.plugins.sshslaves.verifiers.ManuallyProvidedKeyVerificationStrategyTest
Running hudson.plugins.sshslaves.SSHLauncherTest
Running hudson.plugins.sshslaves.verifiers.TrileadVersionSupportManagerTest
Running hudson.plugins.sshslaves.verifiers.TrustHostKeyActionTest
Running hudson.plugins.sshslaves.verifiers.VerificationStrategyConfigurationTest
Running InjectedTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.228 sec - in hudson.plugins.sshslaves.verifiers.TrileadVersionSupportManagerTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.585 sec - in hudson.plugins.sshslaves.verifiers.ManuallyProvidedKeyVerificationStrategyTest
Tests run: 32, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 31.557 sec - in InjectedTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 42.994 sec - in hudson.plugins.sshslaves.verifiers.TrustHostKeyActionTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 45.932 sec - in hudson.plugins.sshslaves.verifiers.VerificationStrategyConfigurationTest
Tests run: 12, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 57.146 sec - in hudson.plugins.sshslaves.SSHLauncherTest

Results :

Tests run: 55, Failures: 0, Errors: 0, Skipped: 1

it seems something related with the CI env.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

The build failure is real 🐛

10:28:47 [linux-2.73.1] [INFO] Total bugs: 1
10:28:47 [linux-2.73.1] [INFO] Possible null pointer dereference in hudson.plugins.sshslaves.verifiers.MissingVerificationStrategyAdministrativeMonitor.isTheNewDesignAvailable() due to return value of called method [hudson.plugins.sshslaves.verifiers.MissingVerificationStrategyAdministrativeMonitor, hudson.plugins.sshslaves.verifiers.MissingVerificationStrategyAdministrativeMonitor] Dereferenced at MissingVerificationStrategyAdministrativeMonitor.java:[line 68]Known null at MissingVerificationStrategyAdministrativeMonitor.java:[line 68] NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

@oleg-nenashev
Copy link
Member

Releasing new version without it

@recena
Copy link
Contributor Author

recena commented Jan 28, 2018

@oleg-nenashev I don't know why I cannot see this error. I've checked the possible null.

@oleg-nenashev
Copy link
Member

Restarted the CI build

@oleg-nenashev oleg-nenashev merged commit 9a017f4 into jenkinsci:master Feb 26, 2018
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.

7 participants