-
Bug
-
Resolution: Fixed
-
Minor
-
-
2.362
Symbol framework doesn't work properly if plugin's artifactId contains word "plugin-".
Pattern of symbol framework:
<l:icon src="symbol-symbolName plugin-yourArtifactId" />
Under the hood it uses this method Functions#extractPluginNameFromIconSrc which finds word starting with "plugin-" and then replaces all occurrences to "".
For instance, if your plugin's artifactId will be plugin-test, the pattern will look like:
<l:icon src="symbol-symbolName plugin-plugin-test" />
and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only test will be left.
So instead of searching image from plugin-test, it will be searching image from test which doesn't exist.
Solution would be to use replaceFirst instead of replace in Functions#extractPluginNameFromIconSrc
[JENKINS-68801] Symbol framework doesn't work properly if plugin's artifactId contains word "plugin-"
Description |
Original:
Symbol framework doesn't work properly if plugin's artifactId contains word "{*}plugin-{*}".
Pattern of [symbol framework|https://weekly.ci.jenkins.io/design-library/Symbols/#:~:text=%3Cl%3Aicon%20src%3D%22symbol%2DsymbolName%20plugin%2DyourArtifactId%22%20/%3E]: {{<l:icon src="symbol-symbolName plugin-yourArtifactId" />}} Under the hood it uses this method [Functions#extractPluginNameFromIconSrc|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Functions.java#:~:text=(%22%20%22)%3B-,for%20(String%20element%20%3A%20arr)%20%7B,%7D,-return%20%22%22%3B] which finds word starting with "plugin-" and replaces all occurrences to "". For instance, if your plugin's artifactId will be plugin-test, the pattern will look like: {{<l:icon src="symbol-symbolName plugin-plugin-test" />}} and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only *test* will be left. So instead of searching image from {*}plugin-test{*}, it will be searching image from *test* which doesn't exist. |
New:
Symbol framework doesn't work properly if plugin's artifactId contains word "{*}plugin-{*}".
Pattern of [symbol framework|https://weekly.ci.jenkins.io/design-library/Symbols/#:~:text=%3Cl%3Aicon%20src%3D%22symbol%2DsymbolName%20plugin%2DyourArtifactId%22%20/%3E]: {{<l:icon src="symbol-symbolName plugin-yourArtifactId" />}} Under the hood it uses this method [Functions#extractPluginNameFromIconSrc|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Functions.java#:~:text=(%22%20%22)%3B-,for%20(String%20element%20%3A%20arr)%20%7B,%7D,-return%20%22%22%3B] which finds word starting with "plugin-" and then replaces all occurrences to "". For instance, if your plugin's artifactId will be plugin-test, the pattern will look like: {{<l:icon src="symbol-symbolName plugin-plugin-test" />}} and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only *test* will be left. So instead of searching image from {*}plugin-test{*}, it will be searching image from *test* which doesn't exist. |
Description |
Original:
Symbol framework doesn't work properly if plugin's artifactId contains word "{*}plugin-{*}".
Pattern of [symbol framework|https://weekly.ci.jenkins.io/design-library/Symbols/#:~:text=%3Cl%3Aicon%20src%3D%22symbol%2DsymbolName%20plugin%2DyourArtifactId%22%20/%3E]: {{<l:icon src="symbol-symbolName plugin-yourArtifactId" />}} Under the hood it uses this method [Functions#extractPluginNameFromIconSrc|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Functions.java#:~:text=(%22%20%22)%3B-,for%20(String%20element%20%3A%20arr)%20%7B,%7D,-return%20%22%22%3B] which finds word starting with "plugin-" and then replaces all occurrences to "". For instance, if your plugin's artifactId will be plugin-test, the pattern will look like: {{<l:icon src="symbol-symbolName plugin-plugin-test" />}} and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only *test* will be left. So instead of searching image from {*}plugin-test{*}, it will be searching image from *test* which doesn't exist. |
New:
Symbol framework doesn't work properly if plugin's artifactId contains word "{*}plugin-{*}".
Pattern of [symbol framework|https://weekly.ci.jenkins.io/design-library/Symbols/#:~:text=%3Cl%3Aicon%20src%3D%22symbol%2DsymbolName%20plugin%2DyourArtifactId%22%20/%3E]: {{<l:icon src="symbol-symbolName plugin-yourArtifactId" />}} Under the hood it uses this method [Functions#extractPluginNameFromIconSrc|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Functions.java#:~:text=(%22%20%22)%3B-,for%20(String%20element%20%3A%20arr)%20%7B,%7D,-return%20%22%22%3B] which finds word starting with "plugin-" and then replaces all occurrences to "". For instance, if your plugin's artifactId will be plugin-test, the pattern will look like: {{<l:icon src="symbol-symbolName plugin-plugin-test" />}} and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only *test* will be left. So instead of searching image from {*}plugin-test{*}, it will be searching image from *test* which doesn't exist. I would suggest to: # After finding first occurrence of "plugin-" replacing only first 7 characters. # Or it would be better to find occurrence with " plugin-" (with space) and then replacing only first 7 characters, so If our *symbolName* will contain "plugin-", it will be ignored and not replaced. (For instance, if we have such pattern {{<l:icon src="symbol-plugin-symbol plugin-plugin-test-ui" />, it will only remove " plugin-" instead of 3 occurrences.}} |
Description |
Original:
Symbol framework doesn't work properly if plugin's artifactId contains word "{*}plugin-{*}".
Pattern of [symbol framework|https://weekly.ci.jenkins.io/design-library/Symbols/#:~:text=%3Cl%3Aicon%20src%3D%22symbol%2DsymbolName%20plugin%2DyourArtifactId%22%20/%3E]: {{<l:icon src="symbol-symbolName plugin-yourArtifactId" />}} Under the hood it uses this method [Functions#extractPluginNameFromIconSrc|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Functions.java#:~:text=(%22%20%22)%3B-,for%20(String%20element%20%3A%20arr)%20%7B,%7D,-return%20%22%22%3B] which finds word starting with "plugin-" and then replaces all occurrences to "". For instance, if your plugin's artifactId will be plugin-test, the pattern will look like: {{<l:icon src="symbol-symbolName plugin-plugin-test" />}} and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only *test* will be left. So instead of searching image from {*}plugin-test{*}, it will be searching image from *test* which doesn't exist. I would suggest to: # After finding first occurrence of "plugin-" replacing only first 7 characters. # Or it would be better to find occurrence with " plugin-" (with space) and then replacing only first 7 characters, so If our *symbolName* will contain "plugin-", it will be ignored and not replaced. (For instance, if we have such pattern {{<l:icon src="symbol-plugin-symbol plugin-plugin-test-ui" />, it will only remove " plugin-" instead of 3 occurrences.}} |
New:
Symbol framework doesn't work properly if plugin's artifactId contains word "{*}plugin-{*}".
Pattern of [symbol framework|https://weekly.ci.jenkins.io/design-library/Symbols/#:~:text=%3Cl%3Aicon%20src%3D%22symbol%2DsymbolName%20plugin%2DyourArtifactId%22%20/%3E]: {{<l:icon src="symbol-symbolName plugin-yourArtifactId" />}} Under the hood it uses this method [Functions#extractPluginNameFromIconSrc|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Functions.java#:~:text=(%22%20%22)%3B-,for%20(String%20element%20%3A%20arr)%20%7B,%7D,-return%20%22%22%3B] which finds word starting with "plugin-" and then replaces all occurrences to "". For instance, if your plugin's artifactId will be plugin-test, the pattern will look like: {{<l:icon src="symbol-symbolName plugin-plugin-test" />}} and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only *test* will be left. So instead of searching image from {*}plugin-test{*}, it will be searching image from *test* which doesn't exist. I would suggest to: # After finding first occurrence of "plugin-" replacing (substring instead of replace in java code) only first 7 characters. # Or it would be better to find occurrence with " plugin-" (with space) and then replacing only first 7 characters, so If our *symbolName* will contain "plugin-", it will be ignored and not replaced. (For instance, if we have such pattern {{<l:icon src="symbol-plugin-symbol plugin-plugin-test-ui" />, it will only remove " plugin-" instead of 3 occurrences.}} |
Description |
Original:
Symbol framework doesn't work properly if plugin's artifactId contains word "{*}plugin-{*}".
Pattern of [symbol framework|https://weekly.ci.jenkins.io/design-library/Symbols/#:~:text=%3Cl%3Aicon%20src%3D%22symbol%2DsymbolName%20plugin%2DyourArtifactId%22%20/%3E]: {{<l:icon src="symbol-symbolName plugin-yourArtifactId" />}} Under the hood it uses this method [Functions#extractPluginNameFromIconSrc|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Functions.java#:~:text=(%22%20%22)%3B-,for%20(String%20element%20%3A%20arr)%20%7B,%7D,-return%20%22%22%3B] which finds word starting with "plugin-" and then replaces all occurrences to "". For instance, if your plugin's artifactId will be plugin-test, the pattern will look like: {{<l:icon src="symbol-symbolName plugin-plugin-test" />}} and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only *test* will be left. So instead of searching image from {*}plugin-test{*}, it will be searching image from *test* which doesn't exist. I would suggest to: # After finding first occurrence of "plugin-" replacing (substring instead of replace in java code) only first 7 characters. # Or it would be better to find occurrence with " plugin-" (with space) and then replacing only first 7 characters, so If our *symbolName* will contain "plugin-", it will be ignored and not replaced. (For instance, if we have such pattern {{<l:icon src="symbol-plugin-symbol plugin-plugin-test-ui" />, it will only remove " plugin-" instead of 3 occurrences.}} |
New:
Symbol framework doesn't work properly if plugin's artifactId contains word "{*}plugin-{*}".
Pattern of [symbol framework|https://weekly.ci.jenkins.io/design-library/Symbols/#:~:text=%3Cl%3Aicon%20src%3D%22symbol%2DsymbolName%20plugin%2DyourArtifactId%22%20/%3E]: {{<l:icon src="symbol-symbolName plugin-yourArtifactId" />}} Under the hood it uses this method [Functions#extractPluginNameFromIconSrc|https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/Functions.java#:~:text=(%22%20%22)%3B-,for%20(String%20element%20%3A%20arr)%20%7B,%7D,-return%20%22%22%3B] which finds word starting with "plugin-" and then replaces all occurrences to "". For instance, if your plugin's artifactId will be plugin-test, the pattern will look like: {{<l:icon src="symbol-symbolName plugin-plugin-test" />}} and then Functions#extractPluginNameFromIconSrc will replace both "plugin-" occurrences with "" and only *test* will be left. So instead of searching image from {*}plugin-test{*}, it will be searching image from *test* which doesn't exist. Solution would be to use replaceFirst instead of replace in Functions#extractPluginNameFromIconSrc |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Status | Original: In Progress [ 3 ] | New: In Review [ 10005 ] |
Remote Link | New: This issue links to "https://github.com/jenkinsci/jenkins/pull/6902 (Web Link)" [ 27995 ] |
Released As | New: 2.362 | |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Review [ 10005 ] | New: Closed [ 6 ] |
Labels | New: lts-candidate |
Labels | Original: lts-candidate | New: 2.361.1-fixed |