Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 0781b23

Browse files
committed
Report some metrics to gauge usefulness
1 parent c4a4e74 commit 0781b23

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/github-package.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,10 @@ export default class GithubPackage {
466466
}
467467

468468
this.workdirCache.invalidate();
469-
470469
this.project.addPath(projectPath);
471-
472470
await this.scheduleActiveContextUpdate();
471+
472+
reporterProxy.addEvent('clone-repository', {project: 'github'});
473473
}
474474

475475
getRepositoryForWorkdir(projectPath) {

lib/views/create-dialog.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import fs from 'fs-extra';
55
import CreateDialogContainer from '../containers/create-dialog-container';
66
import createRepositoryMutation from '../mutations/create-repository';
77
import {GithubLoginModelPropType} from '../prop-types';
8+
import {addEvent} from '../reporter-proxy';
89

910
export default class CreateDialog extends React.Component {
1011
static propTypes = {
@@ -34,6 +35,7 @@ export async function createRepository(
3435
const result = await createRepositoryMutation(relayEnvironment, {name, ownerID, visibility});
3536
const sourceURL = result.createRepository.repository[protocol === 'ssh' ? 'sshUrl' : 'url'];
3637
await clone(sourceURL, localPath, sourceRemoteName);
38+
addEvent('create-github-repository', {package: 'github'});
3739
}
3840

3941
export async function publishRepository(
@@ -65,7 +67,10 @@ export async function publishRepository(
6567
const result = await createRepositoryMutation(relayEnvironment, {name, ownerID, visibility});
6668
const sourceURL = result.createRepository.repository[protocol === 'ssh' ? 'sshUrl' : 'url'];
6769
const remote = await repository.addRemote(sourceRemoteName, sourceURL);
68-
if (!wasEmpty) {
70+
if (wasEmpty) {
71+
addEvent('publish-github-repository', {package: 'github'});
72+
} else {
6973
await repository.push(defaultBranchName, {remote, setUpstream: true});
74+
addEvent('init-publish-github-repository', {package: 'github'});
7075
}
7176
}

0 commit comments

Comments
 (0)