sinceLeakPeriod does not seem to work for Portfolio level Query but only for Project level

  • versions used (SonarQube
  • error observed (no error produced but data seems wrong)
  • steps to reproduce

Using the Portfolio “Issues” view, select the Creation Date set to “New Code” option.

Expected behavior: Only issues scanned since the “New code period” of each project that belongs to that portfolio will be listed.

Observed behavior: All issues are listed and switching between “All” and “New Code” has no impact on the listed issues.

  • potential workaround

If you loop through each project in the portfolio, you will see that the “All” vs “New Code” does work at this level.

This impacts the “New Issues” filter too, not just the API. I also found that it that it works for Applications but still not portfolio. Very odd. I have one project that is just a collection of repos (just a portfolio and zero applications) so I really wanted this work work.

Hi @Dana,

Thank you for your report. After investigation, I can confirm that the New code filter isn’t working properly with portfolios. This isn’t a surprise as this filter isn’t implemented for portfolios.

As a short term action, we’ll proceed and remove this option from the interface when browsing a portfolio (see this ticket).

Nevertheless, I’d like to provide our product manager with the most detailed feedback on your use case.

Could you clarify? Do you have a porfolio containing only project? What is it that you’re trying to achieve?

Since we use a common framework of software and we want to do a single scan per repo and we do not want to repeat scans in separate projects. So, I created the Portfolio level to hold all the common framework component repos. But for this set of shared components, there is not single “app” there are many and we don’t really want to try to track issues per application in this case. Just for the entire set of components.

So, in this case, it seemed a good fit to just use the automatic assignment feature and all of these projects are auto-added into the framework portfolio using wildcard. This worked so well in fact there was no need to create any “app” since clicking on the portfolio listed all the per-component projects for that common framework of software.

Since the software seems to allow all filters/queries at any level project, app, portfolio. I though there was no need. After realizing the new issues query (and only the new issue query) did not work, I simply created an Application that holds the same set of projects. Unfortunately the same wildcard feature does not exist for Application that does for Portfolios so I just had to add them using the pick list widget.

Overall, I find it odd that SonarSource would not want parity on these queries for portfolio, app, and project levels and the REST API and Web Interface all point to you being able to run the new issue query. It just seems like consistency would be better even if the query were a bit slower. But if the lack of this query is mentioned in the API and not present on the web interface, that would at least help.