From The Document Foundation Wiki
    < QA‎ | BSA

    This page was marked as inactive and is retained for historical reference.
    BSA is retired

    This page describes the Implementation of the Bug Submission Assistant (BSA).


    The following should contain all the information a developer need to know to work on the implementation of the Bug Submission Assistant. It covers all that cannot be easily deduced from reading the code or the associated tests.

    The general idea is to create a web application that fits in a single HTML page. This page ( ) is added to the regular bugzilla web site ( ). However, because it would make no sense to insert such a specialized page to, it is done using a reverse proxy assembling the two together. This server side setup allows the web application to query bugzilla without violating the same origin policyWikipedia logo v3.svg and does not require any server code.


    • All the sources are in JavaScript
    • It uses JQuery
    • Each line of code must be tested
    • The core is in [1]
      • The behavior of each step is encapsulated in a state_XXXX function that is called by the previous step and is responsible for invoking the state_YYYY function of the next step when it is finished.
      • A state function is not given any argument and must not provide any argument to the next state function. For instance, the state_subcomponent will retrieve the name of the component from the DOM and not from its arguments.
      • The general idea is to be able to develop within the context of a state function without knowing the behavior of the previous state functions nor trying to figure out an API between state functions.
      • The error model is to throw after displaying a message in the .error element
      • The $.bug.ajax function is a wrapper for $.ajax function that throw on error and display a message in the .error element
      • The $.bug.lookup_result function analyzes a page returned by bugzilla, looking for an error pattern. If one is found, it display a message in the .error element and throws. Otherwise it returns the string found by the first capturing parenthesis of the success pattern.
      • The code does not contain or generate any markup.
      • The ajax calls must use the ajax().pipe() form for consistency. It is not a cosmetic point, it has impact on the code structure.
      • The compatibility function is designed for code that needs to be run once, when the page is loaded, to help with cross browser compatibility
    • The dropdown selections ( version, component etc. ) are implemented in select.js
    • The tests are implemented in test.js.
      • There is at least one test function per function found in the bug.js file.
      • The test.html file partially copies the markup from bug.xhtml. It is intentional and no attempt must be made to run the tests using the exact same markup.
      • The test.html file must include the same CSS as bug.xhtml because it will have consequences on the position and visibility of the elements and such consequences must be tested.


    • If javascript is disabled, a link to bugzilla is shown
    • If the browser version is known to fail, a link to bugzilla is shown
    • For each supported browsers, the tests are run, each ?skin=XXX URL is checked, a fake bug is reported and then deleted from bugzilla. A permanent item is set in the TODO list as this work must be done on a regular basis.

    CSS/HTML integration

    Adding a new component

    There are three primary steps to adding a new Component to Bugzilla and the BSA:

    • Create a new component in Bugzilla
     e.g. 'UX-Advice'
    • Create a set of wiki pages using the name of the new component (name is case-sensitive).
      • The pages use some template/wiki-markup tricks, so copy the content from an existing component to serve as the basis of each page.
     e.g. Create
     Template:BugzAssHlp UX-Advice
     QA/Bugzilla/Components/UX-Advice/Extended Help
     Add the component to the list on this page:
    • Update files in the BSA to include the new component:

    (Note: the lists of components are alphabetical)

    Installation and maintenance



      • ssh
      • cd /var/www/sites/
      • git pull
      • make
      • In change ?version=X in the iframe to invalidate the cache

    Installation integration

    The official entry point (in the draft site before it is published) is implemented as a JS Pagecontaining an iframe within silverstripe

    <p><iframe src="/bugassistant/bug/bug.html" width="850" height="800" frameborder="0"> </iframe></p>

    Note that the <p> is required to prevent silverstripe from editing the inner HTML. A reverse proxy to is defined server side (see #System Administration) and the location to which it is bound is defined in a javascript file[dead link] that is attached to the page using the Java Script tab in the admin panel for the Bug page in silverstripe.

    Bugzilla Integration

    The BSA requires a Bugzilla installation to be running XML-RPC.

    • We've been running into some problems since upgraded to Bugzilla 4.4.5
    • For notes on testing, see QA/Bugzilla/Deployment.

    System Administration

    The host name is defined as a reverse proxy to on kermit

    <VirtualHost *:443>
        DocumentRoot        /var/www/sites/
        ProxyPass           /libreoffice !
        ProxyPass           / retry=1
        ProxyPreserveHost   On
        SSLProxyEngine      On
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/
        SSLCertificateKeyFile /etc/ssl/private/
        SSLCertificateChainFile /etc/ssl/certs/
        CustomLog /var/log/apache2/ vhost_combined

    Three URLs involved :

    The user entry point includes an iframe with which calls either thru ajax or via form submissions encapsulated in an iframe. The URL is handled by silverstripe,[dead link] is defined by the virtual host above and[dead link] uses a reverse proxy (as well as that must be added to the virtual host definition as follows:

    <VirtualHost *:443>
      Alias /bugassistant/ /var/www/sites/
      SSLProxyEngine      On
      # This location will be used by
      # when included in an iframe in to obey the
      # same origin policy and be allowed to explore the DOM of an iframe containing
      # a bug submission form result.
      ProxyPass           /bugzilla/ retry=1
      ProxyPreserveHost   On
      # Bugzilla will redirect 
      # to
      # when the user is logged in. To preserve the /bugzilla/ directory
      # the Location: header must be reworked, which is the purpose of
      # the ProxyPassReverse that follow. 
      # Note that bugzilla does *not* return a Location that is 
      # because it creates the Location: header using the hostname from 
      # which the request was originally made, i.e. or
      # However, bugzilla has no way to know that the
      # original path of the request was prefixed with /bugzilla/ and it is
      # the responsibility of the reverse proxy to rewrite the location 
      # accordingly.
      ProxyPassReverse   /bugzilla/
      ProxyPassReverse   /bugzilla/
    <VirtualHost *:80>
      # Bug reporting is forced to https because bugzilla always uses https
      # Any attempt to access it from http would violate the same origin policy.
      RewriteRule ^/get-help/bug/$ [R=301,L,NC]

    The following packages need to be installed on the server:


    • proposed to relay the need for translation, both on * and the wiki.
    • When the page content is modified, it must be copied over to the * sites which are separate silverstripe site instances. The URL in the iframe must be copied over and the bug-XX.html changed to the matching locale in the wiki. For instance,

    <iframe src="" width="850" height="800" frameborder="0"> </iframe>

    must be replaced by

    <iframe src="" width="850" height="800" frameborder="0"> </iframe>

    in .

    <div class="component"> ... </div>

    that can be found in the source of the page. These elements must be preserved and not translated so that the software can identify which texts must be used.

    Data sources


    Sanity checks are run each time the Bug Submission Assistant is generated:

    This will check if all components in the BSA exist in bugzilla