Code Climate message if report cannot generate
Problem to solve
The Code Climate report in the MR view is missing if there is no report to compare the current artifact to.
The code climate report from pipelines does not longer show up in merge requests (for a few days for now) Any merge request triggers a code climate check via template. The artifact exported by this job should display a code climate report on the MR. Sample MR which should show climate report: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/15794 - but its missing gitlab-ee No climate report displayed Climate report displayed This bug happens on GitLab.comThis was initially written up as a bug from @k.boese which is preserved here.
Summary
Steps to reproduce
Example Project
What is the current bug behavior?
What is the expected correct behavior?
Relevant logs and/or screenshots
Output of checks
Stuff
Intended users
Further details
When researching this bug we found that when an artifact is expired it can't be used for comparison, thus the missing code climate report.
Proposal
The outcome we want for users is to know why a code quality score is not present when they expect it to be.
When the base_path is missing, it could be one of two things:
- This is the first time code quality is being introduced to the project so the
code_qualityjob has never been run on the target branch, usuallymaster. The MR has to be merged first for succeeding MRs to show the widget. - The MR's
base_pipeline's report artifact has already expired and there are more recent commits tomasterhaving the updated report. The MR must be rebased on master. See #14033 (comment 244402302) for more info.
It won't be possible to tell which case is true because base_path will just be null for both, so we have to craft a message that can inform the user about these 2 possible cases.
Once we have the message, show it on the widget's section whenever base_path is missing. Right now we just don't show the widget at all if base_path is missing.
Permissions and Security
Documentation
The docs for code quality should be updated to contain this information as well.
Testing
- We need to test against some non-standard GitLab Flow cases, like the example in the notes below.
What does success look like, and how can we measure that?
- Users who can make use of code quality reports but do not see one in the MR widget always have direction on how to get a report on their next MR.
Acceptance Criteria
- Users get clear information in the about why a code quality score is not present and how to resolve the issue.
- Readers of code quality documentation will know when to expect/not expect a code quality score based on reading the docs.
What is the type of buyer?
Links / references
/label feature