sourcegraph / cody

AI that knows your entire codebase
https://cody.dev
Apache License 2.0
2.24k stars 213 forks source link

fixing recordsPrivateMetadata field when the private context is empty #4649

Closed hitesh-1997 closed 1 week ago

hitesh-1997 commented 1 week ago

Context

This PR make the following changes:

  1. Fix the recordsPrivateMetadataTranscript in case no private metadata is send to the telemetry. Earlier we were always sending 1 in this fields even if there was no private metadata. More context behind the fix on the slack thread.
  2. Adds a filePath variable to the logging for only the dotComUsers and publicGitHubRepos, which indicates for which file the completion was triggered.
  3. Adds a gitUrl variable for the dotComUsers repos. More context on the slack thread.

Test plan

Manual testing

  1. Start the debugger from this branch. For any new autocomplete request, the telemetry response for the "cody.completion/suggested" will haverecordsPrivateMetadataTranscript: 1 only if the value is non-null.
  2. The inlineCompletionItemContext field will have one additional variable filePath indicating the file for which the autocomplete was triggered.