chore(integrations): log Jira issue.updated webhook payloads behind a flag#114822
Merged
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7bfa989. Configure here.
0bf2e52 to
127d2f7
Compare
… flag Adds a temporary `organizations:jira-issue-updated-payload-logging` Flagpole feature that, when enabled for a linked org, causes the Jira Cloud `issue.updated` webhook handler to log the full webhook payload plus a focused log line whenever the changelog contains a `project` change. We need this data to design issue-link rewriting when a Jira issue is moved between projects.
…ogging errors The temporary `_payload_logging_enabled` feature-flag check makes RPC calls (`integration_service.organization_contexts` plus per-org `organization_service.get_organization_by_id`) on every issue.updated webhook before the real handlers run. Any transient RPC failure propagated up and turned into a 500, skipping `handle_assignee_change` and `handle_status_change` entirely. Wrap the diagnostic block in `try/except` so failures are reported via `logger.exception` but the webhook still drives assignee and status sync. Add a regression test that forces `_payload_logging_enabled` to raise and asserts the assignee handler still runs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
…ogging check The newly-added `_payload_logging_enabled` check fanned out one `organization_service.get_organization_by_id` RPC per linked Sentry org just to evaluate a feature flag, on every webhook regardless of whether the flag was on for any org. A Jira integration shared by N orgs paid N RPCs per `issue.updated` webhook. Replace the per-org `get_organization_by_id` loop with a single batched `Organization.objects.get_many_from_cache(...)`. The endpoint is `@cell_silo_endpoint`, so the region-cache path is always available. Net per webhook: 0 per-org `get_organization_by_id` calls in the feature check, down from N. Co-authored-by: Cursor <cursoragent@cursor.com>
127d2f7 to
9f8a7ae
Compare
…ging check `bind_org_context_from_integration` already resolves the integration's linked org(s) to bind them to the SDK scope. Have it return the bound `RpcOrganization` (or `None` for zero-org and ambiguous multi-org installations) so callers that need the org for follow-up work can reuse it instead of re-fetching it. Use the returned org in the Jira `issue.updated` payload-logging check. This drops the per-org `get_organization_by_id` fan-out (previously N RPCs per webhook for a Jira installation linked to N Sentry orgs) and keeps all integration-id-to-org resolution logic in a single place. Behavior change: ambiguous multi-tenant Jira installations (one Jira workspace shared by multiple Sentry orgs) no longer trigger payload logging. This is intentional — we shouldn't dump one tenant's webhook payloads into our diagnostic logs because a different tenant on the same workspace flipped the flag. The other three callers of `bind_org_context_from_integration` (`slack/webhooks/action.py`, `jira/webhooks/uninstalled.py`, `jira/webhooks/installed.py`) ignore the new return value. Co-authored-by: Cursor <cursoragent@cursor.com>
The helper had collapsed to a one-liner (`org is not None and features.has(...)`) that was only worth keeping to preserve the existing test mock. Inline it, and switch the failure-path test to mock `logger.info` instead — the test now exercises the real feature-flag check end-to-end via `@with_feature`, which is closer to the failure mode the try/except is actually guarding. Co-authored-by: Cursor <cursoragent@cursor.com>
GabeVillalobos
approved these changes
May 7, 2026
constantinius
pushed a commit
that referenced
this pull request
May 8, 2026
… flag (#114822) Adds a temporary `organizations:jira-issue-updated-payload-logging` Flagpole feature that, when enabled for a linked org, causes the Jira Cloud `issue.updated` webhook handler to log the full webhook payload plus a focused log line whenever the changelog contains a `project` change. We need this data to design issue-link rewriting when a Jira issue is moved between projects. Resolves ISWF-1512 --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
nikkikapadia
pushed a commit
that referenced
this pull request
May 12, 2026
… flag (#114822) Adds a temporary `organizations:jira-issue-updated-payload-logging` Flagpole feature that, when enabled for a linked org, causes the Jira Cloud `issue.updated` webhook handler to log the full webhook payload plus a focused log line whenever the changelog contains a `project` change. We need this data to design issue-link rewriting when a Jira issue is moved between projects. Resolves ISWF-1512 --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds a temporary
organizations:jira-issue-updated-payload-loggingFlagpole feature that, when enabled for a linked org, causes the Jira Cloudissue.updatedwebhook handler to log the full webhook payload plus a focused log line whenever the changelog contains aprojectchange. We need this data to design issue-link rewriting when a Jira issue is moved between projects.Resolves ISWF-1512