Skip to content

Conversation

@samgst-amazon
Copy link
Contributor

Types of changes

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

Description

Re-implement Q auth metrics for open/close sign-in page that were removed in:
#4850

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • 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.

@samgst-amazon samgst-amazon requested a review from a team as a code owner November 7, 2024 19:47
@github-actions
Copy link

github-actions bot commented Nov 7, 2024

Qodana Community for JVM

4 new problems were found

Inspection name Severity Problems
Usage of redundant or deprecated syntax or deprecated symbols 🔶 Warning 4

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

import software.aws.toolkits.jetbrains.settings.CodeWhispererSettings
import software.aws.toolkits.jetbrains.utils.notifyError
import software.aws.toolkits.resources.message
import software.aws.toolkits.telemetry.AuthTelemetry

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

Remove deprecated symbol import
import software.aws.toolkits.jetbrains.settings.CodeWhispererSettings
import software.aws.toolkits.jetbrains.utils.notifyError
import software.aws.toolkits.resources.message
import software.aws.toolkits.telemetry.AuthTelemetry

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'AuthTelemetry' is deprecated. Use type-safe metric builders
fun recordCloseChat() {
Telemetry.amazonq.closeChat.use { it.passive(true) }
if (getQConnection() == null) {
AuthTelemetry.signInPageClosed()

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'AuthTelemetry' is deprecated. Use type-safe metric builders
@samgst-amazon samgst-amazon enabled auto-merge (squash) November 7, 2024 21:16
fun recordOpenChat(project: Project) {
Telemetry.amazonq.openChat.use { it.passive(true) }
if (getQConnection(project) == null) {
AuthTelemetry.signInPageOpened()

Check warning

Code scanning / QDJVMC

Usage of redundant or deprecated syntax or deprecated symbols Warning

'AuthTelemetry' is deprecated. Use type-safe metric builders
Comment on lines 422 to +425
Telemetry.amazonq.openChat.use { it.passive(true) }
if (getQConnection(project) == null) {
AuthTelemetry.signInPageOpened()
}
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be

Suggested change
Telemetry.amazonq.openChat.use { it.passive(true) }
if (getQConnection(project) == null) {
AuthTelemetry.signInPageOpened()
}
if (getQConnection(project) == null) {
AuthTelemetry.signInPageOpened()
} else {
Telemetry.amazonq.openChat.use { it.passive(true) }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it looks like vsc emits these separately. openChat is ambiguously: "When user opens CWSPR chat panel".

separating these metrics would make open/close chat a little more meaningful.

@samgst-amazon samgst-amazon merged commit 141b6ca into main Nov 14, 2024
15 of 17 checks passed
@samgst-amazon samgst-amazon deleted the samgst/QChatMetrics branch November 14, 2024 19:35
dhasani23 pushed a commit to ntarakad-aws/aws-toolkit-jetbrains that referenced this pull request Nov 18, 2024
* metrics

* detekt

* project instance from call site

* style

* fix indents

* detekt
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