Fix inverted description/message on canopy-filed events; reject newlines in description#140
Open
passcod wants to merge 2 commits into
Open
Fix inverted description/message on canopy-filed events; reject newlines in description#140passcod wants to merge 2 commits into
passcod wants to merge 2 commits into
Conversation
…body as description The frontend's IssueRow uses `description` as the issue headline and falls back to `message` for the body; the Slack integration also plumbs `issue.message` into the workflow's `message` variable (documented as 'issue body'). Two filing sites had this inverted: - `slacker_outbox`'s `file_self_event` for `canopy/slack-delivery-failure` was filing the row id / attempt count / last error as `description` and the one-line summary as `message`. - `public-server`'s `file_health_events` filed the multi-line health detail blob as `description` and the short headline as `message` (for both the roll-up and the per-check opens). Swap them. Close events that previously had `description = None` are unchanged — they only carried short text in `message`, so the `headline = description || first_line_of_message` fallback in the UI still picks the right text.
…lines - Adds doc comments on `NewEvent` (and the persisted `Issue` / `Event` rows) clarifying that `description` is the short title/subject and `message` is the body. The UI's IssueRow already uses `description` as the headline; this just makes the wire-level contract explicit. - `NewEvent::save` now returns `BadRequest` if `description` contains a newline. Multi-line content belongs in `message`. The check fires before any DB work, so the public `/events` endpoint surfaces it as a 400 directly.
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.
Summary
The frontend's `IssueRow` uses an issue's `description` as the headline and falls back to the first line of `message` for the body; the Slack integration plumbs `issue.message` into the workflow's `message` variable, documented as 'issue body'. Two canopy-side filing sites had the two fields swapped:
Both fixed. Close events that previously had `description = None` are unchanged — they only carried short text in `message`, so the UI's `headline = description || first_line_of_message` fallback still picks the right text.
Doc + validation
Tests