feat(notion): Render {linear_url} as Notion embed block#238
Draft
rgibert wants to merge 7 commits into
Draft
Conversation
Allow template_markdown to interpolate incident data so that the
action items table can be replaced with a link to the parent Linear
issue. The only supported placeholder for now is {linear_url}.
Co-Authored-By: Claude <noreply@anthropic.com>
Agent transcript: https://claudescope.sentry.dev/share/9G_FB_aO2l785A6uYLrBqhpbxFaV1WKtyjyYaeMwF-Q
Instead of substituting the URL into the markdown as a link,
split the template at {linear_url} and insert a Notion embed
block. Handles both bare placeholders and markdown link syntax
like [text]({linear_url}).
Co-Authored-By: Claude <noreply@anthropic.com>
Agent transcript: https://claudescope.sentry.dev/share/38ulfplCgOmnVUnWjl_W2QpwItTmlKZwA5C6us5agXo
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/QTCzgbkKJ3bDRkSRj5RqO1wY2urkHxEbo5c9nN97Xus
Correct three calls to nonexistent _get_slack_user_id in hooks.py to use the existing get_slack_user_id function. Update test patches in test_cancel, test_mitigated, and test_resolved to target on_incident_updated instead of the removed on_title_changed and on_status_changed imports in serializers.py. Co-Authored-By: Claude <noreply@anthropic.com> Agent transcript: https://claudescope.sentry.dev/share/xypNRO4pjqBx0OCRVcjUrH6Teo0U2rvGGYAOkwN4YKE
…ar_url}
When the template consists solely of {linear_url} and the incident has
no Linear link, _render_template returned a fallback segment with empty
content that would 400 on the Notion Markdown API. Return an empty list
instead so apply_template simply skips the markdown step.
Co-Authored-By: Claude <noreply@anthropic.com>
Agent transcript: https://claudescope.sentry.dev/share/sksH6Zd7rMSWzvTwie8hZzEnexxBBctteVGbyffm1FM
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
{linear_url}placeholder support totemplate_markdownand renders it as a Notion embed block instead of a plain markdown link.The first commit introduces the placeholder with simple string substitution. The second commit changes the approach:
_render_templatenow splits the template at{linear_url}occurrences (matching both[text]({linear_url})markdown link syntax and bare{linear_url}) and returns typed segments.apply_templateprocesses these segments, sending markdown parts via the Markdown API and inserting Notion embed blocks via_append_childrenfor the Linear URL.When an incident has no Linear link, the placeholder and any surrounding markdown link syntax are stripped without inserting an embed.
Agent transcript: https://claudescope.sentry.dev/share/epF1BddIpzE1HaknDbdR3uZbE6yvjQ1euX88E9LbVPM