community-of-python / microbootstrap

Bootstrap your microservices in a second!
28 stars 2 forks source link

Enable debug and reload by default #32

Closed vrslev closed 1 month ago

vrslev commented 1 month ago

Actually disable debug by default. BaseServiceSettings has to go first to make sure the default settings defined there are not overwritten.

vrslev commented 1 month ago

I will merge and release now, if you have objections or suggestions, add a comment. Thanks!

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Flag Coverage Δ
unittests 98.28% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
microbootstrap/settings.py 100.00% <100.00%> (ø)
insani7y commented 1 month ago

Why do you want to change it? By default, we launch service in debug mode, because first launch is all about development

vrslev commented 1 month ago

This PR is relevant to #20 and actually does what that pr says

vrslev commented 1 month ago

20 was meant to make non-debug mode a default, but failed because LoggingConfig was overriding it

vrslev commented 1 month ago

You've OKaid it before: https://github.com/community-of-python/microbootstrap/pull/20#issuecomment-2405870416

vrslev commented 1 month ago

On the "why": I guess there's no right way to do it. I like when a software component is ready for production out-of-the-box.

vrslev commented 1 month ago

Still, DX is important. And we should decide what is more important: starting with development right away, or making sure not to f-up when deploying to production

insani7y commented 1 month ago

Yeah, but now this does not strike me as a logical solution. I think, one can be confused if he sends requests and does not receive any logs, cause memory logger works that way in non-debug mode. Also in debug mode you can see beautified table of enabled/disabled instruments, which can help in package understanding. I think, package should be a little bit more friendly to those, who is not familiar with our ecosystem. If this was innersource - no problem, but it isn't

vrslev commented 1 month ago

Okay, but what would be the best practice for where to set service_debug to false?

insani7y commented 1 month ago

I think opensource is about ease of use and intuitive behavior. If we disable debug mode, this could led to confusion. Let the user disable it himself

vrslev commented 1 month ago

but what would be the best practice for where to set service_debug to false?

I don't think it fits well in ServiceSettings

vrslev commented 1 month ago

Should we enable reload by default as well then?

insani7y commented 1 month ago

We've decided to set service_debug and reload to True by default

vrslev commented 1 month ago

@insani7y has convinced me that the DX is more important in case of microbootstrap. It would be much more intuitive for newcomers