-
Notifications
You must be signed in to change notification settings - Fork 226
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 Discussions Search Collator #1744
base: main
Are you sure you want to change the base?
Conversation
Changed Packages
|
91e0ebe
to
0c22eb3
Compare
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Co-authored-by: Taras Mankovski <tarasm@gmail.com> Signed-off-by: Min Kim <minkimcello@gmail.com>
Co-authored-by: Taras Mankovski <tarasm@gmail.com> Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Co-authored-by: Taras Mankovski <taras@frontside.com> Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
0c22eb3
to
67c86c4
Compare
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Co-authored-by: Taras Mankovski <taras@frontside.com> Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
Write tests
Signed-off-by: Min Kim <minkimcello@gmail.com>
Signed-off-by: Min Kim <minkimcello@gmail.com>
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.
great addition!
assert(url !== null, `Not parsable as a Github URL`); | ||
const { name: repo, owner: org } = url; | ||
assert(org !== null, `Discussions url is missing organization name`); | ||
assert(repo !== null, `Discussion url is missing repository`); | ||
|
||
const integration = this.githubIntegration.byUrl(url.href); | ||
|
||
assert(integration, `Could not retrieve a Github integration for ${url}`); |
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.
can we do all this checks in fromConfig
instead? Is there any specific reason why you are using this assert-ts
library instead of just throwing plain errors?
const task = run(function* injection(): Operation<void> { | ||
const scope = yield* useScope(); | ||
const results = createQueue<GithubDiscussionFetcherResult, void>(); | ||
|
||
yield* spawn(function* (): Operation<void> { | ||
try { | ||
yield* fetchGithubDiscussions({ | ||
client, | ||
org, | ||
repo, | ||
discussionsBatchSize, | ||
commentsBatchSize, | ||
repliesBatchSize, | ||
logger, | ||
results, | ||
cache, | ||
timeout, | ||
clearCacheOnSuccess, | ||
}); | ||
} catch (e) { | ||
logger.log(e); | ||
logger.error( | ||
`Encountered an error while ingesting GitHub Discussions`, | ||
e, | ||
); | ||
} | ||
results.close(); | ||
}); | ||
|
||
documents = toAsyncIterable(results, scope); | ||
|
||
yield* suspend(); |
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.
this isn't a pattern we use in this repository or in the core Backstage. Is it possible to simplifying this using normal promises or native async iterators? Tbh it looks complex and hard to follow
@@ -0,0 +1,5 @@ | |||
compressionLevel: mixed |
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.
you can skip this file and the .yarn
folder
Signed-off-by: Min Kim <minkimcello@gmail.com>
Hey, I just made a Pull Request!
The GitHub Discussions search collator fetches and indexes all discussions, including their comments and replies, for any specified repository, as long as the Backstage instance is configured with the appropriate GitHub integrations and has the necessary read access to the repository in question.
✔️ Checklist
Signed-off-by
line in the message. (more info)