PR from fork: An error has occurred with your code repository platform

Hello!

I have recently enabled Automatic Analysis in our repository on GitHub.

Automatic Analysis discovers and scans pull requests from branches in the repository successfully.

Pull requests coming from a fork are discovered, but SonarCloud fails to analyse the PR.

It fails with the following message:

Last analysis failed
Analysis ID "AZKR-Gy3xZGE0IqjbxjV"
Your analysis with ID "AZKR-Gy3xZGE0IqjbxjV" has failed: An error has occurred with your code repository platform (GitHub, Bitbucket, Azure DevOps, or GitLab). Please try again.

I have tried several times using two different forks, but the result is the same. Instant failure. My attempts were done within the past 24 hours. That should help you narrow down the logs.

Could you please investigate what causes this failure?

Thank you!

Hi @salmony

Thanks for raising this issue.
For some reason, our automatic analysis engine can’t access the base repository, probably due to some permission issue.
I’ve asked for more expert advice and I’ll come back to you if I have anything to suggest.

1 Like

Thank you for your response, Claire.

With base repository, do you mean the repository that was forked from? If yes, I want to emphasize that Automatic Analysis works fine on pull requests in the upstream/base repository, but not from forks.

I am aware that the Automatic Analysis of forks is a new feature so perhaps there might still be some bugs present.

You might already be aware, but the repositories in question are private repositories. I plan to make a test with two public repositories to see if that makes a difference.

I look forward to getting some more information from you.

1 Like

Hi @salmony

Here is the internal command we run when we trigger the automatic analysis.
Could you tell me if it works if you run it on your computer?

git fetch --prune --no-recurse-submodules origin +refs/pull/617/head:refs/remotes/pull/617/head +refs/heads/main:refs/remotes/origin/main

with origin being the upstream repository.

Hi Claire

This command runs successfully on my computer and prints the following among other things:

 * [new ref]         refs/pull/617/head -> pull/617/head

Thanks.