Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 9d7651d

Browse files
committed
Ooops we weren't tracking PR creation
1 parent 9f4123e commit 9d7651d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/GitHub.App/Services/PullRequestService.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ public class PullRequestService : IPullRequestService
2727
readonly IGitClient gitClient;
2828
readonly IGitService gitService;
2929
readonly IOperatingSystem os;
30+
readonly IUsageTracker usageTracker;
3031

3132
[ImportingConstructor]
32-
public PullRequestService(IGitClient gitClient, IGitService gitService, IOperatingSystem os)
33+
public PullRequestService(IGitClient gitClient, IGitService gitService, IOperatingSystem os, IUsageTracker usageTracker)
3334
{
3435
this.gitClient = gitClient;
3536
this.gitService = gitService;
3637
this.os = os;
38+
this.usageTracker = usageTracker;
3739
}
3840

3941
public IObservable<IPullRequestModel> CreatePullRequest(IRepositoryHost host,
@@ -88,7 +90,9 @@ async Task<IPullRequestModel> PushAndCreatePR(IRepositoryHost host,
8890
if (!Splat.ModeDetector.Current.InUnitTestRunner().GetValueOrDefault())
8991
await Task.Delay(TimeSpan.FromSeconds(5));
9092

91-
return await host.ModelService.CreatePullRequest(sourceRepository, targetRepository, sourceBranch, targetBranch, title, body);
93+
var ret = await host.ModelService.CreatePullRequest(sourceRepository, targetRepository, sourceBranch, targetBranch, title, body);
94+
usageTracker.IncrementUpstreamPullRequestCount();
95+
return ret;
9296
}
9397

9498
}

src/GitHub.Exports/Services/UsageTracker.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void IncrementCreateGistCount()
122122
public void IncrementUpstreamPullRequestCount()
123123
{
124124
var usage = LoadUsage();
125-
++usage.Model.NumberOfClones;
125+
++usage.Model.NumberOfUpstreamPullRequests;
126126
SaveUsage(usage);
127127
}
128128

0 commit comments

Comments
 (0)