Im currently trying to integrate our proyect with code quality. I followed the steps from here Code Quality | GitLab but it doesn’t show code quality in widget.
Repository allocated in Gitlab.com Free user for the repo
Runner (Hint: /admin/runners):version 12.7.1 locally configured on linux ubuntu using shell in a machine with docker
however for this test project i tried to use a shared runner and a image wtih java.
My question is: ¿Does only the account owner of repository needs to have Bronze licence to enable that feature or its needed also for the collaborators in the repo to make it work?
@Giovanni2293 - Product Manager for the testing group here. This feature is available in Core so you won’t need a Bronze license to use it, sorry for the confusion!
Yes it is live/included. You can see it on this MR on a sample project. Code Quality needs to run against the target branch to set a baseline and then against the source branch AND there is a change in the report before the widget will have content though.
If a branch is created, before the code climate job is run on master, and you rebase master onto that older branch, should the MR be showing up on the branch?
@bardia - I haven’t tried that use case out and am not certain. If you have tried this yourself let us know how it goes. I will try to replicate on our side as well.
you said before its available in the Community Edition. However i cant seem to see why the Code Quality Report Tab is not showing up on the MR pipeline.?
however in your documentation it states : Code Quality Reports (STARTER)???
I am generating the code quality report manually, because we’re using SonarQube, and we’re doing code quality on SQL, so for us theres no need for code climate, or the codeclimate yml - only produce the json file.
however, the code quality report is not showing up on the MR, nor the pipeline, and I have a code quality json already in master as a comparison,
@rclarke thanks for posting! The Code Quality report on the pipeline page is a Starter feature. The Code Quality Widget that appears on the Merge Request page is a Core feature.
As far as troubleshooting goes we have documented some common tips. Beyond that if you can share the Merge Request / Project you’re expecting to see the widget on the community here may be able to help.
unfortunately i cant share the project. I have looked into all the documentation, and according to your words, it should be being visible in the MR widget. But whats strange is that its not showing up. Does the filename in the codeclimate.json HAVE to point to the exact filename (case sensitive)? eg: src/xxxx/xxxxx/myfilename.sql
also, do i need to put this snippet in aswell? keeping in mind that im manually creating my own codeclimate.json file.?
@rclarke as long as the job creating the .json file has it formatted correctly and you use the [artifacts:reports:codequality](https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html#artifactsreportscodequality) label the file should be picked up.
I’m not sure about filename case but the codeclimate docs may point you in the right direction there.
@rclarke - Here’s an example for you. The .sh file creates the 'gl-code-quality-report.json' file with the contents from the docs.
You’d replace this with whatever is doing the analysis and put that into a file that matches what you set in artifacts:reports:codequality:<yourfilehere>.
This is working for me on a private project on the free plan in addition to the example above.
Hi James.
I hope i dont sound like a broken record. lol
anyway, everything you’ve shown me in the demo is same as how im doing it. apart from 1 thing:
you seem to create a codeclimate.json in master before hand, and yet you create a gl-code-quality-report.json in the MR. is that right?
UPDATE: we upgraded to 13.2, and viola ! we are now seeing Code Quality boxes in the MR ?
perhaps it was just that. anyway - THANKS A LOAD for your help and patience! you’re a star!
So now i know it DOES work in CE. However, ive now hit another snag, I think it only compares it to latest HEAD in master, and if master did not collate a code quality report on that latest job, a new MR will fail to produce - and show the “base code quality artifiact not present” message. I think it should actually compare to the latest code quality report it has from master over all jobs - dont you think ?
I await your feedback. but thanks James for helping me on this - its been interesting I’ll give it that.
@rclarke - Ah, the Code Quality MR widget was not available in CE until 13.2, that is probably what happened.
You are correct about how the MR widget compares reports today. We are discussing an alternate approach in an open issue and we’d love to have you contribute to the discussion there.
Thanks James. I’ll keep an eye on that. Happy to test for you in the wild, dont wanna get too much involved in your disccussions for now, but happy to listen and test where i can.
@Native-Coder - Thanks for the ping! I answered your question in your original post. The short version is it looks like you are on a version that didn’t fix the bug that prevents you from using that but you can exclude other directories in the .codeclimate.yml file.