9.8 | Project administration | Managing portfolios

On this page

Managing portfolios

Portfolios are available starting in Enterprise Edition.

This page has information on managing and setting up portfolios. For a general overview of portfolios, see Portfolios.

Permissions

Creating portfolios

Users with the Create Portfolios permission and global administrators can create portfolios:

  • Create Portfolios permission – Users with the Create Portfolios permission (granted at the global level at Administration > Security > Global Permissions) can create portfolios by clicking the Create Portfolio button in the upper-right corner of the Portfolios homepage.
  • Global Administrators – In addition to creating portfolios from the Portfolios homepage, global administrators (with the global Administer System permission granted at Administration > Security > Global Permissions) create portfolios from the overall portfolio administration interface at Administration > Configuration > Portfolios.

Editing portfolios

Users need to have either Administer permissions for any portfolios that they want to edit or the global Administer System permission.

Populating portfolios

After you've created a portfolio, you can populate it with projects, applications, and other portfolios.

Adding another portfolio to a portfolio

To add another portfolio to your portfolio, from Administration > Configuration > Portfolios click the Add Portfolio button at the top of the third column, and choose:

  • Standard - This option allows you to create a new portfolio from scratch and add it to the currently selected portfolio. Once created, you can add projects, applications, and more layers of portfolios.
  • Local Reference - This option allows you to reference an existing portfolio in the currently selected portfolio. Once added, it is not editable here, but must be chosen in the left-most column to be edited.

Adding a project to a portfolio

To add projects to a portfolio, navigate to the portfolio you want to add a project to. Select Edit Definition from Portfolio Settings. Click the pencil icon next to Project selection mode, and select one of the following options:

  • Manual – choose the projects individually.
  • Tags - select one or more project tags. Projects with those tags will automatically be included in the portfolio.
  • Regular Expression – specify a regular expression and projects with a matching name OR key will be included.
  • All Projects – choose this option to add all projects not already included in this portfolio (directly or via -portfolio).

By default, adding a project to a portfolio shows the analysis of the project's main branch. See the following section if you want to select a non-main branch or multiple branches for your project.

Selecting specific project branches for your portfolio

In some situations, you may want to either monitor a project branch that's not your main branch or multiple project branches. For example:

  • Your project has multiple release branches, and you want to monitor them all in a portfolio.
  • Your project's main branch isn't your release branch, and you want to monitor your release branch in your portfolio.

To specify a project branch or branches to monitor in your portfolios, you can do the following:

  • Manual – You can use manual selection to select one or multiple project branches. To do this:
    1. From the Portfolio you want to edit, go to Portfolio Settings > Edit Definition.
    2. Click the pencil icon next to the Project selection mode, set Manual as your Project Selection Mode, and click Save.
    3. Click the pencil icon next to the project you want to monitor.
    4. Select the branches you want to monitor. If you don't select a branch, the main branch is selected by default.
  • Tags, Regular Expressions, All Remaining Projects – To specify a branch to monitor in your portfolios using the tags, regular expressions, or all remaining projects options, do the following:
    1. From the Portfolio you want to edit, go to Portfolio Settings > Edit Definition.
    2. Click the pencil icon next to the Project selection mode, and select your desired Project Selection Mode.
    3. Enter the name of the branch you want to monitor in the Branch selection field, and click Save.

Adding applications to a portfolio

To add an application to a portfolio, make sure your application is already created. Then:

  1. Navigate to the Portfolios configuration page by going to Administration > Configuration > Portfolios.
  2. Select the portfolio where you want to add your application.
  3. Click Add Portfolio.
  4. Select Local Reference.
  5. Choose your application from the drop-down menu and click Add.

Calculation

By default, portfolios are queued to be recalculated after each analysis of an included project. For each relevant 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 item.

If you're having performance issues related to the automatic recalculation of large portfolios, you can specify the hour(s) at which you want them to be recalculated. Navigate to the Administration > Configuration > General Settings > Governance tab, Recalculation section, and set your Portfolio Calculation Hours. Portfolios are queued to be recalculated at the beginning of the hour(s) that you specify.

Elasticsearch reindexing

During Elasticsearch reindexing due to disaster recovery or an upgrade, you won't have access to portfolios until all projects are indexed.

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARLINT, SONARQUBE, SONARCLOUD, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License