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

Broken sidebar icons in GitLab Branch Source plugin (regression in 2.341)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • Jenkins 2.343, gitlab-branch-source-plugin 1.5.9
    • 2.348, 2.346.1

      Since 2.341, the sidebar icons of the gitlab branch source plugin are broken:

      Restoring to 2.340 and below resolves the problem.
      To reproduce:

      1. Create a new multibranch pipeline (workflow-multibranch-plugin)
      2. Branch Sources -> Add Source -> GitLab Project (make sure you have the gitlab branch source plugin installed)
      3.  In the "Owner" field add your GitLab username and the project you want to add in the "Projects" dropdown. Preferably you have a repository with a dummy Jenkinsfile, e.g. https://gitlab.com/NotMyFault/jenkinsfile to utilize the option "Jenkinsfile" on Build Configuration -> Script Path
      4. Save the configuration, wait until the scanning is done and you can see the broken image on the sidebar of the job overview.

      This issue is a copy of https://github.com/jenkinsci/gitlab-branch-source-plugin/issues/185 to track it on the ux regression dashboard on Jira.

          [JENKINS-68296] Broken sidebar icons in GitLab Branch Source plugin (regression in 2.341)

          Alexander Brandes created issue -
          Alexander Brandes made changes -
          Description Original: Since 2.341, the sidebar icons of the gitlab branch source plugin are broken:

          !https://i.imgur.com/NwHbFPy.png!

          Restoring to 2.340 and below resolves the problem.
          To reproduce:
           # Create a new multibranch pipeline (workflow-multibranch-plugin)
           # Branch Sources -> Add Source -> GitLab Project (make sure you have the gitlab branch source plugin installed)
           #  In the "Owner" field add your GitLab username and the project you want to add in the "Projects" dropdown. Preferably you have a repository with a dummy Jenkinsfile, e.g. [https://gitlab.com/NotMyFault/jenkinsfile] to utilize the option "Jenkinsfile" on Build Configuration -> Script Path
           # Save the configuration, wait until the scanning is done and you can see the broken image on the table view.

          This issue is a copy of https://github.com/jenkinsci/gitlab-branch-source-plugin/issues/185 to track it on the ux regression dashboard on Jira.
          New: Since 2.341, the sidebar icons of the gitlab branch source plugin are broken:

          !https://i.imgur.com/NwHbFPy.png!

          Restoring to 2.340 and below resolves the problem.
          To reproduce:
           # Create a new multibranch pipeline (workflow-multibranch-plugin)
           # Branch Sources -> Add Source -> GitLab Project (make sure you have the gitlab branch source plugin installed)
           #  In the "Owner" field add your GitLab username and the project you want to add in the "Projects" dropdown. Preferably you have a repository with a dummy Jenkinsfile, e.g. [https://gitlab.com/NotMyFault/jenkinsfile] to utilize the option "Jenkinsfile" on Build Configuration -> Script Path
           # Save the configuration, wait until the scanning is done and you can see the broken image on the sidebar of the job overview.

          This issue is a copy of https://github.com/jenkinsci/gitlab-branch-source-plugin/issues/185 to track it on the ux regression dashboard on Jira.
          Basil Crow made changes -
          Link New: This issue is caused by JENKINS-68137 [ JENKINS-68137 ]
          Basil Crow made changes -
          Summary Original: Broken sidebar icons in gitlab branch source plugin (regression since 2.341) New: Broken sidebar icons in gitlab branch source plugin (regression in 2.341)
          Basil Crow made changes -
          Summary Original: Broken sidebar icons in gitlab branch source plugin (regression in 2.341) New: Broken sidebar icons in GitLab Branch Source plugin (regression in 2.341)
          Adrien Lecharpentier made changes -
          Assignee New: Adrien Lecharpentier [ alecharp ]
          Adrien Lecharpentier made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          When the GitlabSCMSource and GitlabSCMNavigator retrieveActions methods are triggered, a GitlabLink action (IconSpec implementation) are added to the relevant output of the project.

          Those GitlabLink objects have a gitlab-X reference, which is used in the actions.jelly of core to resolve the icon to use (through a task.jelly which will be resolved as a icon.jelly).

          During the initialization of the plugin, icons are added into the IconSet "bank" with the id "gitlab-X".
          This provides the controller with a way to resolve "gitlab-X" -> URL to be able to fetch the image.

          The IconSet has:

          • a map which resolves the URL to an Icon
          • a map which resolves the CSS class to a Icon
          • a map which resolves the Class Spec to a Icon

          (not mentioning the core icons)

          When adding a Icon into the IconSet, the method addIcon adds it to the CSSSelector and URL resolver, but not to the ClassSpec. However, when the instance is completely initialized, we can run

          org.jenkins.ui.icon.IconSet.icons.iconsByClassSpec.each { key,val ->
            println key + " -> " + val.url;
          }
          

          and see that the gitlab-X are added but with the URL _.

          The actions.jelly tries to resolve the iconClassName using the IconSet#getIconByClassSpec only and find a IconSet#NO_ICON placeholder. In the end, the icons are not shown.

          However, and this shouldn't be the fix, but adding the icon- prefix to the icons class spec, on the GitlabLink objects and on the iconClassName of both GitlabSCMSource and GitlabSCMNavigator descriptors fix the problem, for new projects.

          Adrien Lecharpentier added a comment - When the GitlabSCMSource and GitlabSCMNavigator retrieveActions methods are triggered, a GitlabLink action ( IconSpec implementation) are added to the relevant output of the project. Those GitlabLink objects have a gitlab-X reference, which is used in the actions.jelly of core to resolve the icon to use (through a task.jelly which will be resolved as a icon.jelly ). During the initialization of the plugin, icons are added into the IconSet "bank" with the id "gitlab-X". This provides the controller with a way to resolve "gitlab-X" -> URL to be able to fetch the image. The IconSet has: a map which resolves the URL to an Icon a map which resolves the CSS class to a Icon a map which resolves the Class Spec to a Icon (not mentioning the core icons) When adding a Icon into the IconSet , the method addIcon adds it to the CSSSelector and URL resolver, but not to the ClassSpec. However, when the instance is completely initialized, we can run org.jenkins.ui.icon.IconSet.icons.iconsByClassSpec.each { key,val -> println key + " -> " + val.url; } and see that the gitlab-X are added but with the URL _ . The actions.jelly tries to resolve the iconClassName using the IconSet#getIconByClassSpec only and find a IconSet#NO_ICON placeholder. In the end, the icons are not shown. However, and this shouldn't be the fix , but adding the icon- prefix to the icons class spec , on the GitlabLink objects and on the iconClassName of both GitlabSCMSource and GitlabSCMNavigator descriptors fix the problem, for new projects.
          Alexander Brandes made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Alexander Brandes made changes -
          Status Original: In Review [ 10005 ] New: In Progress [ 3 ]

            alecharp Adrien Lecharpentier
            notmyfault Alexander Brandes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: