plotly / plotly/dash

dev tools: invoke debugger/logger ineractively

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

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

feature P3
主要言語
Python
スター
24.4k
フォーク
2.3k
平均マージ
2日 7時間
マージ済み PR(30日)
13

説明

Now that we have the callback graph in the dev tools UI, let's use that to enable interactive callback debugging!

  • Use clicks on a callback in the graph, and you get extra debugging of that callback. Not sure what the UI looks like to choose one, but either:
    • It becomes a breakpoint (maybe the callback circle changes from green to red?)
    • It gets a verbose logger - in Python there's https://github.com/cool-RR/PySnooper for example (callback circle turns orange?)
  • That flags this callback (based on its output list) for debugging, somewhere in the redux state.
  • When any callback is triggered, we check this state and if the requested outputs are flagged, add a key to the request like debug: ('breakpoint'|'logging')
  • On the back end, if we see such a key AND the app was run with dev_tools_ui: True (we don't want hackers to be able to hang the back end or dig into back-end code from production apps!), we invoke the specified debugger:
    • For breakpoint, wrap the callback in pdb.runcall, which starts pdb at the beginning of the function, in the server console (eventually perhaps we could pull this to the front end, but that sounds like a much bigger project). Then it's up to the user to run the debugger and allow the function to finish and return.
    • For logging we wrap the callback in the appropriate pysnooper call, capture the output, and return it with the output data, and display it in the error console.
    • @rpkyle do both of these modes have equivalents in R?

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず dev tools UI の既存の callback graph と、backend での callback requests の処理を確認します。この issue では選択 UI と logging の詳細が未決定のままです。完了するには、breakpoint または logging のためのインタラクションを選択し、その選択を state と requests に渡し、dev_tools_ui が有効な場合にのみ安全に有効化する必要があります。

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

評価

技術スタック
python, react
領域
backend, devtools, frontend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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