Pull request decoration failed. Commit xxx not found in pull request xxx

  • which versions are you using (8.9 LTS, Scanner-4.7)
    I tried to rebuild it multiple times.

We are getting this warning in multiple projects with the same commit id. And the developers are unable to merge because the PR is still in the pending stage at the SonarQube level.

Can you please help me with this?


Hi,

Welcome to the community!

This sounds like some sort of caching in your CI. Check Project Settings → Background Tasks → [cog menu] → Show Scanner Context to see what the analysis environment was. Maybe you can backtrack from there.

 
HTH,
Ann

Hi @ganncamp,

Thank you quick response.

There is no failure in the background task. In the Scanner Context: Phoenix Master [Project Analysis] I did not find any error warning.

Hi,

I didn’t expect there to be a background task failure. But if you click on the cog, in the right of your screenshot, you’ll get an option to see the parameters analysis was working with.

 
Ann

Here is the logs

logs.txt (39.0 KB)

Hi @ganncamp,

In the above logs, I did not find any issue. Can you please help here?

Hi,

Did this come from a row related to the processing of a PR? Because I’m not seeing PR properties in the list.

And can you share what CI you use?

 
Ann

Hi,

we are using GitHub Action. Here is my yaml file
CI.txt (1.4 KB)

Hi,

Did the context you provided come from a row related to the processing of a PR? Because I’m not seeing PR properties in the list.

 
Ann

As per the GitHub action plugin, we don’t have to provide any PR properties. The PR decoration we set up at the project level.

Hi,

No you don’t have to provide them because they’re provided by the action. But they should be provided by the action and show up in the context. That’s why I asked you about the task you pulled the context from. There are no such key/value pairs in it.

And what I notice is that you’re using a SonarQube Scan action, but not the official SonarQube Scan Action.

And my question remains: did the context you provided come from a PR analysis Background task?

 
Ann

And my question remains: did the context you provided come from a PR analysis Background task?

Yes, the context is from PR 339.

We are using the official SonarQube Scan Action buy-mistake I pasted the previous link.

Hi,

Can you provide the full job log from this PR analysis?

 
Ann

Hi,

Looks like you’ve got a merge commit in there?

Note: switching to 'refs/remotes/pull/339/merge'.

That would be why the commit isn’t found in your pull request. This SO answer gives a nice explanation.

 
HTH,
Ann

Hi,

Little confused here, do you means we merged any one the commit?

Hi,

Did you check the reference I gave you?

The refs/pull/<number>/merge is a reference created by GitHub to keep track of what would happen if a pull request was merged…

You can think of it as a “future” commit. GitHub (as well as other Git-based collaboration platforms) use this technique to determine whether the pull request would successfully merge

And it looks like you’re explicitly fetching it…?:

2022-08-25T12:04:00.0715052Z [command]/usr/bin/git -c protocol.version=2 fetch --prune --progress --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* +1f05a4d99e624751cd20d42d0977ac061b435ecc:refs/remotes/pull/339/merge

 
Ann

Thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.