Upgrade JIRA Agile's usage of underscore.js so that it can depend on the version supplied by JIRA/AUI

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Won't Do
    • None
    • Component/s: AgileBoard
    • Environment:
      JIRA 5.1 (SDK, Standalone). Standard bundled Tomcat. JDK 1.6.0_32. Ubuntu 12.04 LTS x64.

      NOTE: This suggestion is for JIRA Software Server. Using JIRA Software Cloud? See the corresponding suggestion.

      Created due to support suggestion and bug report ticket, redirected to support

      I've been investigating problems of interaction between our plugin and JAG, which occurs to a customer, who uses JIRA 5.1.

      SYNOPSIS:
      In a nutshell, the problem is the following: if there is an add-on, which has a

      <dependency>com.atlassian.auiplugin:ajs-underscorejs</dependency>
      

      specified for context, applicable for JAG's own screens (like "... /secure/RapidBoard.jspa?rapidView=1&view=planning"), the JAG gets broken (can not render it's views, due to imported underscorejs priority over JAGs own underscorejs).
      The issues root cause comes from the underscorejs version conflict (JAG expects underscorejs to be 1.4.4, but if there is plugin, imporing underscorejs from AUI, the imported underscorejs version might not be 1.4.4)*.

      For me, as for a plugin developer there are such concerns:

      • If I would later on need to render my plugin's UI on a JAG's own page, I will have to either switch to my own no-conflict underscorejs (which would give an additional library to maintain), or to rely on the fact, that JAG uses underscorejs and thus do not import it (which is really a bad practice).
      • (warning: becoming grouchy here) AUI and ADG encourage library reuse** throughout front-end applications. If this is a strongly advised principle, why should people make workarounds in order for another vendors plugin (read "JAG") to work properly. I mean, there would be a plugin, which needs it's dependencies throughout all the contexts (even for JAG's own pages, as JAG is a great plugin somewhat a standard for Agile project tracking). Should such a plugin's vendor diverge from the concepts and recommendations?
      • Any plugin with underscorejs dependency in the highlighted contexts block the JAG. I believe, that implies, that some plugin developers would stumble upon that incompatibility and would spend quite some time to dig to the issue root cause (this story might document the issue such that it would be searchable)

      SCENARIO:

      1. run atlas-create-jira-plugin
      2. ensure
        <web-resource key="foo" name="Bar">
                <dependency>com.atlassian.auiplugin:ajs-underscorejs</dependency>
                <context>atl.general</context>
                <context>atl.admin</context>
        </web-resource>
        

        in the atlassian-plugin.xml

      3. ensure the plugin is able to run on JIRA 5.1
      4. run atlas-run against the new plugin
      5. install the JAG
      6. go to the JAG getting started page
      7. configure a project for Agile
      8. create an agile board
      9. open the web browser debug console
      10. go to that board,
        (observation) see the agile board not loading Unable to embed resource: 10678_01.png of type image/png
        (observation) see a typeError indicating, that _.chain is not a function

      SCENARIO 2 (JAG 6.3.2.2):

      1. run atlas-create-jira-plugin
      2. ensure
        <web-resource key="foo" name="Bar">
                <dependency>com.atlassian.auiplugin:ajs-underscorejs</dependency>
                <context>atl.general</context>
                <context>atl.admin</context>
        </web-resource>
        

        in the atlassian-plugin.xml

      3. ensure the plugin is able to run on JIRA 5.1
      4. run atlas-run against the new plugin
      5. install the JAG
      6. go to the JAG getting started page
      7. click "create a new board" button on the Agile panel
        (observation) see a blank popup Unable to embed resource: 10678_02.png of type image/png
        (observation) see a typeError in the web browser firebug console indicating, that _.chain is not a function

        * - if one would wonder to see the version matrix for AUI to JIRA and the version matrix for underscorejs in AUI, one would note, that only starting from JIRA 6.2 (where JIRA uses AUI 5.3.3), the underscorejs version in the AUI would catch up the underscorejs version in JAG (although the issue with _.chain not present would not occur in JIRA starting from JIRA 6.0, which uses AUI 5.0.1, which includes underscorejs 1.3.1)
        ** - https://developer.atlassian.com/display/AUI/Tips+for+Implementing+AUI

        Do not include your own/another copy of the bundled libraries.

        1. 10678_01.png
          10678_01.png
          167 kB
        2. 10678_02.png
          10678_02.png
          128 kB

            Assignee:
            Unassigned
            Reporter:
            SerhiyO
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: