Skip to content

Commit

Permalink
chore(autofix+copilot) Allow autofix without FF if gen AI consent giv…
Browse files Browse the repository at this point in the history
…en (#79361)

This allows orgs who we're giving access to the Copilot extension to
call Autofix as long as they have given us Gen AI consent, even if they
are not feature flagged into our LA.

In the autofix start endpoint, we allow it if either they have the FF or
have gen AI consent.
In the setup endpoint, we remove the FF check so that we can check set
up status regardless.
  • Loading branch information
roaga authored Oct 18, 2024
1 parent 2204fde commit e4f7302
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 1 addition & 0 deletions src/sentry/api/endpoints/group_ai_autofix.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def post(self, request: Request, group: Group) -> Response:
if not (
features.has("projects:ai-autofix", group.project)
or features.has("organizations:autofix", group.organization)
or group.organization.get_option("sentry:gen_ai_consent", False)
):
return self._respond_with_error("AI Autofix is not enabled for this project.", 403)

Expand Down
6 changes: 0 additions & 6 deletions src/sentry/api/endpoints/group_autofix_setup_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ def get(self, request: Request, group: Group) -> Response:
"""
Checks if we are able to run Autofix on the given group.
"""
if not (
features.has("projects:ai-autofix", group.project)
or features.has("organizations:autofix", group.organization)
):
return Response({"detail": "Feature not enabled for project"}, status=403)

org: Organization = request.organization
has_gen_ai_consent = org.get_option("sentry:gen_ai_consent", False)

Expand Down

0 comments on commit e4f7302

Please sign in to comment.