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

Commit

Permalink
Report some metrics to gauge usefulness
Browse files Browse the repository at this point in the history
  • Loading branch information
smashwilson committed Nov 8, 2019
1 parent c4a4e74 commit 0781b23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/github-package.js
Expand Up @@ -466,10 +466,10 @@ export default class GithubPackage {
}

this.workdirCache.invalidate();

this.project.addPath(projectPath);

await this.scheduleActiveContextUpdate();

reporterProxy.addEvent('clone-repository', {project: 'github'});
}

getRepositoryForWorkdir(projectPath) {
Expand Down
7 changes: 6 additions & 1 deletion lib/views/create-dialog.js
Expand Up @@ -5,6 +5,7 @@ import fs from 'fs-extra';
import CreateDialogContainer from '../containers/create-dialog-container';
import createRepositoryMutation from '../mutations/create-repository';
import {GithubLoginModelPropType} from '../prop-types';
import {addEvent} from '../reporter-proxy';

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

export async function publishRepository(
Expand Down Expand Up @@ -65,7 +67,10 @@ export async function publishRepository(
const result = await createRepositoryMutation(relayEnvironment, {name, ownerID, visibility});
const sourceURL = result.createRepository.repository[protocol === 'ssh' ? 'sshUrl' : 'url'];
const remote = await repository.addRemote(sourceRemoteName, sourceURL);
if (!wasEmpty) {
if (wasEmpty) {
addEvent('publish-github-repository', {package: 'github'});
} else {
await repository.push(defaultBranchName, {remote, setUpstream: true});
addEvent('init-publish-github-repository', {package: 'github'});
}
}

0 comments on commit 0781b23

Please sign in to comment.