-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
Fix: PMD sarif report preview unavailable. #4571
base: main
Are you sure you want to change the base?
Conversation
According to the [GitHub documentation](https://docs.github.com/en/code-security/code-scanning/integrating-with-code-scanning/sarif-support-for-code-scanning#specifying-the-location-for-source-files), the conversion of absolute URIs to relative URIs for the source root when uploading a SARIF report should not include the `file://` scheme.
Remember that Megalinter is running in a docker image, and the workspace is mounted into it, so it isn't running directly from the GitHub runner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plz check comments
@@ -96,6 +96,7 @@ def produce_report(self): | |||
os.remove(linter.sarif_output_file) | |||
result_json = json.dumps(sarif_obj, sort_keys=True, indent=4) | |||
# Remove workspace prefix from file names | |||
result_json = result_json.replace("file:///github/workspace", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't you need replaceAll ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xezzon ? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does replaceAll
mean? Putting file:///github/workspace/d' into
LIST_OF_REPLACEMENTS`?
Removing the I can't think of any other way to fix #4522 without incompatible changes. |
According to the GitHub documentation, the conversion of absolute URIs to relative URIs for the source root when uploading a SARIF report should not include the
file://
scheme.Fixes #4522
Proposed Changes
file:///github/workspace
to empty string for SARIF report before replacing/github/workspace
.Readiness Checklist
Author/Contributor
Reviewing Maintainer
breaking
if this is a large fundamental changeautomation
,bug
,documentation
,enhancement
,infrastructure
, orperformance