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

Interactive usage of SonarImporter is failing #2861

Closed
ce-bo opened this issue Jun 21, 2022 · 1 comment · Fixed by #2913
Closed

Interactive usage of SonarImporter is failing #2861

ce-bo opened this issue Jun 21, 2022 · 1 comment · Fixed by #2913
Assignees
Labels
bug Only issues that describe bugs. difficulty:low Solving this is likely not that difficult good first issue pr-analysis Issues that touch the analysis pr(oject). priority:high Set by PO

Comments

@ce-bo
Copy link
Collaborator

ce-bo commented Jun 21, 2022

Bug

Expected Behavior

WHEN
trying to import CodeCharta metrics from SonarCloud by the interacitve SonarImporter Dialog without any authentication credentials

THEN
this should work

Actual Behavior

Java Exception occurs

Screenshots

image

Steps to Reproduce the Problem

  1. run ccsh
  2. choose sonarimporter
  3. answer the questions to match this request ccsh sonarimport https://sonarcloud.io/ maibornwolff-gmbh_codecharta_visualization -o cc-viz

Specifications

  • is released in online-demo: yes
  • CodeCharta Version: 1.99.0
  • OS: all
  • Browser: -

Developer Notes

The Backend tries to fetch https://sonarcloud.io/api/measures/component_tree?component=maibornwolff-gmbh_codecharta_visualization&qualifiers=FIL,UTS&metricKeys=&p=1&ps=500
The request fails with {"errors":[{"msg":"The \u0027metricKeys\u0027 parameter must contain at least one metric key"}]}

@ce-bo ce-bo added the bug Only issues that describe bugs. label Jun 21, 2022
@phanlezz
Copy link
Collaborator

It is also not possible to give a list of metrics via the non-interactive cli. Comma-separated lists produce an error. (My guess would be, that the url escaping does not work at the moment.) The default cli seems to add a list of all metrics, while the interactive parser uses an empty list by default.
Example with two metrics given:
https://sonarcloud.io/api/measures/component_tree?component=maibornwolff-gmbh_codecharta_visualization&qualifiers=FIL,UTS&metricKeys=statements, open_issues&p=1&ps=500

@ce-bo ce-bo added pr-analysis Issues that touch the analysis pr(oject). priority:high Set by PO difficulty:low Solving this is likely not that difficult labels Jun 30, 2022
@ce-bo ce-bo added this to the automation-basics-2 milestone Jun 30, 2022
@MW-Friedrich MW-Friedrich self-assigned this Jul 14, 2022
MW-Friedrich added a commit that referenced this issue Jul 26, 2022
@MW-Friedrich MW-Friedrich linked a pull request Jul 27, 2022 that will close this issue
MW-Friedrich added a commit that referenced this issue Jul 27, 2022
* Add a test, so that if "metrics" are empty, there is no flag in the cli
#2861

* Omit --metrics flag in interactive parser, when metrics are empty
remove whitespaces from metrics-lists
#2861

* Omit --user flag in interactive parser, when user is empty
#2861

* update the changelog
#2913
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Only issues that describe bugs. difficulty:low Solving this is likely not that difficult good first issue pr-analysis Issues that touch the analysis pr(oject). priority:high Set by PO
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants