Skip to content

Project key and organization should be read from settings file #2119

Open
@andrei-epure-sonarsource

Description

According to our documentation:

Begin step command line parameters
/k:
[required] Specifies the key of the analyzed project in SonarCloud.
/o:
[required] Specifies the name of the target organization in SonarCloud.

However, the error messages when not providing them suggest that these commands can alternatively be passed via a settings file.

In this community post the user is confused by the error message:

Using environment variables to determine the download directory...
18:19:45.118  Expecting at least the following command line argument:
- SonarQube/SonarCloud project key
The full path to a settings file can also be supplied. If it is not supplied, the exe will attempt to locate a default settings file in the same directory as the SonarQube Scanner for MSBuild.
Use '/?' or '/h' to see the help message.
18:19:45.119  Pre-processing failed. Exit code: 1

The error message suggests the project key can be passed in a settings file, but this is wrong. The project key is currently a required command line parameter, together with the organization. So even if users provide a settings file via an /s parameter, the analysis will fail.

Ideally we should allow these settings to be passed from the settings file.

If this is not immediately possible because of some technical debt, we should update the error message ASAP to be less confusing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type: ParametersUX for parameters, and ways to configure analysis (environmnet, config files, etc|)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions