Skip to content

ref(seer): Update Slack Block Kit for automation-triggered updates#107379

Merged
leeandher merged 19 commits intomasterfrom
leanderrodrigues/iswf-1957-update-block-kit-for-automation-triggered-updates
Feb 4, 2026
Merged

ref(seer): Update Slack Block Kit for automation-triggered updates#107379
leeandher merged 19 commits intomasterfrom
leanderrodrigues/iswf-1957-update-block-kit-for-automation-triggered-updates

Conversation

@leeandher
Copy link
Copy Markdown
Member

@leeandher leeandher commented Jan 30, 2026

Resolves ISWF-1957, ISWF-1986, CW-748

  • Consolidate autofix text config into single AUTOFIX_CONFIG dictionary
  • Update message in-place when autofix is triggered (instead of ephemeral + update)
  • Add has_progressed flag to show working status in footer for automation runs
  • Remove unused SeerAutofixSuccess template
  • Add exception logging for get_automation_stopping_point

some examples

manual
image

automations
image

@linear
Copy link
Copy Markdown

linear Bot commented Jan 30, 2026

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 30, 2026
@leeandher leeandher marked this pull request as ready for review January 30, 2026 23:01
@leeandher leeandher requested review from a team as code owners January 30, 2026 23:01
Comment thread src/sentry/seer/entrypoints/integrations/slack.py
Comment thread src/sentry/notifications/platform/slack/renderers/seer.py Outdated
Comment thread src/sentry/notifications/platform/templates/seer.py
Comment thread src/sentry/notifications/platform/templates/seer.py Outdated
Comment thread src/sentry/seer/entrypoints/integrations/slack.py
@leeandher leeandher force-pushed the leanderrodrigues/iswf-1957-update-block-kit-for-automation-triggered-updates branch from 480710b to 3fafa46 Compare February 3, 2026 15:45
Comment thread src/sentry/seer/entrypoints/integrations/slack.py
Comment thread src/sentry/seer/entrypoints/integrations/slack.py Outdated
leeandher and others added 13 commits February 3, 2026 14:30
Introduce a config-driven approach for rendering autofix stage messages
in Slack, replacing repetitive conditional logic with AUTOFIX_CONFIG
dictionary. Add `has_progressed` field to SeerAutofixUpdate to track
when automation continues past the current stopping point.

Extract _render_link_button and render_footer_blocks helper methods
for better code reuse. Update Slack entrypoint to handle issue alert
vs autofix message updates separately, and include automation stopping
point in the cache payload for progress tracking.

Refs ISWF-1957
Co-Authored-By: Claude <noreply@anthropic.com>
Merge handle_issue_alert_message_update and handle_autofix_message_update
into a single update_existing_message function. The function now handles
button removal based on the current autofix stage: removing only the
autofix button for root cause analysis, or all buttons for later stages.

Also fix enum serialization in logging context by using .value and
correct footer text formatting to use newlines between status lines.

Refs ISWF-1957
Co-Authored-By: Claude <noreply@anthropic.com>
Show the link button for all stopped states, not just when also showing
the continue button. Mark solution stopping point as always progressed
since automation continues automatically. Reduce log verbosity for
unsupported event types and remove redundant logging.

Co-Authored-By: Claude <noreply@anthropic.com>
…enarios

The render_footer_blocks function now correctly handles two scenarios:
- Automation completing a stage: uses forward_text to describe the next stage
- User manually triggering: uses working_text to describe the current stage

Previously, both scenarios used working_text based on current_point, which was
incorrect for automation updates where current_point is the completed stage.

Co-Authored-By: Claude <noreply@anthropic.com>
Update tests to align with current function signatures and behavior:
- Add required data and slack_user_id parameters to test_update_existing_message
- Remove incorrect expectations for send_threaded_ephemeral_message calls
- Update block count assertion to account for footer blocks

Co-Authored-By: Claude <noreply@anthropic.com>
…ward text

Remove the SeerAutofixSuccess template and its associated enum value
as they are no longer used. Also remove italic markdown from forward
text strings since the text is already displayed in a context section.

Co-Authored-By: Claude <noreply@anthropic.com>
Add test coverage for:
- Verifying non-ROOT_CAUSE stopping points remove all action buttons
- Handling update_existing_message when slack_user_id is None

Also fix minor whitespace in the update_existing_message function.
- Move label and working_text into AUTOFIX_CONFIG for single source of truth
- Replace working_text property with next_point for clearer footer logic
- Add warning log when get_automation_stopping_point fails
- Improve Slack notification fallback text for errors and updates
- Update test to use get_group_link() which includes seerDrawer param
- Change enum .value to str() for cache-deserialized values
- Fix organization_service.get_option() call that used invalid default arg

Co-Authored-By: Claude <noreply@anthropic.com>
…ndering

Extract the automation eligibility check logic from run_automation() into
a reusable is_group_triggering_automation() function. This allows the
Slack renderer to determine whether to show an autofix button or a link
to watch automation progress without duplicating the check logic.

Also updates the Slack "View in Sentry" button to show "Watch Seer Work"
when automation is configured for the issue.
Add a property to determine whether to show the "Continue" button based
on the current stopping point and organization's coding settings. This
consolidates the logic for button visibility in one place rather than
checking stopping points directly in the renderer.

