plotly / plotly/dash

dev tools: invoke debugger/logger ineractively

Ouverte
#698 5 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

feature P3
Langage dominant
Python
Étoiles
24.4k
Forks
2.3k
Merge moyen
2 j 7 h
PR mergées (30 j)
13

Description

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?

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par examiner le callback graph existant dans la dev tools UI et le traitement des callback requests sur le backend. L’issue laisse indéterminés l’UI de sélection et les détails du logging ; pour considérer le travail comme terminé, il faudrait choisir une interaction de breakpoint ou de logging, transmettre ce choix via le state et les requests, et ne l’activer de manière sûre que lorsque dev_tools_ui est activé.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, react
Domaine
backend, devtools, frontend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.