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

Add telemetry for change base on both new and old views #4956

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/github/createPRViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
PUSH_BRANCH,
SET_AUTO_MERGE,
} from '../common/settingKeys';
import { compareIgnoreCase } from '../common/utils';
import { getNonce, IRequestMessage, WebviewViewBase } from '../common/webview';
import {
byRemoteName,
Expand Down Expand Up @@ -397,6 +398,12 @@ export class CreatePullRequestViewProvider extends WebviewViewBase implements vs
if (isBase) {
newBranch = defaultBranch;
this._baseBranch = defaultBranch;
if (compareIgnoreCase(this._baseRemote.owner, owner) !== 0 || compareIgnoreCase(this._baseRemote.repositoryName, repositoryName)) {
/* __GDPR__
"pr.create.changedBaseRemote" : {}
*/
this._folderRepositoryManager.telemetry.sendTelemetryEvent('pr.create.changedBaseRemote');
}
this._baseRemote = { owner, repositoryName };
this._onDidChangeBaseRemote.fire({ owner, repositoryName });
this._onDidChangeBaseBranch.fire(defaultBranch);
Expand Down Expand Up @@ -614,6 +621,12 @@ export class CreatePullRequestViewProvider extends WebviewViewBase implements vs
private async changeBranch(newBranch: string, isBase: boolean): Promise<{ title: string, description: string }> {
let compareBranch: Branch | undefined;
if (isBase) {
if (this._baseBranch !== newBranch) {
/* __GDPR__
"pr.create.changedBaseBranch" : {}
*/
this._folderRepositoryManager.telemetry.sendTelemetryEvent('pr.create.changedBaseBranch');
}
this._baseBranch = newBranch;
this._onDidChangeBaseBranch.fire(newBranch);
} else {
Expand Down
12 changes: 12 additions & 0 deletions src/github/createPRViewProviderNew.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,17 @@ export class CreatePullRequestViewProviderNew extends WebviewViewBase implements
defaultDescription: titleAndDescription.description
};
if (baseRemoteChanged) {
/* __GDPR__
"pr.create.changedBaseRemote" : {}
*/
this._folderRepositoryManager.telemetry.sendTelemetryEvent('pr.create.changedBaseRemote');
this._onDidChangeBaseRemote.fire(this._baseRemote);
}
if (baseBranchChanged) {
/* __GDPR__
"pr.create.changedBaseBranch" : {}
*/
this._folderRepositoryManager.telemetry.sendTelemetryEvent('pr.create.changedBaseBranch');
this._onDidChangeBaseBranch.fire(this._baseBranch);
}
} else {
Expand All @@ -449,6 +457,10 @@ export class CreatePullRequestViewProviderNew extends WebviewViewBase implements
compareBranch: result.branch,
defaultCompareBranch: defaultBranch
};
/* __GDPR__
"pr.create.changedCompare" : {}
*/
this._folderRepositoryManager.telemetry.sendTelemetryEvent('pr.create.changedCompare');
this._onDidChangeCompareRemote.fire(result.remote);
this._onDidChangeCompareBranch.fire(this._compareBranch);
}
Expand Down