plotly / plotly/dash

dev tools: invoke debugger/logger ineractively

Offen
#698 5 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature P3
Vorherrschende Sprache
Python
Sterne
24.4k
Forks
2.3k
Ø Merge
2 T. 7 Std.
Gemergte PRs (30 T.)
13

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Überprüfung des bestehenden callback graph in der dev tools UI und der Verarbeitung von callback requests im Backend. Das Issue lässt die Auswahl-UI und die Details der Protokollierung offen; für die Fertigstellung müsste eine Interaktion zum Setzen eines Breakpoints oder zur Protokollierung ausgewählt, diese Auswahl durch State und Requests weitergereicht und nur bei aktiviertem dev_tools_ui sicher aktiviert werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, react
Bereich
backend, devtools, frontend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.