Query on sonarcube tasks

Would you kindly state under which circumstances the pipeline will fail if we utilize the Analyze SonarQube job in our build pipeline with Sonar way Quality Gate is used by default?

Breaking the Quality Gate will not make the pipeline fail unless you explicitly set sonar.qualitygate.wait=true

SonarQubePublish@6 what does this task will do exactly?
Sonar way Quality Gate this one and SonarQubePublish@6 these 2 are same or different?

And

sonar.qualitygate.wait=true if we set like this , does this cause the pipeline to fail always?

From the docs:

  • Publish Quality Gate Result task: To display the quality gate status in the build summary and give you a sense of whether the application is ready for production “quality-wise”.

It looks like this when the QG is passing:

It does not fail the build. It just posts the status in the build summary.

If the Quality Gate has failed, it will fail the pipeline.

I see as below:

here qualty gate is failed, my question is that if I merge it with release branch then our release build pipeline will not fail due to this issue?

Have you configured sonar.qualitygate.wait=true?

If yes – your pipeline will fail, assuming the result of the merge is that the quality gate of your release branch fails
If no – it will not fail.

I did it like below :
I have removed this line from my code and did not mention anything for sonar.qualitygate.wait