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

sonar-findings-export -b (to export branch issues) crashes #977

Closed
okorach opened this issue Mar 24, 2024 · 0 comments · Fixed by #978
Closed

sonar-findings-export -b (to export branch issues) crashes #977

okorach opened this issue Mar 24, 2024 · 0 comments · Fixed by #978

Comments

@okorach
Copy link
Owner

okorach commented Mar 24, 2024

sonar-findings-export --withURL -b '*'
2024-03-24 19:17:49,026 | sonar-tools | INFO    | MainThread      | Set debug level to INFO
2024-03-24 19:17:49,026 | sonar-tools | INFO    | MainThread      | sonar-tools version 2.9
2024-03-24 19:17:49,026 | sonar-tools | INFO    | MainThread      | Listing projects
2024-03-24 19:17:49,057 | sonar-tools | INFO    | MainThread      | Exporting findings for 4 projects with params {'url': 'http://localhost:9800', 'csvSeparator': ',', 'threads': 8, 'branches': '*', 'useFindings': False, 'withURL': True}
2024-03-24 19:17:49,057 | sonar-tools | INFO    | MainThread      | Dumping report to stdout
# key,rule,type,severity,status,creationDate,updateDate,projectKey,projectName,branch,pullRequest,file,line,effort,message
Traceback (most recent call last):
  File "/Users/olivier.korach/venv/oko/bin/sonar-findings-export", line 8, in <module>
    sys.exit(main())
  File "/Users/olivier.korach/venv/oko/lib/python3.9/site-packages/tools/findings_export.py", line 341, in main
    store_findings(
  File "/Users/olivier.korach/venv/oko/lib/python3.9/site-packages/tools/findings_export.py", line 274, in store_findings
    branches = __get_list(project, params.pop("branches", None), "branch")
  File "/Users/olivier.korach/venv/oko/lib/python3.9/site-packages/tools/findings_export.py", line 195, in __get_list
    list_array = [b.name for b in project.branches()] if list_type == "branch" else [p.key for p in project.pull_requests()]
  File "/Users/olivier.korach/venv/oko/lib/python3.9/site-packages/tools/findings_export.py", line 195, in <listcomp>
    list_array = [b.name for b in project.branches()] if list_type == "branch" else [p.key for p in project.pull_requests()]
AttributeError: 'str' object has no attribute 'name'
@okorach okorach added this to the v2.9 milestone Mar 24, 2024
okorach added a commit that referenced this issue Mar 25, 2024
Fixes sonar-findings-export -b (to export branch issues) crashes #977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant