Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odsComponentStageScanWithSonar fails when requireQualityGatePass is enabled #1109

Closed
gerardcl opened this issue May 10, 2024 · 2 comments · Fixed by #1110
Closed

odsComponentStageScanWithSonar fails when requireQualityGatePass is enabled #1109

gerardcl opened this issue May 10, 2024 · 2 comments · Fixed by #1110
Assignees
Labels
bug Something isn't working

Comments

@gerardcl
Copy link
Member

gerardcl commented May 10, 2024

Describe the bug
When enabling requireQualityGatePass in odsComponentStageScanWithSonar, with the latest Jenkins agents update the cURL command is no longer defining the query as a HTTP GET but a POST making the call fail with HTTP 405 and later resulting as an UNKNOWN quality gate and hence failing the whole pipeline build.
We have been debugging and the same cURL command before the Jenkins agents updates was triggering a GET but now cURL defaults to POST.

To Reproduce
Steps to reproduce the behavior:

  1. Enable requireQualityGatePass in your odsComponentStageScanWithSonar Jenkinsfile stage
  2. Commit and push
  3. See error in the log output section

Expected behavior
The cURL command must send a GET and not a POST.

Screenshots
N/A

Affected version (please complete the following information):

  • OpenShift: 4.x
  • OpenDevStack 4.x

Log Output (ensure to remove any confidential information like tokens, project names, etc.

[Pipeline] sh (Get status of quality gate)
+ curl -s -u ******: --url https://sonarqube.myinstance.com/api/qualitygates/project_status --data-urlencode projectKey=one-project --data-urlencode branch=feature/branch
[Pipeline] }
[Pipeline] // withSonarQubeEnv
[Pipeline] readJSON
[Pipeline] echo
SonarQube Quality Gate value: UNKNOWN
[Pipeline] error
[Pipeline] }
[Pipeline] // stage
[Pipeline] echo
[SonarQube Analysis-componentId] **** ENDED stage 'SonarQube Analysis' for component 'componentId' branch 'feature/branch' **** (took 58795 ms)
[Pipeline] }
[Pipeline] // wrap
[Pipeline] stage
[Pipeline] { (odsPipeline error)
[Pipeline] echo
WARN: [componentId] ***** Finished ODS Pipeline for componentId (with error) ***** (took 1091868 ms)
[Pipeline] echo
WARN: Error: hudson.AbortException: Quality gate unknown!

Additional context
Force --get flag.

@gerardcl gerardcl added the bug Something isn't working label May 10, 2024
@gerardcl gerardcl self-assigned this May 10, 2024
@metmajer
Copy link
Member

Thanks @gerardcl !

@gerardcl
Copy link
Member Author

gerardcl commented Jun 2, 2024

Update: we found out the issue was not due to cURL updates rather SonarQube API changes. Basically cURL is always sending URL encoded data as body except when using --get explicit flag...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants