Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68286

layout:icon doesn't accept extra class attribute

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • jenkins-2.164.3
      jenkins-2.343
    • 2.347

      Found in https://github.com/jenkinsci/copyartifact-plugin/pull/147.
      Class attributes of layout:icon custom tag are used to specify icons, and extra developer-defined class results to fail to find icon.

      It blocks plugins migrating img to layout:icon, which triggered by https://github.com/jenkinsci/jenkins/pull/5778 .

      TODO:

          [JENKINS-68286] layout:icon doesn't accept extra class attribute

          ikedam created issue -
          ikedam made changes -
          Description Original: Found in https://github.com/jenkinsci/copyartifact-plugin/pull/147.
          Class attributes of layout:icon custom tag are used to specify icons, and extra developer-defined class results to fail to find icon.

          It blocks plugins migrating img to layout:icon, which triggered by https://github.com/jenkinsci/jenkins/pull/5778 .

          TODO:

          * Test with the latest core
          * Resolve the issue with:
          ** A: ignore classes without icon- prefixes
          ** B: add extraClass attribute
          ** C: update document, and allow developers to use src if they want to specify extra class.
          *** Actually, documentation of layout:icon looks buggy as it states that src is ignored if class is specified (but actually, src is checked first): https://github.com/jenkinsci/jenkins/blob/jenkins-2.343/core/src/main/resources/lib/layout/icon.jelly

          New: Found in https://github.com/jenkinsci/copyartifact-plugin/pull/147.
          Class attributes of layout:icon custom tag are used to specify icons, and extra developer-defined class results to fail to find icon.

          It blocks plugins migrating img to layout:icon, which triggered by https://github.com/jenkinsci/jenkins/pull/5778 .

          TODO:

          * -Test with the latest core- -> Verified reproduction with Jenkins 2.343
          * Resolve the issue with:
          ** A: ignore classes without icon- prefixes
          ** B: add extraClass attribute
          ** C: update document, and allow developers to use src if they want to specify extra class.
          *** Actually, documentation of layout:icon looks buggy as it states that src is ignored if class is specified (but actually, src is checked first): https://github.com/jenkinsci/jenkins/blob/jenkins-2.343/core/src/main/resources/lib/layout/icon.jelly

          Environment Original: jenkins-2.164.3
          Not tested with newer cores, but I believe this affects also the latest core, jenkins-2.343)
          New: jenkins-2.164.3
          jenkins-2.343

          ikedam added a comment - Icons are registered with `IconSet.icons.addIcon`: https://github.com/jenkinsci/jenkins/blob/jenkins-2.344/core/src/main/java/org/jenkins/ui/icon/IconSet.java#L145 Built-in icons: https://github.com/jenkinsci/jenkins/blob/jenkins-2.344/core/src/main/java/org/jenkins/ui/icon/IconSet.java#L348 https://github.com/jenkinsci/jenkins/blob/jenkins-2.344/core/src/main/java/org/jenkins/ui/icon/IconSet.java#L554 https://github.com/jenkinsci/jenkins/blob/jenkins-2.344/core/src/main/java/hudson/model/FreeStyleProject.java#L115

          ikedam added a comment -

          Classes for built-in icons are started with `icon-`, but it's not documented one and plugins may register icons without icon- prefix: https://github.com/jenkinsci/jenkins/blob/jenkins-2.344/core/src/main/java/org/jenkins/ui/icon/Icon.java#L71

          ikedam added a comment - Classes for built-in icons are started with `icon-`, but it's not documented one and plugins may register icons without icon- prefix: https://github.com/jenkinsci/jenkins/blob/jenkins-2.344/core/src/main/java/org/jenkins/ui/icon/Icon.java#L71

          ikedam added a comment -

          ikedam added a comment - I cannot get what this is: https://github.com/jenkinsci/jenkins/blob/jenkins-2.344/core/src/main/java/hudson/Functions.java#L2292-L2293 This makes `tryGetIcon` difficult to test.

          ikedam added a comment -

          layout:icon was introduced in https://github.com/jenkinsci/jenkins/pull/6186

          ikedam added a comment - layout:icon was introduced in https://github.com/jenkinsci/jenkins/pull/6186
          ikedam made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          ikedam made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          ikedam added a comment -

          ikedam added a comment - https://github.com/jenkinsci/jenkins/pull/6510
          Alexander Brandes made changes -
          Remote Link New: This issue links to "https://github.com/jenkinsci/jenkins/pull/6510 (Web Link)" [ 27704 ]

            ikedam ikedam
            ikedam ikedam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: