-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github Search Module For Github Issues #1465
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
Signed-off-by: Alper Altay <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, this is amazing! 😻
async *execute(): AsyncGenerator<GithubIssuesDocument> { | ||
this.logger.info('Starting collation of GitHub issues.'); | ||
|
||
const documents = await this.fetchGithubIssuesDocuments(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are 1000 issues, this will cause 1000 issues to be loaded in memory.
We could lift some logic from the fetchGithubIssuesDocuments
, making sure that fetchGithubIssuesDocuments
returns just a batch of element. Something like:
let nextPage = ...
while(hasNext()) {
const result = this.fetchGithubIssuesDocuments(nextPage);
nextPage = result.nextPage;
for (const document of result.documents) {
yield { ...document, ...stuff };
}
}
so that the collator will be more memory efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Will change
} | ||
|
||
private async fetchGithubIssuesDocuments(): Promise<Issue[] | Discussion[]> { | ||
const { client } = await this.createClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could move createClient
to the parent function, so that we instantiate the client only once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense 🫡
/** | ||
* The target that this provider should consume. | ||
* | ||
* @example "https://github.com/backstage" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review: example should be backstage
Pull Request: Add GitHub Search Backend Module and Frontend Plugin
Summary
This pull request introduces a new GitHub search backend module to enhance the search capabilities within the Backstage instance. The additions include:
Changes
Backend
search-backend-module-github
search.collators.github.org
: Specifies the organization to search within.search.collators.github.query
: Defines the query string used to search GitHub issues.Frontend
The
GithubSearchResultListItem
component will appear as follows on the search page: