Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-3810

When using Condition class in atlassian-plugin.xml, transitive dependency beans are not implicitly included

    XMLWordPrintable

    Details

    • Feedback Policy:
      We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Description

      The following XML should create a repro:

          <web-item key="somekey" name="somename" weight="20" section="atl.admin/admin-settings-section" application="stash">
              <condition class="com.atlassian.stash.web.conditions.HasGlobalPermissionCondition">
                  <param name="permission">SYS_ADMIN</param>
              </condition>
              <label key="plugin.page.repo.ci.info.tab.label">somelabel</label>
              <tooltip key="plugin.page.repo.ci.sys.info.tab.tooltip">sometooltip</tooltip>
              <link>/somepath</link>
          </web-item>
      

      In an atlassian-plugin.xml which does NOT have a <component-import/> tag for PermissionService. Furthermore, even explicitly component-import-ing the condition class doesn't resolve it. If the condition class depended upon several beans, you'd have to trial-and-error determine each of its transitive dependencies and add them one-by-one.

      A complete example of the bugged condition can be found here: https://github.com/palantir/stashbot/blob/7226bedc0ea5e886787a46a4b31125bdda418598/src/main/resources/atlassian-plugin.xml

      In this revision of the file, I tried adding component-imports fort he condition classes but it just caused things to fail silently (and frustratingly), in stash 2.6.1 the plugin fails to enable.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              cmyers Carl Myers
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but there is no synchronization info for this issue.