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.
Giving a user Administer permission to an existing portfolio that was created using manual selection allows that user to see all project names and keys for the projects in the portfolio, even if the user doesn't have access to those projects.
Populating portfolios
After you've created a portfolio, you can populate it with projects, applications, and other portfolios.
Uniqueness in portfolios
Project branches, applications, and 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 (such as manually adding the same project). However, in case of more subtle duplications (for example, due to regular expression or other bulk definition), the calculation of that portfolio will fail with a helpful error message.
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:
- From the Portfolio you want to edit, go to Portfolio Settings > Edit Definition.
- Click the pencil icon next to the Project selection mode, set Manual as your Project Selection Mode, and click Save.
- Click the pencil icon next to the project you want to monitor.
- 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:
- From the Portfolio you want to edit, go to Portfolio Settings > Edit Definition.
- Click the pencil icon next to the Project selection mode, and select your desired Project Selection Mode.
- 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:
- Navigate to the Portfolios configuration page by going to Administration > Configuration > Portfolios.
- Select the portfolio where you want to add your application.
- Click Add Portfolio.
- Select Local Reference.
- 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.
Portfolio PDF reports
As a portfolio admin, you can configure how frequently SonarQube sends PDF reports for this portfolio:
- Navigate to the portfolio's home page then Portfolio Settings > Executive Report and select an option under Frequency.
You have the following options for subscription frequency:
- Daily: The report is sent during the first portfolio calculation of the day (if any).
- Weekly: The report is sent during the first portfolio calculation of the week (if any) from Monday.
- Monthly (default): The report is sent during the first portfolio calculation of the month (if any), starting from the first day of the current month.
Sending portfolio PDF reports to non-SonarQube users
Users with administrative rights on a portfolio can send the portfolio PDF report to non-SonarQube users by adding their email in the Other Recipients field at Portfolio Settings > Executive Report.
Disable Confidential header in Portfolio PDF Reports
Because the toggle defaults to on, all portfolio reports display a Confidential header, but you can disable it.
Users with admin access can change this setting by navigating to Administration -> Governance -> Portfolio PDF Reports and switching the toggle off.
Elasticsearch reindexing
During Elasticsearch reindexing due to disaster recovery or an upgrade, you won't have access to portfolios until all projects are indexed. See Reindexing for more information.
Was this page helpful?