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

feat(participant): Add telemetry for user feedback VSCODE-601 #812

Merged

Conversation

nirinchev
Copy link
Contributor

Description

This is part of VSCODE-575 - reporting telemetry for usage of the chat participant component covering the user feedback functionality VSCode provides. The unhelpfulReason field is part of the chatParticipantAdditions API proposal - we may need to tweak the code slightly if it doesn't get promoted to stable before we're ready to publish the extension.

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@nirinchev nirinchev changed the title Add telemetry for user feedback VSCODE-601 feat(participant): Add telemetry for user feedback VSCODE-601 Sep 10, 2024
telemetryTrackStub
.getCalls()
.map((call) => call.args[0])
.filter((arg) => arg === 'Participant Welcome Shown').length;
Copy link
Contributor

@alenakhineika alenakhineika Sep 10, 2024

Choose a reason for hiding this comment

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

Can we maybe convert this to an individual test? something like tracks the participant welcome shown telemetry in the suite('telemetry',...) section?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, sorry, I had accidentally committed that test - it's part of another branch and I got my wires crossed when doing some rebasing and merging.

@alenakhineika
Copy link
Contributor

CI is also failing with a weird error I haven't seen before.

@nirinchev
Copy link
Contributor Author

The CI build should be fixed when #813 is merged and then main is merged into the copilot branch.

@nirinchev nirinchev force-pushed the ni/participant-telemetry-welcome branch from 7d16f2e to 978de40 Compare September 10, 2024 12:38
handleUserFeedback(feedback: vscode.ChatResultFeedback): void {
this._telemetryService.trackCopilotParticipantFeedback({
feedback: chatResultFeedbackKindToTelemetryValue(feedback.kind),
reason: feedback.unhelpfulReason,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the additions API doesn't make it to stable before we release, we can extract the unhelpful reason as:

    let unhelpfulReason: String | undefined;
    if ('unhelpfulReason' in feedback) {
      unhelpfulReason = feedback.unhelpfulReason as String | undefined;
    }

@nirinchev nirinchev requested a review from Anemy September 10, 2024 18:58
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

lgtm!

Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

lgtm! Nice chat result refactor

@nirinchev nirinchev merged commit 01486e4 into VSCODE-528-mongodb-copilot Sep 18, 2024
3 checks passed
@nirinchev nirinchev deleted the ni/participant-telemetry-welcome branch September 18, 2024 12: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.

3 participants