Skip to content

Commit

Permalink
fix: Fixed link to pull request in raised slack messages
Browse files Browse the repository at this point in the history
  • Loading branch information
BottlecapDave committed Jul 17, 2024
1 parent c967922 commit a0f9af2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions reminder/src/githubService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function createRequestData(): IGitHubMergeRequestRequest {
includeWorkInProgress: true,
repos: [process.env.TEST_REPO as string],
mandatoryLabels: [],
excludedLabels: [],
excludedLabels: ["dependencies"],
}
}

Expand All @@ -16,7 +16,8 @@ function getAccessToken(): string {

function assertMergeRequest(mergeRequest: IGitHubMergeRequest) {
expect(mergeRequest.head.repo.full_name).toEqual('BottlecapDave/GitHub-Pull-Request-Reminder');
expect(mergeRequest.user.login).toEqual('BottlecapDave');
expect(mergeRequest.user.login === 'dependabot[bot]' || mergeRequest.user.login === 'BottlecapDave').toEqual(true);
expect(mergeRequest.html_url.startsWith("https://github.com/BottlecapDave/GitHub-Pull-Request-Reminder/pull/")).toEqual(true);
}

function assertMergeRequests(mergeRequests: IGitHubMergeRequest[], includeWip: boolean, includeDraft: boolean) {
Expand Down
2 changes: 1 addition & 1 deletion reminder/src/githubService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface IGitHubMergeRequest {
};
created_at: string;
user: IGitHubAuthor;
url: string;
html_url: string;
labels: IGitHubLabel[];
draft: boolean;
}
Expand Down
4 changes: 2 additions & 2 deletions reminder/src/notifiers/slackService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function createMergeRequests(): IGitHubMergeRequest[] {
},
},
title: "Merge request with mandatory labels",
url: "https://gitlab.com/test/github-pull-request-reminder-test/-/merge_requests/1",
html_url: "https://gitlab.com/test/github-pull-request-reminder-test/-/merge_requests/1",
draft: false,
},
{
Expand All @@ -36,7 +36,7 @@ function createMergeRequests(): IGitHubMergeRequest[] {
},
},
title: "wip: Merge request ",
url: "https://gitlab.com/test/github-pull-request-reminder-test/-/merge_requests/2",
html_url: "https://gitlab.com/test/github-pull-request-reminder-test/-/merge_requests/2",
draft: false,
}]
}
Expand Down
2 changes: 1 addition & 1 deletion reminder/src/notifiers/slackService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class SlackService {
type: "section",
text: {
type: "mrkdwn",
text: `*<${request.url}|(${request.head.repo.full_name}) ${request.title}>*\n${request.user.login} | opened ${formatDistance(request.created_at, new Date())}`
text: `*<${request.html_url}|(${request.head.repo.full_name}) ${request.title}>*\n${request.user.login} | opened ${formatDistance(request.created_at, new Date())}`
}
})
}
Expand Down

0 comments on commit a0f9af2

Please sign in to comment.