Projects not assigned to Portfolios

Must-share information (formatted with Markdown):

  • which versions are you using SonarQube 7.9 LTS
  • what are you trying to achieve
  • i want to filter for all projects which are not assigned to an exisitng portfolio
  • we have around 50 portfolios where we manual add the projects to the teams which are the responsible for
  • i have 790 projects over all and only 439 are assigned allready to portfolios, so i know someone is caring about the projects
  • what have you tried so far to achieve this
  • i create a portfolio and select “all remaining projects”

But in this portfolio are all 790 projects included…

So, how can i find out (easy) which projects are not added to a portfolio of the teams?

Welcome :slight_smile:

the option under ‘Edit Selection Mode’ is named All Projects, not All Remaining Projects
(i know the documentation has ‘All Remaining Projects’)
So with this option you’ll have all projects in portfolio.
I guess there is a way via web api, you have to activate ‘Show internal api’ to see all

Maybe you have to combine it with a second web api call, e.g. get all projects via
GET api/components/search and qualifier TRK.

Gilbert

Hi,

I’d like to augment Gilbert’s response with another, admittedly kludgy, approach.

As he pointed out, the “All projects” option is actually “All projects… not already included in the parent of this portfolio.”

So one way to get your true/full orphans list would be to:

  • Create a new portfolio, that I’ll call “Global”
  • Add all existing portfolios to Global (this assumes that none of your other portfolios overlap)
  • Create a new All projects sub-portfolio under Global. Once it has been calculated, its project list will consist of all those projects not included anywhere else.

Once you have that list, then you need to consider whether or not you want to delete Global or keep it around. For that, I’d look at the resource drain its re-calculation causes. If it is a problem and you still want to keep it around, then you do have the option of throttling portfolio recalculation (last paragraph here).

 
HTH,
Ann

Hi Ann,

the docs have ‘All remaining projects’ but in Sonarqube web UI it is ‘All projects’
and a new created portfolio had all projects - not all remaining, tried that with Sonarqube Enterprise 8.0
I use no hierachy for portfolios, so all on the same level.

Gilbert

Hi Gilbert,

Actually I think the UI might be smart enough now to distinguish. If you make a new top-level portfolio it will say ‘All Projects’ because it will be … all projects. But if you make a sub-portfolio (as a “Standard” sub-portfolio, under another portfolio) the UI will say ‘All remaining projects’. The fun part is that if you add an ‘All projects’ portfolio to another portfolio via Local Reference, then IIRC the behavior/project count of the ‘All projects’ portfolio varies depending on whether you went straight to it or whether you drilled down from the ‘parent’ portfolio. (Announcer voice: Kids, don’t try this at home :crazy_face: )

 
HTH,
Ann

Hi Ann,

maybe i’m not smart enough for portofolios :slight_smile:
Never thought of using nested portfolios.
All configured via regex for sonar.projectKey, if projectKey matches it’s
automatically added to the relared portfolio.
I guess nested portfolios apply only to manual portfolios !?

Gilbert

Hi Gilbert,

In some large companies they mirror the reporting structure with a portfolio tree. E.G. Line Manager Abigail has portfolioA, which is a manual collection of her projects. Middle manager Elaine has a portfolio made up of portfolioA through portfolioD, and so on.

In this case, I’d say ignorance really is a blissful reflection of your company’s blessedly simple structure.

 
:smile:
Ann