Skip to content

Commit

Permalink
feat: only extracting the last pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Aug 26, 2024
1 parent 0b2bf07 commit 313f11b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/data-collection/collect-linked-pulls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type IssueWithClosedByPRs = {
};
};

export async function collectLinkedMergedPulls(issue: IssueParams) {
export async function collectLinkedMergedPull(issue: IssueParams) {
const octokit = getOctokitInstance();
const { owner, repo, issue_number } = issue;

Expand Down
4 changes: 2 additions & 2 deletions src/issue-activity.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CommentAssociation, CommentKind } from "./configuration/comment-types";
import configuration from "./configuration/config-reader";
import { DataCollectionConfiguration } from "./configuration/data-collection-config";
import { collectLinkedMergedPulls } from "./data-collection/collect-linked-pulls";
import { collectLinkedMergedPull } from "./data-collection/collect-linked-pulls";
import {
GitHubIssue,
GitHubIssueComment,
Expand Down Expand Up @@ -47,7 +47,7 @@ export class IssueActivity {

private async _getLinkedReviews(): Promise<Review[]> {
logger.debug("Trying to fetch linked pull-requests for", this._issueParams);
const pulls = await collectLinkedMergedPulls(this._issueParams);
const pulls = await collectLinkedMergedPull(this._issueParams);
logger.debug("Collected linked pull-requests", { pulls });
const promises = pulls
.map(async (pull) => {
Expand Down
2 changes: 1 addition & 1 deletion src/types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const LINKED_PULL_REQUESTS = /* GraphQL */ `
repository(owner: $owner, name: $repo) {
issue(number: $issue_number) {
id
closedByPullRequestsReferences(first: 10, includeClosedPrs: false, after: $cursor) {
closedByPullRequestsReferences(first: 10, includeClosedPrs: false, after: $cursor, last: 1) {
edges {
node {
id
Expand Down

0 comments on commit 313f11b

Please sign in to comment.