Skip to content

Conversation

@leeandher
Copy link
Member

@leeandher leeandher commented Jan 9, 2026

Adds a slack-compact-alerts flag for the new alert layout. The compact layout won't affect most customers, key differences are

  • the AI summary is moved
  • title will not vary by your access to Seer
  • suggested assignee is moved to the context stats
  • suspect commit removed
image

Hard to display all the differences without setting them up each feature and preventing race conditions (i.e. alert fires before suggested assignee is determined), so we can verify with tests and in production via the flag.

@linear
Copy link

linear bot commented Jan 9, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 9, 2026
@leeandher leeandher force-pushed the leander/eco-1315-improve-slack-issue-alert-message branch from 17702fa to 5f79552 Compare January 9, 2026 16:37
Copy link
Member Author

@leeandher leeandher Jan 9, 2026

Choose a reason for hiding this comment

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

This test is very fragile, but would be a much bigger initiative to change for now, so I just resolved the indices. We were rendering the action_text block ('issue resolved by X') before the context on tags/counts -- when in reality it should be replacing the action block which is underneath it.

That correction, caused this rewrite :/

@leeandher leeandher marked this pull request as ready for review January 9, 2026 18:38
@leeandher leeandher requested review from a team as code owners January 9, 2026 18:38
leeandher and others added 7 commits January 16, 2026 13:35
Add tests for the slack-compact-alerts feature flag behavior:
- Verify AI summary displays as "Initial Guess:" context block
- Verify suggested assignees appear in compact format

Also fix nested quote syntax error in get_issue_summary_text().

Refs ECO-1315
Co-Authored-By: Claude <[email protected]>
Store the feature flag result in an instance variable at the start of
build() instead of checking it 8 times throughout the method. Also add
a basic test for the compact layout without AI summary dependencies.

Refs ECO-1315
Co-Authored-By: Claude <[email protected]>
The compact alerts refactor moved the action_text block from before
the context block to after it. Update test assertions to use the
correct block indices (blocks[2] -> blocks[3] for action_text).

Co-Authored-By: Claude <[email protected]>
Add validation to prevent appending an empty context block when both
get_context() returns empty and there are no suggested assignees.
This mirrors the guard logic in the non-compact code path and prevents
potential Slack API validation errors.

Co-Authored-By: Claude <[email protected]>
Extract compact/non-compact block building logic into separate helper
methods for better maintainability and testability. Add MAX_SUGGESTED_ASSIGNEES
constant to limit displayed assignees to 3 in Slack messages.

Addresses PR review feedback:
- Truncate suggested assignees list to prevent overly long messages
- Split compact mode logic into _build_context_blocks and _build_trailing_blocks

Co-Authored-By: Claude <[email protected]>
Rename method to follow the build_ prefix convention used by other
block-building methods in the class. Move method near related
build_description_block and build_pre_footer_context_block methods.

Co-Authored-By: Claude <[email protected]>
@leeandher leeandher force-pushed the leander/eco-1315-improve-slack-issue-alert-message branch from 1a34698 to 2861669 Compare January 16, 2026 19:39
Copy link
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.

Fix build_description_block to pass the stripped text variable instead
of the original description_text, ensuring consistent whitespace handling.

Strip context_text in build_group_context_block before empty check to
prevent whitespace-only context blocks from being rendered.

Co-Authored-By: Claude <[email protected]>
Rename method to plural form and return a list of blocks instead of
a single optional block. This allows the method to return multiple
context blocks (e.g., both suggested assignees and suspect commit)
in the non-compact mode.

Co-Authored-By: Claude <[email protected]>
@leeandher leeandher merged commit 8feaf6f into master Jan 16, 2026
66 checks passed
@leeandher leeandher deleted the leander/eco-1315-improve-slack-issue-alert-message branch January 16, 2026 21:37
BYK pushed a commit that referenced this pull request Jan 19, 2026
Adds a slack-compact-alerts flag for the new alert layout. The compact
layout won't affect most customers, key differences are
- the AI summary is moved 
- title will not vary by your access to Seer
- suggested assignee is moved to the context stats
- suspect commit removed

<img width="652" height="454" alt="image"
src="https://github.com/user-attachments/assets/24ea61b5-3f76-4555-a9fd-7ab49ca6bb43"
/>

Hard to display all the differences without setting them up each feature
and preventing race conditions (i.e. alert fires before suggested
assignee is determined), so we can verify with tests and in production
via the flag.

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants