Skip to content

feat(notebooks): Publish the notebook producer endpoints - #130740

Merged
wedamija merged 8 commits into
masterfrom
danf/notebooks-public
Nov 14, 2026
Merged

wedamija merged 8 commits into
masterfrom
danf/notebooks-public

Conversation

@wedamija

Copy link
Copy Markdown
Member

We're moving the notebook tables (Investigation*) into a new sentry.notebooks app, separate from the hypothesis engine that writes them, so other Seer producers like Autofix and triage can write notebooks too.

Notebook create, details, and block writes become public so Seer producers can call them through Code Mode. They accept only notebookVersion, and the response types are fully documented.

@wedamija
wedamija requested review from a team as code owners November 11, 2026 00:18
@wedamija
wedamija requested review from arslnb and billyvg November 11, 2026 00:18
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 11, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2013c59. Configure here.

Comment thread src/sentry/investigations/apidocs.py Resolved
class OrganizationNotebooksIndexEndpoint(OrganizationNotebooksBaseEndpoint):
owner = ApiOwner.ML_AI
publish_status = {"GET": ApiPublishStatus.PRIVATE, "POST": ApiPublishStatus.PRIVATE}
publish_status = {"GET": ApiPublishStatus.PRIVATE, "POST": ApiPublishStatus.PUBLIC}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Publishing writes that a read-only org:read token can perform

NotebookPermission (notebooks/endpoints/base.py, outside this diff) maps POST/PUT/DELETE to org:read. That lets members write in open-membership orgs. Once these methods are public, though, the published contract says a user token minted with only org:read, which people treat as read-only, can do all of the following:

  • create notebooks
  • overwrite producer blocks by key, including reviving deleted ones
  • reorder blocks
  • delete blocks

Runtime behaviour doesn't change: private endpoints already accepted tokens. What changes is that the public docs advertise it, and tightening the scope later would break public clients. Is org:read the scope you want to commit to for public notebook writes? A member-held write scope such as event:write might fit better. If you do want org:read, it may be worth a sentence in the tag description.

Written by an AI agent and included in this review by its author.

@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from 28e5d3f to d5bcd18 Compare November 11, 2026 00:58
@wedamija
wedamija requested review from a team as code owners November 11, 2026 00:58
@wedamija
wedamija force-pushed the danf/notebooks-public branch from 2013c59 to 06ded32 Compare November 11, 2026 00:58
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from d5bcd18 to 7300b7c Compare November 11, 2026 03:54
@wedamija
wedamija requested a review from a team as a code owner November 11, 2026 03:54
@wedamija
wedamija force-pushed the danf/notebooks-public branch from fe57c9a to 6cef709 Compare November 11, 2026 03:59
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from 7300b7c to e9b49bb Compare November 11, 2026 18:09
@wedamija
wedamija force-pushed the danf/notebooks-public branch from 6cef709 to 3b2d1c7 Compare November 11, 2026 18:09
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from e9b49bb to 1bf82e1 Compare November 11, 2026 18:24
@wedamija
wedamija force-pushed the danf/notebooks-public branch from 3b2d1c7 to 6f84aa6 Compare November 11, 2026 18:24
@wedamija
wedamija requested a review from billyvg November 11, 2026 18:35
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from 1bf82e1 to 8653e2f Compare November 11, 2026 18:47
@wedamija
wedamija force-pushed the danf/notebooks-public branch from 6f84aa6 to 66ddef2 Compare November 11, 2026 18:47
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from 8653e2f to ea2728e Compare November 13, 2026 18:37
@wedamija
wedamija force-pushed the danf/notebooks-public branch from 9ca5197 to e573180 Compare November 13, 2026 18:37
@wedamija
wedamija requested a review from billyvg November 13, 2026 18:44
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from ea2728e to 8b9bcb7 Compare November 13, 2026 19:15
@wedamija
wedamija force-pushed the danf/notebooks-public branch from e573180 to 91ebb4b Compare November 13, 2026 19:15
@wedamija
wedamija removed the request for review from billyvg November 13, 2026 22:10
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from 8b9bcb7 to 91d706e Compare November 13, 2026 22:37
@wedamija
wedamija force-pushed the danf/notebooks-public branch from 91ebb4b to 8fcfa93 Compare November 13, 2026 22:37
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from 91d706e to 9a16983 Compare November 13, 2026 23:30
@wedamija
wedamija force-pushed the danf/notebooks-public branch from 8fcfa93 to d3f754e Compare November 13, 2026 23:30
@wedamija
wedamija force-pushed the danf/notebooks-version-field branch from 9a16983 to f2f72b3 Compare November 13, 2026 23:37
Base automatically changed from danf/notebooks-version-field to master November 13, 2026 23:42
…he agent token matrix

Declare Response[T] shapes on the newly public notebook endpoints, and give the
public API matrix real notebooks, blocks, payloads, and the investigations flag.
…nd the agent token matrix

Send notebookVersion in the service account tests, and key the matrix's notebook
request bodies by the renamed endpoint classes.
Filter on is_published, so an EXPERIMENTAL method stays in the private
investigation schema.
…tebooks tag

Mark the published methods PUBLIC_EXPERIMENTAL, since the API may still
change. Name their operations and responses after notebooks, and give them
a Notebooks tag. Private methods keep their Investigation names.
@wedamija
wedamija force-pushed the danf/notebooks-public branch from d3f754e to 5227fe3 Compare November 13, 2026 23:43
@wedamija
wedamija merged commit ac2cd81 into master Nov 14, 2026
84 of 85 checks passed
@wedamija
wedamija deleted the danf/notebooks-public branch November 14, 2026 01:11
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.

2 participants