plotly / plotly/dash

dev tools: invoke debugger/logger ineractively

Abierto
#698 5 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

feature P3
Lenguaje dominante
Python
Estrellas
24.4k
Forks
2.3k
Merge medio
2 d 7 h
PR fusionados (30 d)
13

Descripción

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?

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza revisando el callback graph existente en la dev tools UI y el procesamiento de callback requests en el backend. El issue deja sin decidir la UI de selección y los detalles del logging; para darlo por terminado habría que elegir una interacción de breakpoint o de logging, trasladar esa elección a través del state y las requests, y activarla de forma segura únicamente cuando dev_tools_ui esté habilitado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, react
Área
backend, devtools, frontend
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.