Component of pull request not found?

I am pretty new to SonarCloud, so apologies if I muddle any terminology.

One of our devs has reported an issue when trying to access an analysis summary.

I get the same message when I try to access the affected analysis summary. I have full access to the org & project, so I don’t believe this is a permissions issue.

I confess I am not entirely sure how to start troubleshooting this issue.

One thing I did note though is the branch this analysis was performed against has since been deleted as part of the PR completion in Azure DevOps (merging the feature branch into main). Is the existence of a branch a dependency for being able to see analysis performed against that branch?

I’m still digging through the documentation, but if someone can point me in the right direction it’d be most appreciated. :slight_smile:

Many thanks,
Luke M.

Hi Luke,

Welcome to the community!

Do you see any errors in your browser console?

 
Ann

Hello, Ann.

I see two 404 errors:

https://sonarcloud.io/api/components/show?component=**projectname**&pullRequest=12157
https://sonarcloud.io/api/navigation/component?component=**projectname**&pullRequest=12157

On further reading I am now wondering if this is the result of the analysis being performed on a ‘feature’ branch.

“Long-lived branches are retained until you delete them manually (Administration > Branches). Short-lived branches are deleted automatically after 30 days with no analysis. For more details, see Housekeeping.” - https://docs.sonarcloud.io/enriching/branch-analysis-setup/

I am given to understand by default a branch name prefixed with ‘feature/’ would be considered a short-lived branch, so would be deleted if that branch was not scanned within the past 30 days.

Might the deletion of that branch from the project in SonarCloud also delete any previous analysis reports?

Thanks again. :slight_smile:

Hi,

I’ll be honest & say I’m not able to find the retention policy for PRs. Let’s assume it’s the same thing as for Short-Lived branches. So it’s possible the PR has been cleaned out already. How old is it? And does PR #12157 (still) exist in ADO?

 
Ann

I’ve checked and confirmed PR #12157 does still exist; yes. It is, however, marked as completed 20-October-2022.

The feature branch was deleted as part of the PR completion.

The SonarCloud portal reports the first analysis of that feature branch on 13-October-2022.

Hi,

Thanks for looking up those details.

I suspect the PR was automatically cleaned out of SonarCloud, either after a period of inactivity or automatically when it was closed. TBH, I still haven’t found what the housekeeping policy is for PRs on SonarCloud. And yes, I’ve made noise about that internally and we will get the docs fixed (eventually).

 
Ann