Skip to content

Commit

Permalink
Pull request feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lszomoru committed Jun 19, 2023
1 parent aba8e0d commit 9d9d5cf
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 237 deletions.
2 changes: 1 addition & 1 deletion extensions/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"@octokit/graphql-schema": "14.4.0",
"@octokit/rest": "19.0.4",
"tunnel": "^0.0.6",
"@vscode/extension-telemetry": "0.8.0"
"@vscode/extension-telemetry": "0.7.5"
},
"devDependencies": {
"@types/node": "16.x"
Expand Down
36 changes: 23 additions & 13 deletions extensions/github/src/pushErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,40 @@ export class GithubPushErrorHandler implements PushErrorHandler {

if (error.gitErrorCode === GitErrorCodes.PermissionDenied) {
await this.handlePermissionDeniedError(repository, remote, refspec, owner, repo);
this.sendTelemetryEvent('PermissionDenied');

/* __GDPR__
"pushErrorHandler" : {
"owner": "lszomoru",
"handler": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryReporter.sendTelemetryEvent('pushErrorHandler', { handler: 'PermissionDenied' });

return true;
}

// Push protection
if (/GH009: Secrets detected!/i.test(error.stderr)) {
await this.handlePushProtectionError(owner, repo, error.stderr);
this.sendTelemetryEvent('PushRejected.PushProtection');

/* __GDPR__
"pushErrorHandler" : {
"owner": "lszomoru",
"handler": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryReporter.sendTelemetryEvent('pushErrorHandler', { handler: 'PushRejected.PushProtection' });

return true;
}

this.sendTelemetryEvent('None');
/* __GDPR__
"pushErrorHandler" : {
"owner": "lszomoru",
"handler": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryReporter.sendTelemetryEvent('pushErrorHandler', { handler: 'None' });

return false;
}
Expand Down Expand Up @@ -298,16 +318,6 @@ export class GithubPushErrorHandler implements PushErrorHandler {
}
}

private sendTelemetryEvent(handler: string): void {
/* __GDPR__
"pushErrorHandler" : {
"owner": "lszomoru",
"handler": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
}
*/
this.telemetryReporter.sendTelemetryEvent('pushErrorHandler', { handler });
}

dispose() {
this.disposables.forEach(d => d.dispose());
}
Expand Down
Loading

0 comments on commit 9d9d5cf

Please sign in to comment.