Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/sentry/preprod/vcs/pr_comments/size_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def create_preprod_size_pr_comment_task(
log_prefix="preprod.size_pr_comments",
enabled_option_key=ENABLED_OPTION_KEY,
caller=caller,
feature_flag="organizations:preprod-size-analysis-pr-comments",
with_build_configuration=True,
)
if ctx is None:
Expand Down
1 change: 0 additions & 1 deletion src/sentry/preprod/vcs/pr_comments/snapshot_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def create_preprod_snapshot_pr_comment_task(
log_prefix="preprod.snapshot_pr_comments",
enabled_option_key=ENABLED_OPTION_KEY,
caller=caller,
feature_flag=None,
with_build_configuration=False,
)
if ctx is None:
Expand Down
10 changes: 1 addition & 9 deletions src/sentry/preprod/vcs/pr_comments/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from django.db import router, transaction
from taskbroker_client.retry import Retry

from sentry import features
from sentry.models.commitcomparison import CommitComparison
from sentry.models.organization import Organization
from sentry.preprod.build_distribution_utils import is_installable_artifact
Expand Down Expand Up @@ -40,13 +39,12 @@ def resolve_pr_comment_context(
log_prefix: str,
enabled_option_key: str,
caller: str | None = None,
feature_flag: str | None = None,
with_build_configuration: bool = True,
) -> PrCommentContext | None:
"""Resolve common PR-comment inputs after applying the shared task guards.

Returns ``None`` after logging when the artifact or required PR information
is missing, the project option is disabled, or the optional feature gate fails.
is missing, or the project option is disabled.
"""

def event_name(suffix: str) -> str:
Expand Down Expand Up @@ -95,12 +93,6 @@ def event_name(suffix: str) -> str:
return None

organization = artifact.project.organization
if feature_flag is not None and not features.has(feature_flag, organization):
logger.info(
event_name("feature_disabled"),
extra={"preprod_artifact_id": artifact.id, "organization_id": organization.id},
)
return None

return PrCommentContext(
artifact,
Expand Down
16 changes: 0 additions & 16 deletions tests/sentry/preprod/vcs/pr_comments/test_size_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
from sentry.preprod.vcs.status_checks.size.types import StatusCheckRule, TriggeredRule
from sentry.shared_integrations.exceptions import ApiError
from sentry.testutils.cases import TestCase
from sentry.testutils.helpers.features import with_feature
from sentry.testutils.silo import cell_silo_test

FEATURE = "organizations:preprod-size-analysis-pr-comments"
ENABLED_OPTION_KEY = "sentry:preprod_size_pr_comments_enabled"
RULES_OPTION_KEY = "sentry:preprod_size_pr_comments_rules"

Expand Down Expand Up @@ -57,7 +55,6 @@ def _eval_result(


@cell_silo_test
@with_feature(FEATURE)
class CreatePreprodSizePrCommentTaskTest(TestCase):
def setUp(self) -> None:
super().setUp()
Expand Down Expand Up @@ -309,19 +306,6 @@ def test_skips_when_no_client(self, mock_eval, mock_get_client) -> None:

mock_eval.assert_not_called()

@patch(_CLIENT_PATH)
@patch(_EVAL_PATH)
def test_skips_when_feature_flag_disabled(self, mock_eval, mock_get_client) -> None:
self._enable()
self._set_rules()
artifact = self._create_artifact()

with self.feature({FEATURE: False}):
self._import_task()(artifact.id)

mock_get_client.assert_not_called()
mock_eval.assert_not_called()

@patch(_CLIENT_PATH)
@patch(_EVAL_PATH)
def test_skips_nonexistent_artifact(self, mock_eval, mock_get_client) -> None:
Expand Down
Loading