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

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

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • Plugin Development
    • None
    • 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

              Unassigned Unassigned
              05165c812422 Carl Myers
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated: