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

Add logic for key validation in report subcommand #201

Merged
merged 12 commits into from
Mar 3, 2023
Merged

Conversation

subham-deepsource
Copy link
Contributor

@subham-deepsource subham-deepsource commented Feb 27, 2023

If the wrong value is passed to --key in deepsource report, it would send it to the backend and return a cryptic error message.

This ensures that you pass a supported language to --key.

Signed-off-by: Subham Sarkar <subhamsarkar@DeepSource-C02DRL12ML7H.local>
@linear
Copy link

linear bot commented Feb 27, 2023

LAE-7238 CLI: Raise an error if the `--key` parameter is not a valid language

A user was sending --key=$DEEPSOURCE_DSN, which was failing at a very late point inside coat (/artifacts/adfabewjafkdeepsource.io: No such file or directory)

Prevent the user from sending a bad value as key, and give a much better error message in the CLI:

Error: 'key' must be one of 'python', 'go', ...

Signed-off-by: Subham Sarkar <subham@deepsource.io>
Signed-off-by: Subham Sarkar <subham@deepsource.io>
Signed-off-by: Subham Sarkar <subham@deepsource.io>
Signed-off-by: Subham Sarkar <subham@deepsource.io>
Signed-off-by: Subham Sarkar <subham@deepsource.io>
Signed-off-by: Subham Sarkar <subham@deepsource.io>
@subham-deepsource
Copy link
Contributor Author

To make the tests pass, I think we have to update the DSN. @siddhant-deepsource Right?

@siddhant-deepsource
Copy link
Contributor

Its the issue with using the test coverage github action. Ref: https://discuss.deepsource.io/t/breaking-deepsource-test-coverage-github-action/507

command/report/report.go Outdated Show resolved Hide resolved
Signed-off-by: Tushar Sadhwani <86737547+tushar-deepsource@users.noreply.github.com>
Signed-off-by: Tushar Sadhwani <86737547+tushar-deepsource@users.noreply.github.com>
@tushar-deepsource
Copy link
Contributor

CI is fixed now.

Signed-off-by: Tushar Sadhwani <86737547+tushar-deepsource@users.noreply.github.com>
anto-deepsource
anto-deepsource previously approved these changes Mar 2, 2023
command/report/report.go Outdated Show resolved Hide resolved
command/report/tests/report_workflow_test.go Outdated Show resolved Hide resolved
command/report/tests/report_workflow_test.go Outdated Show resolved Hide resolved
Signed-off-by: Subham Sarkar <subham@deepsource.io>
@sourya-deepsource sourya-deepsource merged commit 88f9575 into master Mar 3, 2023
@sourya-deepsource sourya-deepsource deleted the LAE-7238 branch March 3, 2023 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants