vale-at-red-hat
vale-at-red-hat copied to clipboard
GitLab CI pipeline running a script that uses the vale2cc.py tool fails if repo contains sym links
A GitLab CI pipeline running a script that uses the vale2cc.py tool to generate a gl-code-quality-report.json report fails if the repository contains symlinks.
{
"Code": "E100",
"Text": "stat modules/modules: no such file or directory"
}
Traceback (most recent call last):
File "vale2cc.py", line 16, in
Screenshot of pipeline errors:
Link to a merge request: https://gitlab.cee.redhat.com/quarkus-documentation/qdocs-sandbox/-/merge_requests/20
When the repo contains zero sym links, the issue does not occur and the pipeline and code quality report works well.
To Reproduce Steps to reproduce the behavior:
- Enable Vale to run in a CI pipeline in GitLab as documented in GitLab Code Quality reports and docs on the vale-at-red-hat site
- Use the configuration as per this sandbox repo: https://gitlab.cee.redhat.com/quarkus-documentation/qdocs-sandbox/-/tree/main
Note: The script used here is:
script:
- vale --no-exit --output=JSON . | python3 vale2cc.py > gl-code-quality-report.json
- In a working branch, commit a folder that contains an invalid symlink and then submit a merge request to main.
Results: The pipeline starts but fails on the errors above.
Expected behavior The pipeline completes without error and the code quality report is visible from the MR.
Additional context vale2cc.py does not handle bad symlinks. Is there a way we can get the utility to ignore them?