Skip to content

ref(seer onboarding): remove on_command_phrase CR trigger from repo settings and org options#105978

Merged
srest2021 merged 19 commits intomasterfrom
srest2021/ENG-6194-v2-pt2
Jan 9, 2026
Merged

ref(seer onboarding): remove on_command_phrase CR trigger from repo settings and org options#105978
srest2021 merged 19 commits intomasterfrom
srest2021/ENG-6194-v2-pt2

Conversation

@srest2021
Copy link
Member

@srest2021 srest2021 commented Jan 8, 2026

relates to ENG-6194

depends on https://github.com/codecov/overwatch/pull/622 (deployed)
depends on #105696 (frontend counterpart so we don't fail serializer validation; deployed)

followup: #105980

on_command_phrase is no longer being checked in Overwatch or in issue_comment.py when running code review. Let's remove it from RepositorySettings (migration) and from the CodeReviewTrigger enum.

Note: I'm not going to manually add it to overwatch_rpc.py since Overwatch isn't checking this trigger anymore and is in the process of being migrated to Sentry.

@linear
Copy link

linear bot commented Jan 8, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 8, 2026
@srest2021 srest2021 changed the base branch from srest2021/ENG-6194-v2 to master January 9, 2026 05:10
"""Remove 'on_command_phrase' from RepositorySettings.code_review_triggers."""
RepositorySettings = apps.get_model("sentry", "RepositorySettings")

all_settings = list(RepositorySettings.objects.all())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table is less than 200 rows, so should be safe to skip doing it post-deployment.

@srest2021 srest2021 changed the title fix(seer onboarding): remove on_command_phrase CR trigger from repo settings fix(seer onboarding): remove on_command_phrase CR trigger from repo settings and org options Jan 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

This PR has a migration; here is the generated SQL for src/sentry/migrations/1016_remove_on_command_phrase_trigger.py

for 1016_remove_on_command_phrase_trigger in sentry

--
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL
--
-- Alter field code_review_triggers on repositorysettings
--
-- (no-op)

@getsentry getsentry deleted a comment from github-actions bot Jan 9, 2026
@srest2021 srest2021 marked this pull request as ready for review January 9, 2026 17:02
@srest2021 srest2021 requested review from a team as code owners January 9, 2026 17:02
@srest2021 srest2021 changed the title fix(seer onboarding): remove on_command_phrase CR trigger from repo settings and org options ref(seer onboarding): remove on_command_phrase CR trigger from repo settings and org options Jan 9, 2026
Copy link
Member

@suejung-sentry suejung-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than removing the orgOptions migration from here, the rest of the changes look good to me



class CodeReviewTrigger(StrEnum):
ON_COMMAND_PHRASE = "on_command_phrase"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncleaned org options can propagate invalid triggers to new repos

Low Severity

The migration removes on_command_phrase from existing RepositorySettings but does not clean up organization options (sentry:default_code_review_triggers). If a new repository is created for an org that still has on_command_phrase in their org options, _maybe_auto_enable_code_review() in repository.py will propagate this value to the new RepositorySettings. When get_code_review_settings() is later called, it will raise a ValueError trying to convert "on_command_phrase" to the now-reduced CodeReviewTrigger enum. The PR discussion mentions manual cleanup of the ~5 affected orgs is planned, but if not completed before deployment, new repos for those orgs could trigger this error.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has now been cleaned up by hand in US and DE.

image image

@srest2021 srest2021 requested a review from a team January 9, 2026 21:01
@srest2021 srest2021 merged commit 5336d37 into master Jan 9, 2026
66 of 67 checks passed
@srest2021 srest2021 deleted the srest2021/ENG-6194-v2-pt2 branch January 9, 2026 22:48
srest2021 added a commit that referenced this pull request Jan 12, 2026
…ms (#105980)

fixes ENG-6194

depends on #105978

Clean up the code review trigger types as we've removed
`on_command_phrase` from the forms and from the backend.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants