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

telemetry: Code Scan Issue Fix diff usage #907

Merged
merged 7 commits into from
Nov 11, 2024
Merged

Conversation

ashishrp-aws
Copy link
Contributor

Problem

Need to record Telemetry when user is accepting code scan issue generated fix with three options of viewing code, inserting or copying it.

Solution

  • Added Telemetry event to record it.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ashishrp-aws ashishrp-aws requested a review from a team as a code owner November 11, 2024 16:41
@@ -4398,6 +4408,34 @@
}
]
},
{
"name": "codewhisperer_codeScanIssueGenerateFixDiffUse",
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add findingId?

Copy link
Contributor

Choose a reason for hiding this comment

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

there is already codewhisperer_codeScanIssueApplyFix . why can't "diff" be a field (name TBD) on that existing metric?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the codeFixAction to codewhisperer_codeScanIssueApplyFix

Comment on lines 8 to 10
"acceptDiff",
"insertAtCursor",
"copyDiff"
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this map to the buttons in the webview? If that's the case it should be openDiff instead of acceptDiff

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Corrected it and added quickFix as well to codeFixActions

"required": false
},
{
"type": "variant",
Copy link
Contributor

Choose a reason for hiding this comment

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

How will variant be used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not used anymore.

@justinmk3 justinmk3 changed the title Adding Telemetry event for Code Scan Issue Fix diff usage. telemetry: Code Scan Issue Fix diff usage Nov 11, 2024
"openDiff",
"insertAtCursor",
"copyDiff",
"quickFix"
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, we will use codewhisperer_codeScanIssueApplyFix for both applying the fix and actions before applying the fix, is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

@ivikash ivikash merged commit 95eb2bc into aws:main Nov 11, 2024
8 checks passed
justinmk3 pushed a commit that referenced this pull request Nov 13, 2024
## Problem
- `codeFixAction` in `codewhisperer_codeScanIssueApplyFix` event is
  marked as required.

## Solution
- Updating `codeFixAction` in `codewhisperer_codeScanIssueApplyFix` event.
- This change is related to this PR: #907
@ashishrp-aws ashishrp-aws deleted the main branch November 28, 2024 01:09
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.

4 participants