From 7bbca3bc418024fd4d3e4c1d8b29bbf540b8f22c Mon Sep 17 00:00:00 2001 From: Adela Homolova Date: Fri, 6 Dec 2019 15:29:04 +0100 Subject: [PATCH] fix: get all pullRequests --- src/practices/LanguageIndependent/DoesPullRequests.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/practices/LanguageIndependent/DoesPullRequests.ts b/src/practices/LanguageIndependent/DoesPullRequests.ts index 4edad5624..14259c3ea 100644 --- a/src/practices/LanguageIndependent/DoesPullRequests.ts +++ b/src/practices/LanguageIndependent/DoesPullRequests.ts @@ -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', @@ -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) {