ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
460 stars 88 forks source link

Switch from sentry to application insights #344

Closed ryanluker closed 3 years ago

ryanluker commented 3 years ago

343

Work

ryanluker commented 3 years ago

@mattseddon found one issue upstream, so I will have to wait on this, sadly. https://github.com/microsoft/vscode-extension-telemetry/pull/69

ryanluker commented 3 years ago

@mattseddon Note that there was one last interesting learning https://github.com/ryanluker/vscode-coverage-gutters/pull/344/commits/1eff40328b16748c52a49996ae5094a932383ec3

Gotta make sure your tests don't trigger events to app insights hah...

ryanluker commented 3 years ago

@mattseddon oops! There was actually a couple issues with the above commit I mentioned. Better version below. https://github.com/ryanluker/vscode-coverage-gutters/commit/9e48acc88bb96e7d416c5e6529f507fc92b08f3a

mattseddon commented 3 years ago

@mattseddon oops! There was actually a couple issues with the above commit I mentioned. Better version below. 9e48acc

Thanks, will take a look later on today. Did you consider excluding debug sessions as well?

ryanluker commented 3 years ago

@mattseddon Hmmm I wasn't 100% sure how to access that and after looking through the telemetry module they already handled telemetry for yah (both IDE and cli). How where you thinking of excluding the debug sessions? https://code.visualstudio.com/api/references/vscode-api#env

They don't appear to expose if something is connected to a debugger unlike telemetry 🤔. Maybe we could use the same cli telemetry disable but also here in the launch.json https://github.com/ryanluker/vscode-coverage-gutters/blob/master/.vscode/launch.json#L15.

mattseddon commented 3 years ago

They don't appear to expose if something is connected to a debugger unlike telemetry 🤔. Maybe we could use the same cli telemetry disable but also here in the launch.json https://github.com/ryanluker/vscode-coverage-gutters/blob/master/.vscode/launch.json#L15.

That should work, I have at least 6 different entry points to launch a VS Code instance that I don't want to send telemetry from so went with environment variables. This is the top of our send telemetry function:

export const sendTelemetryEvent = <
  P extends IEventNamePropertyMapping,
  E extends keyof P
>(
  eventName: E,
  properties: P[E]
) => {
  if (isTestExecution() || isDebugSession()) {
    return
  }

For me this is more explicit (important when you have multiple people working in the code base) but I have to admit what you have looks (is) cleaner.