The Portfolios management interface allows you to configure both Portfolios and Applications. It is divided into two or three columns. On the left is the list of top-level Portfolios and Applications. If a Portfolio is chosen, two more columns will be shown: sub-Portfolios, and projects. If an Application is chosen, only the projects column will be available.
From here, you can edit or delete an existing Portfolio or Application, or create a new one.
Use the “Create” button at the top-left of the interface to open the creation dialog. You’re required to provide a name. You can optionally specify a description and key. Visibility defaults to Public, but Private may be chosen. Private Portfolios and Applications are only visible to those explicitly granted the right.
Once your Portfolio exists, you can populate it with any mix of projects, Applications, and sub-portfolios. Applications may only be populated with projects.
To add a sub-portfolio, click on “Add Portfolio” at the top of the third column, and choose:
To add projects directly to a Portfolio or standard sub-Portfolio, first select the Portfolio in the left column, and the sub-Portfolio (if necessary) in the middle column.
There are four project selection modes:
Projects, applications and sub-portfolios can only appear once in any given hierarchy in order to avoid magnifying their impacts on aggregated ratings. The portfolio configuration interface has some logic to prevent obvious duplications (e.g. manually adding the same project), however in case of more subtle duplications (e.g. due to regex, or other bulk definition), then the calculation of that portfolio will fail with a helpful error message.
Calculation must be triggered manually each time a Portfolio structure is modified. Portfolios should also be recomputed on a regular basis to keep them up to date with the most recent project quality snapshots. Portfolio are computed with the SonarQube Scanner.
To compute all your Portfolio, run the following command (credentials from a user with "Administer System" or "Execute Analysis" permission is required):
sonar-scanner views -Dsonar.login=<token> or sonar-scanner views -Dsonar.login=<login> -Dsonar.password=<pwd>
When you launch the Computation, the real work is done on SonarQube Server side.
For each Portfolio, a “Background Task” is created and you can follow the progress on each in the Administration > Projects > Background Tasks by looking at the Logs available for each Portfolio.