8000 Prefer to upload files under version control by martinschaef · Pull Request #10 · aws/aws-codeguru-cli · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@martinschaef
Copy link
Contributor

Issue #, if available:
#7

Description of changes:
When scanning a directory that is under version control, the cli should ask if all files should be analyzed or only files that are under version control.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

if (versionedFiles == 0) {
Log.error(sourceDirs.toString());
Log.error(config.getVersionedFiles().toString());
throw new GuruCliException(ErrorCodes.GIT_EMPTY_DIFF,
Copy link
@senguptaaritra senguptaaritra Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an exception or just a logged warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should end the workflow because there's no point sending anything to CodeGuru and it was probably a mistake. These exceptions don't show stacktraces, they just lead to an error message that aborts the upload and scan.



@Test
public void test_zipAndUpload_happyCaseGitFilesOnly() throws Exception {
Copy link
@senguptaaritra senguptaaritra Feb 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a test case that covers the case when the option "scan only version controlled files" is not set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Let me add one.

Copy link
@senguptaaritra senguptaaritra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, some comments/questions.

@martinschaef martinschaef merged commit c5bf01a into aws:main Feb 28, 2022
@martinschaef martinschaef deleted the uploaddiff branch February 28, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0