Skip to content

Commit 3a9ecd5

Browse files
cathtengandrewshie-sentry
authored andcommitted
chore(api): remove option for open PR comments (#103265)
1 parent 732b755 commit 3a9ecd5

File tree

5 files changed

+0
-36
lines changed

5 files changed

+0
-36
lines changed

src/sentry/api/serializers/models/organization.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ class DetailedOrganizationSerializerResponse(_DetailedOrganizationSerializerResp
540540
codecovAccess: bool
541541
hideAiFeatures: bool
542542
githubPRBot: bool
543-
githubOpenPRBot: bool
544543
githubNudgeInvite: bool
545544
gitlabPRBot: bool
546545
gitlabOpenPRBot: bool
@@ -662,9 +661,6 @@ def serialize( # type: ignore[override]
662661
obj.get_option("sentry:hide_ai_features", HIDE_AI_FEATURES_DEFAULT)
663662
),
664663
"githubPRBot": bool(obj.get_option("sentry:github_pr_bot", GITHUB_COMMENT_BOT_DEFAULT)),
665-
"githubOpenPRBot": bool(
666-
obj.get_option("sentry:github_open_pr_bot", GITHUB_COMMENT_BOT_DEFAULT)
667-
),
668664
"githubNudgeInvite": bool(
669665
obj.get_option("sentry:github_nudge_invite", GITHUB_COMMENT_BOT_DEFAULT)
670666
),

src/sentry/apidocs/examples/organization_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,6 @@ class OrganizationExamples:
291291
"codecovAccess": False,
292292
"hideAiFeatures": False,
293293
"githubPRBot": True,
294-
"githubOpenPRBot": True,
295294
"githubNudgeInvite": True,
296295
"gitlabPRBot": True,
297296
"gitlabOpenPRBot": True,

src/sentry/core/endpoints/organization_details.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,6 @@
182182
bool,
183183
GITHUB_COMMENT_BOT_DEFAULT,
184184
),
185-
(
186-
"githubOpenPRBot",
187-
"sentry:github_open_pr_bot",
188-
bool,
189-
GITHUB_COMMENT_BOT_DEFAULT,
190-
),
191185
(
192186
"githubNudgeInvite",
193187
"sentry:github_nudge_invite",
@@ -310,7 +304,6 @@ class OrganizationSerializer(BaseOrganizationSerializer):
310304
isEarlyAdopter = serializers.BooleanField(required=False)
311305
hideAiFeatures = serializers.BooleanField(required=False)
312306
codecovAccess = serializers.BooleanField(required=False)
313-
githubOpenPRBot = serializers.BooleanField(required=False)
314307
githubNudgeInvite = serializers.BooleanField(required=False)
315308
githubPRBot = serializers.BooleanField(required=False)
316309
gitlabPRBot = serializers.BooleanField(required=False)
@@ -891,10 +884,6 @@ class OrganizationDetailsPutSerializer(serializers.Serializer):
891884
help_text="Specify `true` to allow Sentry to comment on recent pull requests suspected of causing issues. Requires a GitHub integration.",
892885
required=False,
893886
)
894-
githubOpenPRBot = serializers.BooleanField(
895-
help_text="Specify `true` to allow Sentry to comment on open pull requests to show recent error issues for the code being changed. Requires a GitHub integration.",
896-
required=False,
897-
)
898887
githubNudgeInvite = serializers.BooleanField(
899888
help_text="Specify `true` to allow Sentry to detect users committing to your GitHub repositories that are not part of your Sentry organization. Requires a GitHub integration.",
900889
required=False,

tests/sentry/core/endpoints/test_organization_details.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,6 @@ def test_various_options(self, mock_get_repositories: MagicMock) -> None:
755755
"allowSuperuserAccess": False,
756756
"allowMemberInvite": False,
757757
"hideAiFeatures": True,
758-
"githubOpenPRBot": False,
759758
"githubNudgeInvite": False,
760759
"githubPRBot": False,
761760
"gitlabPRBot": False,
@@ -850,7 +849,6 @@ def test_various_options(self, mock_get_repositories: MagicMock) -> None:
850849
assert "to {}".format(data["alertsMemberWrite"]) in log.data["alertsMemberWrite"]
851850
assert "to {}".format(data["hideAiFeatures"]) in log.data["hideAiFeatures"]
852851
assert "to {}".format(data["githubPRBot"]) in log.data["githubPRBot"]
853-
assert "to {}".format(data["githubOpenPRBot"]) in log.data["githubOpenPRBot"]
854852
assert "to {}".format(data["githubNudgeInvite"]) in log.data["githubNudgeInvite"]
855853
assert "to {}".format(data["gitlabPRBot"]) in log.data["gitlabPRBot"]
856854
assert "to {}".format(data["gitlabOpenPRBot"]) in log.data["gitlabOpenPRBot"]

tests/sentry/integrations/github/test_webhooks.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from sentry.models.commitauthor import CommitAuthor
2828
from sentry.models.commitfilechange import CommitFileChange
2929
from sentry.models.grouplink import GroupLink
30-
from sentry.models.options.organization_option import OrganizationOption
3130
from sentry.models.pullrequest import PullRequest
3231
from sentry.models.repository import Repository
3332
from sentry.silo.base import SiloMode
@@ -762,23 +761,6 @@ def test_opened(
762761

763762
assert_success_metric(mock_record)
764763

765-
@patch("sentry.integrations.github.webhook.metrics")
766-
def test_opened_missing_option(self, mock_metrics: MagicMock) -> None:
767-
Repository.objects.create(
768-
organization_id=self.project.organization.id,
769-
external_id="35129377",
770-
provider="integrations:github",
771-
name="baxterthehacker/public-repo",
772-
)
773-
774-
OrganizationOption.objects.set_value(
775-
organization=self.organization, key="sentry:github_open_pr_bot", value=False
776-
)
777-
778-
self._create_integration_and_send_pull_request_opened_event()
779-
780-
assert mock_metrics.incr.call_count == 0
781-
782764
@patch("sentry.integrations.github.webhook.metrics")
783765
def test_creates_missing_repo(self, mock_metrics: MagicMock) -> None:
784766

0 commit comments

Comments
 (0)