-
Notifications
You must be signed in to change notification settings - Fork 6
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
Remove resource config validation for github-events-to-s3 call #36
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #36 +/- ##
=======================================
Coverage 99.44% 99.44%
=======================================
Files 10 10
Lines 180 181 +1
Branches 25 25
=======================================
+ Hits 179 180 +1
Misses 1 1 ☔ View full report in Codecov by Sentry. |
Hi @bshien rebase on main please I just update the main branch yesterday. Thanks. |
Signed-off-by: Brandon Shien <bshien@amazon.com>
if (!(await validateResourceConfig(app, context, resource))) return; | ||
export default async function githubEventsToS3(app: Probot, context: any): Promise<void> { | ||
// Removed validateResourceConfig to let this function listen on all repos, and filter for only the repos that are public. | ||
// This is done so when a new repo is made public, this app can automatically start processing its events. |
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.
Please add one more comment along the lines of:
This is only for the s3 data lake specific case, everything else should still specify repos required to be listened in resource config.
// Removed validateResourceConfig to let this function listen on all repos, and filter for only the repos that are public. | ||
// This is done so when a new repo is made public, this app can automatically start processing its events. | ||
// if (!(await validateResourceConfig(app, context, resource))) return; | ||
if (context.payload.repository?.private === false) { |
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.
Wonder if we need an else branch to log which repo is skipped due to being private.
|
||
await githubEventsToS3(app, context); | ||
|
||
expect(mockS3Client.send).not.toHaveBeenCalledWith(expect.any(PutObjectCommand)); |
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 you add an app.log.error for private repo then you can check if that is being called when repo is private.
Signed-off-by: Brandon Shien <bshien@amazon.com>
Description
Remove resource config validation in github-events-to-s3 call to allow the app to listen on events from all repos, then filter only for public repos. This way, when a new repo is added, the app can start acting on the new repo's events immediately.
Additionally ran a
prettier --write .
Issues Resolved
Part of opensearch-project/opensearch-metrics#76
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.