The button is shown for:
- ROOT_CAUSE: always (can proceed to solution)
- SOLUTION/CODE_CHANGES: only if coding is enabled for the org
- OPEN_PR: never (terminal state)

Co-Authored-By: Claude <noreply@anthropic.com>
When an automation stopping point is set (manual trigger), don't
auto-progress past the solution stage even if coding is enabled.
This ensures manually triggered runs respect the user's intent.

Co-Authored-By: Claude <noreply@anthropic.com>
@leeandher leeandher force-pushed the leanderrodrigues/iswf-1957-update-block-kit-for-automation-triggered-updates branch from 3fafa46 to 132f378 Compare February 3, 2026 22:25
@leeandher leeandher requested a review from a team as a code owner February 3, 2026 22:25
@leeandher leeandher force-pushed the leanderrodrigues/iswf-1957-update-block-kit-for-automation-triggered-updates branch from 132f378 to bb41d2d Compare February 3, 2026 22:31
Comment thread src/sentry/seer/entrypoints/integrations/slack.py
Comment thread src/sentry/notifications/platform/templates/seer.py
leeandher and others added 3 commits February 4, 2026 09:38
The previous logic used `or` to fall back to the default value, which
would incorrectly override an explicit `False` setting with the default.
Now explicitly check for `None` before applying the default.

Co-Authored-By: Claude <noreply@anthropic.com>
Fix the same bug that was fixed in seer.py templates: using `or` to
fall back to the default would incorrectly override an explicit `False`
setting. Now explicitly check for `None` before applying the default.

Add comprehensive tests for the `enable_seer_coding` option handling in
both the SeerAutofixUpdate.has_next_trigger property and the Slack
entrypoint's on_autofix_update method.

Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive test coverage for the Seer Slack integration:
- New test file for SeerSlackRenderer covering footer blocks, alert
  autofix elements, and autofix update rendering
- Tests for SeerAutofixTrigger.from_update and _get_next_stopping_point
- Tests for is_group_triggering_automation and get_automation_stopping_point
- Tests for SlackEntrypoint methods including stopping point parsing,
  automation stopping point handling, and edge cases

Consolidate and refactor existing template tests for better coverage
of the coding option enabled/disabled scenarios.

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

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 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread src/sentry/notifications/platform/slack/renderers/seer.py Outdated
Comment thread src/sentry/notifications/platform/templates/seer.py
Comment thread src/sentry/seer/entrypoints/integrations/slack.py
Add missing __init__.py file to prevent pytest module naming collision
with tests/sentry/grouping/seer_similarity/test_seer.py.
leeandher and others added 2 commits February 4, 2026 11:03
Simplify tests by adding _create_update helper and consolidating
related test cases. Reduces test file by ~15% while maintaining
coverage.

Fix render_alert_autofix_element to correctly check automation
triggering and add exception handling for robustness.

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove duplicate assertions in test_seer.py
- Simplify verbose docstring in render_alert_autofix_element
- Fix "compatability" typo to "compatibility"

Co-Authored-By: Claude <noreply@anthropic.com>
@leeandher leeandher merged commit 2ebefb4 into master Feb 4, 2026
72 checks passed
@leeandher leeandher deleted the leanderrodrigues/iswf-1957-update-block-kit-for-automation-triggered-updates branch February 4, 2026 17:21
jaydgoss pushed a commit that referenced this pull request Feb 12, 2026
…107379)

Resolves ISWF-1957, ISWF-1986, CW-748


- Consolidate autofix text config into single `AUTOFIX_CONFIG`
dictionary
- Update message in-place when autofix is triggered (instead of
ephemeral + update)
- Add `has_progressed` flag to show working status in footer for
automation runs
- Remove unused `SeerAutofixSuccess` template
- Add exception logging for `get_automation_stopping_point`

some examples

manual
<img width="701" height="725" alt="image"
src="https://github.com/user-attachments/assets/0c879c28-2697-4a9d-9681-5f5b46237166"
/>

automations
<img width="667" height="726" alt="image"
src="https://github.com/user-attachments/assets/be13e22b-b519-4c97-b893-ebbcf643daff"
/>

---------

Co-authored-by: Claude <noreply@anthropic.com>
dcramer pushed a commit that referenced this pull request Feb 17, 2026
…107379)

Resolves ISWF-1957, ISWF-1986, CW-748


- Consolidate autofix text config into single `AUTOFIX_CONFIG`
dictionary
- Update message in-place when autofix is triggered (instead of
ephemeral + update)
- Add `has_progressed` flag to show working status in footer for
automation runs
- Remove unused `SeerAutofixSuccess` template
- Add exception logging for `get_automation_stopping_point`

some examples

manual
<img width="701" height="725" alt="image"
src="https://github.com/user-attachments/assets/0c879c28-2697-4a9d-9681-5f5b46237166"
/>

automations
<img width="667" height="726" alt="image"
src="https://github.com/user-attachments/assets/be13e22b-b519-4c97-b893-ebbcf643daff"
/>

---------

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 20, 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