Debug on plugins

Hello, I’m trying to debug an issue related with the integration between discovery and lms services, is there any way to debug a plugin in tutor? The goal would be to set a breakpoint in discovery source code.

Thanks a lot!

Not out of the box, no, as there is currently no way to define development-only settings for third party services, like discovery. This is likely to change in the next release, though, as there will be a dedicated docker-compose.yml file for development: tutor/tutor/templates/dev/docker-compose.yml at master · overhangio/tutor · GitHub

However, you should be able to debug the discovery service by manually mounting your local discovery repo inside the discovery image – this is pretty much what I did while I was developing the tutor-discovery plugin.

Let us know if this any use to you!

@regis wanted to check if anything has changed on this in the newer releases, wrt dubugging of discovery service code?

Yes. There are now development settings and the docker-compose command configuration is overridden such that it’s possible to mount a local course_discovery folder. When changes are made to this folder, the development server will restart automatically:

You can use an approach similar to the one used to debug edx-platform:

https://docs.tutor.overhang.io/dev.html#point-to-a-local-edx-platform

Note however that these changes are undocumented and you are left on your own to hack on course discovery. It is assumed that if you want to debug course discovery, then you should be able to reverse-engineer the plugin and guess the changes that you need to make by yourself. The reason for that is that I have not made extensive discovery/ecommerce debugging for some time. I will be more than happy to merge pull requests that document the required changes, though.