-
Notifications
You must be signed in to change notification settings - Fork 43
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
[JENKINS-63149] - Adding JCasC support #25
Conversation
Thank you! I added it to my review queue. |
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.
Comments are left, please review
pom.xml
Outdated
</parent> | ||
|
||
<artifactId>sidebar-link</artifactId> | ||
<packaging>hpi</packaging> | ||
<name>Sidebar Link</name> | ||
<version>1.12.1-SNAPSHOT</version> | ||
<url>http://wiki.jenkins-ci.org/display/JENKINS/Sidebar-Link+Plugin</url> | ||
<version>2.00.1</version> |
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.
is it compatible with v1.12 ?
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.
I'm afraid not.
I don't believe that I managed it to be compatible.
@@ -50,6 +52,31 @@ | |||
<version>1.3</version> | |||
<scope>test</scope> | |||
</dependency> | |||
<dependency> |
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.
do we need joda for this 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.
I don't know how to solve the plugin conflict in another way:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for joda-time:joda-time:2.1 paths to dependency are:
+-org.jenkins-ci.plugins:sidebar-link:2.00.1
+-org.jenkinsci.plugins:pipeline-model-definition:1.8.4
+-org.jenkinsci.plugins:pipeline-model-api:1.8.4
+-com.github.fge:json-schema-validator:2.0.4
+-joda-time:joda-time:2.1
and
+-org.jenkins-ci.plugins:sidebar-link:2.00.1
+-io.jenkins.configuration-as-code:test-harness:1.47
+-com.github.erosb:everit-json-schema:1.12.1
+-com.damnhandy:handy-uri-templates:2.1.8
+-joda-time:joda-time:2.10.2
@@ -59,9 +62,14 @@ public LinkAction(String urlName, String displayName, String iconFileName) throw | |||
throw new IllegalArgumentException(validationResult); | |||
} | |||
|
|||
if((iconFileName == null) || (iconFileName.equals(""))) { |
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.
StringUtils.isBlank(iconFileName) like below
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.
Done: please review "minor changes due to review"
Hi! Any chance to have this PR reviewed and merged ? We are interested to use this plugin but are missing jcasc support. Thanks! |
JCasC is merged. I will be happy to release it but before that I need to test it. Who can help me about it? I believe the readme file must be updated as well so it has some simple documentation how to use it |
@damianszczepanik Amazing! I will test tomorrow the master branch. I will only test that the JcasC configuration is working for the global links (I don't use other feature). Thanks |
Hi, I've tested the creation of global links via JcasC. All working as expected
|
Published |
@@ -59,9 +64,14 @@ public LinkAction(String urlName, String displayName, String iconFileName) throw | |||
throw new IllegalArgumentException(validationResult); | |||
} | |||
|
|||
if(StringUtils.isBlank(iconFileName)) { | |||
iconFileName = "static/efbf17e4/images/16x16/help.png"; |
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 efbf17e4
seems to be SESSION_HASH
from https://github.com/jenkinsci/jenkins/blob/5661c1055d026424118e2488b84ea22a19bf423d/core/src/main/java/jenkins/model/Jenkins.java#L5330-L5336. Perhaps the default iconFileName
should instead be just "images/16x16/help.png"
. Reading the current hash from Jenkins.RESOURCE_PATH
seems a worse alternative because the resulting iconFileName
will be persisted and used after subsequent Jenkins upgrades.
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.
Also, war/src/main/webapp/images/16x16/help.png
was deleted from the Jenkins core in jenkinsci/jenkins#5778.
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.
Filed #40 about the default icon.
@Restricted(NoExternalUse.class) | ||
public FormValidation doCheckLinkIcon(@QueryParameter String value) { | ||
if (StringUtils.isBlank(value)) { | ||
return FormValidation.warning("The provided icon is blank or empty. Defautl will used."); |
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.
"Default" not "Defautl"
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.
Was fixed in dd8e66e.
Solves JENKINS-63149: Adding support for JCasC
Details:
Using Descriptor interface instead of Plugin extension
Moving validation of parameters to FormValidation
Adding JCasCCompatibilityTest
Resolving minor compiler warnings and spaces at end of line
Updating pom dependencies
Make sure you are opening from a topic/feature/bugfix branch (right side) and not your master 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