Closed Griefed closed 2 years ago
The information added is essentially the same as the one mentioned in the already linked article by Riccardo Padovani, but adjusted for newer versions of Qodana. The example by Riccardo is no longer up to date:
jetbrains/qodana
image and instead suggest using jetbrains/qodana-<linter>
entrypoint: [sh, -c]
whereas the suggested configuration is currently entrypoint: ['']
However, the core of Riccardos example is still a valid one, hence the update to it, including screenshots.
To get an idea of how my changes would look like, see below:
To add a Qodana runner to a GitLab CI/CD pipeline, use the following configuration example: (.gitlab-ci.yml
):
qodana:
image:
name: jetbrains/qodana-<linter>
entrypoint: ['']
script:
- /opt/idea/bin/entrypoint --results-dir=$CI_PROJECT_DIR/qodana --save-report --report-dir=$CI_PROJECT_DIR/qodana/report
artifacts:
paths:
- qodana
In order for a report to be available in any given merge request, you need to make use of the expose_as
-keyword
and change the path to the artifacts. This will render the report available in any affiliated merge request: (.gitlab-ci.yml
):
qodana:
image:
name: jetbrains/qodana-<linter>
entrypoint: ['']
script:
- /opt/idea/bin/entrypoint --results-dir=$CI_PROJECT_DIR/qodana --save-report --report-dir=$CI_PROJECT_DIR/qodana/report
artifacts:
paths:
- qodana/report/
expose_as: 'Qodana report'
Assuming you have configured your pipeline in a similar manner, this is what it may look like:
Qodana report affiliated with a pipeline in a merge request
Available actions for a given exposed Qodana artifact
'Integrating JetBrains Qodana with GitLab pipelines' by Riccardo Padovani 'Qodana, GitLab and Discord' by Griefed
Hi, @Griefed. Thank you for your updates. Please sign https://www.jetbrains.com/agreements/cla/ and we'll be able to proceed with merging your pull request.
@smth-to-smb could you review the changes, please?
Hi, @Griefed. Thank you for your updates. Please sign https://www.jetbrains.com/agreements/cla/ and we'll be able to proceed with merging your pull request.
@smth-to-smb could you review the changes, please?
Hey tiulpin,
I've signed the request already. An agreement for Griefed should already exist. :)
I'll check the merge conflict due to the branch-change, too. It may take a couple of days though as I am currently suffering from je olde Covid.
Cheers Griefed
.Get well soon! Thank you.
Provide an additional example for a Qodana job in GitLabs CI/CD environment, which uses the
expose_as
-keyword to make a Qodana report availabe in a given, related, merge request.Additionally link to a post which also gives an example on how a Discord webhook notification can be sent whenever a new Qodana report is available.