Skip to content

feat(incidents): Add skip-paging option for P0/P1 incidents#254

Merged
rgibert merged 8 commits into
mainfrom
rgibert/skip-paging-option
Jul 3, 2026
Merged

feat(incidents): Add skip-paging option for P0/P1 incidents#254
rgibert merged 8 commits into
mainfrom
rgibert/skip-paging-option

Conversation

@rgibert

@rgibert rgibert commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a "Skip paging on-call responders" checkbox to the /inc new Slack modal, grouped with the private incident toggle in a single Options block
  • Checkbox appears only for P0/P1 severity (dynamically via views.update on severity change) and defaults to checked
  • When selected, suppresses both PagerDuty paging and on-call channel invites at creation time
  • Implemented as a transient flag threaded through serializer context -- no model or migration changes

Agent transcript: https://claudescope.sentry.dev/share/eReflyKHOjlxj3XHUR_WogKuafhwOofLe6_a9YdDSIA

Adds a "Skip paging on-call responders" checkbox to the /inc new modal
that appears (and defaults to checked) when severity is P0 or P1. When
selected, both PagerDuty paging and on-call channel invites are skipped.

The flag is transient -- it threads from the Slack modal through serializer
context to the incident hooks at creation time, with no model changes.

The severity select now uses dispatch_action to dynamically show/hide the
skip-paging option via views.update when the user changes severity.

Closes RELENG-833

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Agent transcript: https://claudescope.sentry.dev/share/_VGnoulIKkldtN9n9qeKgA1BrEzRNdYIUxYb9B11C2o
@rgibert rgibert requested a review from a team as a code owner June 12, 2026 15:08
@linear-code

linear-code Bot commented Jun 12, 2026

Copy link
Copy Markdown

RELENG-833

@rgibert rgibert self-assigned this Jun 12, 2026
Comment thread src/firetower/slack_app/handlers/new_incident.py
The serializer test expected on_incident_created(incident) without the
new skip_paging kwarg. The two new handler tests needed HOOKS_ENABLED=True
to reach the on_incident_created call path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Agent transcript: https://claudescope.sentry.dev/share/uOhBQs8tSIs_BIgGrBMKGlxijRPYmS3xP0YXebZtObc
Comment thread src/firetower/incidents/serializers.py
Comment thread src/firetower/slack_app/tests/handlers/test_new_incident.py
Comment thread src/firetower/slack_app/tests/handlers/test_new_incident.py
When a user changes severity in the modal, handle_severity_action now
reads the current options_block selections from view state and threads
them through to _build_options_block so initial_options reflects the
user's prior choices (e.g. private) rather than resetting them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Agent transcript: https://claudescope.sentry.dev/share/08Y9vY0PBATSmZuY5L6EAGyLKxFKk0sRIBUBbK-jk5U
Comment thread src/firetower/incidents/hooks.py
When a user first selects P0/P1, skip_paging was not in the prior
selections (it did not exist at the previous severity), so
_build_options_block received an empty set and skipped the default-on
branch. Now handle_severity_action injects skip_paging into the
selected values when the new severity is high and skip_paging is not
already present, ensuring it renders checked on first appearance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Agent transcript: https://claudescope.sentry.dev/share/ADzF8zl8QmltQGscnYCK808rg5r0ERyZGJtS2FN9m4M
Comment thread src/firetower/slack_app/handlers/new_incident.py Outdated
Comment thread src/firetower/slack_app/handlers/new_incident.py Outdated
Comment thread src/firetower/slack_app/bolt.py
handle_severity_action now extracts user_id from the action body and
passes it to _build_new_incident_modal so the captain block retains its
initial_user when views.update rebuilds the modal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Agent transcript: https://claudescope.sentry.dev/share/Qeq8_btcFr1qAGYpHcYenuDZuFQwAdU2EoYfA3V5dnI
@rgibert rgibert changed the title feat(incidents): Add skip-paging option for self-handled P0/P1 incidents feat(incidents): Add skip-paging option for P0/P1 incidents Jul 3, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e6f1066. Configure here.

if block.get("block_id") == "severity_block":
block["dispatch_action"] = True

blocks.append(_build_options_block(severity, selected_values=selected_options))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Severity resets on view update

Medium Severity

After a user picks P0/P1, handle_severity_action rebuilds the modal via _build_new_incident_modal using the chosen severity only for the Options checkboxes. The severity static_select still comes from build_incident_form_blocks with its default P3 initial_option, so views.update can reset the dropdown while skip-paging options reflect the high severity—risking the wrong severity on submit or paging behavior that does not match what the user selected.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e6f1066. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

False positive. Slack's views.update preserves user-selected state for elements whose block_id + action_id remain unchanged. The severity block keeps block_id="severity_block" and action_id="severity" across the update, so the user's selection is retained. The initial_option: P3 only applies when the field hasn't been interacted with yet.

— Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok cool cool

— Spencer

initial_options: list[dict[str, Any]] = []

is_high = severity in HIGH_SEVERITIES
if is_high:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so this will only show when high severity is selected? am I understanding that right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm quite sure the answer is yes after reading a bit more

@rgibert rgibert merged commit 653ea10 into main Jul 3, 2026
33 checks passed
@rgibert rgibert deleted the rgibert/skip-paging-option branch July 3, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants