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

fix(amazonq): do not include plan generation and code generation durations in createUpload telemetry event for /dev #4462

Conversation

sarayev
Copy link
Contributor

@sarayev sarayev commented May 10, 2024

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

As we were doing nextState.interact() inside try-catch block, the duration for createUpload event was including duration for plan generation and code generation, too. It wasn't intended.

Checklist

  • My code follows the code style of this project
  • [N/A] I have added tests to cover my changes
  • [N/A] A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

…tions in createUpload telemetry event for /dev
@sarayev sarayev requested a review from a team as a code owner May 10, 2024 21:21
Copy link

sonarcloud bot commented May 10, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
77.8% Duplication on New Code

See analysis details on SonarCloud

@@ -49,10 +50,11 @@ class PrepareCodeGenerationState(
)

uploadArtifactToS3(uploadUrlResponse.uploadUrl(), fileToUpload, zipFileChecksum, zipFileLength, uploadUrlResponse.kmsKeyArn())
deleteUploadArtifact(fileToUpload)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why have we added delete here as well ?

Copy link
Contributor Author

@sarayev sarayev May 13, 2024

Choose a reason for hiding this comment

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

We didn't add delete here, just moved it from below (line#64) to here to have file-related actions next to each other before starting to init next state similar to how it is done in PrepareRefinementState.kt

@@ -80,5 +79,7 @@ class PrepareCodeGenerationState(
credentialStartUrl = getStartUrl(config.featureDevService.project)
)
}
// It is essential to interact with the next state outside of try-catch block for the telemetry to capture events for the states separately
return nextState.interact(action)
Copy link
Contributor

Choose a reason for hiding this comment

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

Great catch!

@sarayev sarayev merged commit 20204ce into aws:main May 13, 2024
10 of 11 checks passed
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.

None yet

3 participants