Skip to content

Commit

Permalink
fix: get all pullRequests
Browse files Browse the repository at this point in the history
  • Loading branch information
adelkahomolova committed Dec 6, 2019
1 parent 0903e0f commit 7bbca3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/practices/LanguageIndependent/DoesPullRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { PracticeEvaluationResult, PracticeImpact } from '../../model';
import { GitServiceUtils } from '../../services/git/GitServiceUtils';
import { DxPractice } from '../DxPracticeDecorator';
import { IPractice } from '../IPractice';
import { PullRequestState } from '../../inspectors/ICollaborationInspector';

@DxPractice({
id: 'LanguageIndependent.DoesPullRequests',
Expand All @@ -26,8 +27,9 @@ export class DoesPullRequestsPractice implements IPractice {
const repoName = GitServiceUtils.getRepoName(ctx.projectComponent.repositoryPath, ctx.projectComponent.path);
const ownerAndRepoName = GitServiceUtils.getOwnerAndRepoName(repoName);

//TODO add filtering
const pullRequests = await ctx.collaborationInspector.getPullRequests(ownerAndRepoName.owner, ownerAndRepoName.repoName);
const pullRequests = await ctx.collaborationInspector.getPullRequests(ownerAndRepoName.owner, ownerAndRepoName.repoName, {
filter: { state: PullRequestState.all },
});
const repoCommits = await ctx.collaborationInspector.getRepoCommits(ownerAndRepoName.owner, ownerAndRepoName.repoName);

if (pullRequests.items.length === 0) {
Expand Down

0 comments on commit 7bbca3b

Please sign in to comment.