-
Notifications
You must be signed in to change notification settings - Fork 44
GitHub Search
Samad Yar Khan edited this page Jul 23, 2022
·
2 revisions
- GitHub Search enables users to search issue and pull request on GitHub.
- Search Results can be filtered based on different filters : Repository, Authors, Labels etc.
- Users can share selected search result to Rocket.Chat rooms.
- Users can view the code changes of any Pull Request Search Results.
- We fetch the search results using the GitHub Search API.
- Search Query are formed according to GitHub search query documentation.
Users can enter the /github search slash command to trigger the GithubSearchModal. Here the user will be prompted to enter different fields as shown. Search can be filtered based upon the following parameters :
- Repository
- Authtors
- Labels
- Resource State
- Milestones
This is the application workflow :
- Once the user click on
Searchwe will enter theexecuteViewSumbmitHandlercase forGitHubSearchModal. - Here a the search query inputs will be parsed and will be passed as input to the
githubSearchIssuesPulls()method fromGitHubSDK. -
githubSearchIssuesPulls()will form a search query based on the input parameters and will use the GitHub Search API to fetch relevant results. - The Results will returned to
executeViewSumbmitHandlerand it will trigger thegithubSearchResultModaland display the results.

- A given search result can be sent to the current Rocket.Chat Room but clicking on
Share. - When
Shareis clicked, theExecuteBlockActionHandleris triggered and it gets the shareable message in thecontextInteractionDatavalue. - Here we use the
sendMessagehelper function from thelib/helperMessage.tsto send this to the Rocket.Chat Room.

- All pull request search results will have a
View Changesbutton. - When user clicks on
ViewChanges,ExecuteBlockActionHandlerwill parse thecontextInteractionDatato fetch repository name and pull number. - These will be passed to
pullDetailsModal, where the changed files will be listed. - When user click on
View File/View Changes,ExecuteBlockActionHandlerwill be called again and the file code/file changes will be fetched and displayed infileCodeModal
