Skip to content

feat(notion): Render {linear_url} as Notion embed block#238

Draft
rgibert wants to merge 7 commits into
mainfrom
rgibert/notion-template-linear-url
Draft

feat(notion): Render {linear_url} as Notion embed block#238
rgibert wants to merge 7 commits into
mainfrom
rgibert/notion-template-linear-url

Conversation

@rgibert
Copy link
Copy Markdown
Member

@rgibert rgibert commented Jun 4, 2026

Adds {linear_url} placeholder support to template_markdown and 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_template now splits the template at {linear_url} occurrences (matching both [text]({linear_url}) markdown link syntax and bare {linear_url}) and returns typed segments. apply_template processes these segments, sending markdown parts via the Markdown API and inserting Notion embed blocks via _append_children for 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

rgibert added 4 commits June 4, 2026 11:39
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
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
Comment thread src/firetower/integrations/services/notion.py
rgibert added 3 commits June 4, 2026 15:55
…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
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.

1 participant