Skip to content
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

Support originalUriBaseIds field for SARIF report #824

Closed
a-osipov-toxa opened this issue Oct 27, 2023 · 1 comment · Fixed by #829
Closed

Support originalUriBaseIds field for SARIF report #824

a-osipov-toxa opened this issue Oct 27, 2023 · 1 comment · Fixed by #829
Assignees
Labels
bug Something isn't working

Comments

@a-osipov-toxa
Copy link

Description

The current implementation does not support the SARIF-formatted report files containing the originalUriBaseIds field. As a result, Universum does not transfer underline comments to the Swarm review

See the code: https://github.com/Samsung/Universum/blob/master/universum/modules/code_report_collector.py#L76

Steps to reproduce

List the performed steps, for example:

  • Prepare the project code with the linter-warnings;
  • Prepare the Universum config with generation of SARIF formatted code report;
  • Configure Universum for the review report
  • Request the review
  • Check that the report was prepared and collected
  • Check the review comments from the Universum user

Additional info:

  • Command line: python3.8 -m universum --p4-force-clean --html-log universum_log.html --no-diff --report-to-review --report-build-start --report-build-success --build-only-latest

  • Contents of configuration file

from universum.configuration_support import Configuration, Step, get_project_root

MTH_ROOT_PATH = '/home/user/project'
target_linter_files = (f'{MTH_ROOT_PATH}/*.py {MTH_ROOT_PATH}/common/python/ '
                       f'{MTH_ROOT_PATH}/suites/ {MTH_ROOT_PATH}/stubs/')

flake8 = Configuration([
    Step(name=f'Flake8 {python_version} check',
            code_report=True,
            if_env_set='SKIP_FLAKE8 != true',
            report_artifacts='${CODE_REPORT_FILE}',
            command=['bash', '-c', f'python3.8 -m flake8 --config {ROOT_PATH}/.flake8 '
                                f'--filename={target_linter_files} '
                                '> ${CODE_REPORT_FILE}'),
])

# ============ Universum config preparation ==============
configs = flake8

if __name__ == '__main__':
    print(configs.dump())

Expected result

All warnings/errors from the report file must be posted as an underline comments in review

Actual result

There are no comments with warnings/errors from linter

Environment

  • OS: Ubuntu 20.04
  • Python version 3.8
  • Universum version 0.19.17

Additional context

Example of the report file (from flake8)
Flake8_check.json

@a-osipov-toxa a-osipov-toxa added the bug Something isn't working label Oct 27, 2023
@lyubomyrferents
Copy link
Contributor

Hello,
I have a solution to this issue.
Please assign it to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants