Github issue closed support and improvements#898
Merged
Conversation
themarolt
approved these changes
May 25, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed ✍️
sourceIdsfor PR events (We were using the pr opener member as activity owner when generating the sourceId for the PR events -assigned,pr reviewed,pr review requested), now the sourceId is generated using the activity owner instead.reviewStateascommented | approved | change requestedpayload.requested_reviewer,payload.assigneeandpayload.requested_teambefore we were getting these frompull_requestobject usingpayload.pull_request.requested_reviewerandpayload.pull_request.assigneewhich was causing problems because apparently GitHub returns the all (including historical assigns) assignees inpull_request.assigneesattributes.stateof PR merged activities tomerged- since we were duplicating these from closed activities the state wasclosedbefore forpull_request-mergedactivities.What
🤖 Generated by Copilot at ff1b5de
This pull request improves the GitHub integration service by using the correct source identifier for pull request and issue activities, and by fetching and parsing the closed events of the issues. It modifies the
githubIntegrationService.tsand theissues.tsfiles to implement these changes.
🤖 Generated by Copilot at ff1b5de
Why
How
🤖 Generated by Copilot at ff1b5de
sourceIdof the activities generated from pull request events to use thesender.logininstead of theuser.loginof the pull request author, to reflect the user who performed the action (link, link, link)sourceId,sourceParentId,body, andtitle) at the beginning of theparseWebhookmethod ingithubIntegrationService.ts, to be used later for generating activities based on the issue events, to avoid repeating the same logic and to make the code more readable and consistent (link, link, link, link)parseWebhookMembermethod call ingithubIntegrationService.ts, to use thesender.logininstead of theissue.user.login, to get the member information of the user who triggered the issue event, to match the logic of using thesender.loginfor thesourceIdof the activity (link)parseIssueEventsmethod ingithubIntegrationService.ts, which is a new method that parses the timeline items of the issue and generates activities for each supported event type, such asCLOSED_EVENT, and concatenates the output array with the existing output array (link)parseIssueEventsmethod ingithubIntegrationService.ts, which iterates over the records of the timeline items, and uses a switch statement to handle different event types, and pushes a new activity object to the output array, with the appropriate properties and attributes based on the event type, and logs a warning message for any unsupported event type (link)IssuesQueryclass inissues.ts, which is a GraphQL query that fetches the issues from the GitHub API, to get the information of the closed events of the issues, such as the actor and the created date, which are needed for generating the activities in theparseIssueEventsmethod, and uses a fragment to select the relevant fields of the actor (link)Checklist ✅
Feature,Improvement, orBug.