-
Notifications
You must be signed in to change notification settings - Fork 28
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
[feat] Add AI features enabled resolvers #808
[feat] Add AI features enabled resolvers #808
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
❌ 2 Tests Failed:
View the top 2 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time. ❌ Failed Test Results:Completed 2282 tests with View the full list of failed testspytest
|
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 #808 +/- ##
===========================================
Coverage 96.23000 96.23000
===========================================
Files 812 812
Lines 18547 18566 +19
===========================================
+ Hits 17848 17867 +19
Misses 699 699
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@codecov-ai-reviewer |
graphql_api/types/owner/owner.py
Outdated
|
||
@owner_bindable.field("aiFeaturesEnabled") | ||
@require_part_of_org | ||
def resolve_ai_features_enabled(owner: Owner, info) -> bool | None: |
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.
The get_config
function call should be moved outside of the resolver function to avoid fetching the configuration value on each call. This will improve performance by reducing redundant calls to the configuration service.
@owner_bindable.field("aiFeaturesEnabled") | |
@require_part_of_org | |
def resolve_ai_features_enabled(owner: Owner, info) -> bool | None: | |
ai_features_gh_app_id = get_config("github", "ai_features_app_id") | |
@owner_bindable.field("aiFeaturesEnabled") | |
@sync_to_async | |
@require_part_of_org | |
def resolve_ai_features_enabled(owner: Owner, info) -> bool: | |
return GithubAppInstallation.objects.filter( | |
app_id=ai_features_gh_app_id, owner=owner | |
).exists() |
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 thanks
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.
Out of curiosity, what happens if I leave it as is?
…om/codecov/codecov-api into rvinnakota/add-ai-features-enabled
We want to enable a new AI features tab on the UI, which exists at the org level. A Codecov user installs a separate AI features Github app on their org(on 1 or more repos).
Assuming webhooks are forwarded from the GH app, we should receive installation events in the api service.
The
GithubAppInstallation
model flow will be leveraged to create a new entry that references the app installation. This entry will have a reference to the owner that installed the app, and the app id of the AI features app. Note that ALL our app id entires in this table are the same(i.e. that of Codecov).UI design here for folks who are interested: https://www.figma.com/design/hwKUPFyNRwGo5GGeWniHmb/GH-1661?node-id=2206-4584&t=vrlfUg43sgTLKuYv-4
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.