[BUG] Notebooks: markdown cell `id` is regenerated on every GET

オープン
#807 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
api, cli

調査の方向性

まず、/tmp/nb.json を使用して、文書化されている pup notebooks create と pup api v1/notebooks/{id} --no-agent の再現を行い、その後、繰り返した GET のレスポンスを比較します。レポートでは、この挙動をサーバー側のものとして特定し、#554 を参照していますが、変更対象となるリポジトリのファイルやテストは示されていません。完了条件は、変更されていないノートブックが、markdown およびその他のセル型について、GET ごとに安定した一意のセル id を返すことです。

索引モデルが issue の本文から書いたものです。

説明

bug product:dashboards usability

similar to https://github.com/DataDog/pup/issues/554

Describe the bug

pup notebooks get returns a different id for every markdown cell on each call, while graph cells (e.g. timeseries) keep stable ids. The same happens through the raw passthrough (pup api v1/notebooks/{id}), so the ids change in the API response itself, not in pup's client layer. same layering as #554.

This makes markdown cells unaddressable: any get -> modify -> update workflow that relies on cell ids cannot reference a markdown cell across two calls.

To Reproduce

Save as /tmp/nb.json:

{
  "data": {
    "type": "notebooks",
    "attributes": {
      "name": "markdown cell id stability test",
      "status": "published",
      "time": { "live_span": "1h" },
      "cells": [
        { "type": "notebook_cells", "attributes": { "definition": { "type": "markdown", "text": "# Section" } } },
        { "type": "notebook_cells", "attributes": { "definition": { "type": "timeseries", "requests": [ { "display_type": "line", "q": "avg:system.cpu.user{*}" } ] } } }
      ]
    }
  }
}
pup notebooks create --file /tmp/nb.json   # note the returned notebook id
for i in 1 2 3; do
  pup api v1/notebooks/$NB_ID --no-agent | jq -c '[.data.attributes.cells[] | {id, type: .attributes.definition.type}]'
done

Observed (no writes between the three GETs):

[{"id":"2l892wv8","type":"markdown"},{"id":"5k2rqfa5","type":"timeseries"}]
[{"id":"fwhey19c","type":"markdown"},{"id":"5k2rqfa5","type":"timeseries"}]
[{"id":"sjguoeel","type":"markdown"},{"id":"5k2rqfa5","type":"timeseries"}]

The markdown cell gets a fresh id on every GET; the timeseries id is stable.

Expected behavior

Cell ids should be stable across GETs of an unchanged notebook, and unique within a single response, for all cell types.

Additional observations (same root symptom, not minimally reproduced)

On a long-lived notebook that had received several notebooks update calls, GET responses additionally showed:

  • an empty markdown cell ({"type":"markdown","text":""}) after every timeseries cell, each with a fresh id per GET; updates whose payload omits these cells do not durably remove them;
  • the same cell id appearing twice within a single GET response (4 duplicated ids among 12 timeseries cells).

A freshly created notebook does not show either symptom (single, repeated, rapid-succession, id-bearing and id-stripped updates all round-trip cleanly), so these look like a server-side state/merge condition. Reported together because the markdown id instability above makes id-based diagnosis or repair of such a notebook impossible via the API.

Environment

  • OS: macOS 26 (aarch64)
  • Pup version: 0.65.4 (rust 1.95.0)
  • Auth: OAuth2, site datadoghq.com
  • Reproduces identically via pup api v1/notebooks/{id} raw passthrough (server-side, cf. #554)
主要言語
Rust
スター
1k
フォーク
138
平均マージ
17時間
マージ済み PR(30日)
82

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DataDog/pup のほかの issue

DataDog/pup の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。