frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.72k stars 7.3k forks source link

Improve soft dependencies‘ handling #37227

Open bosue opened 1 year ago

bosue commented 1 year ago

In #33245, a soft dependency was introduced after the Payments app was split apart. Unfortunately a warning was only thrown when refreshing a particular page that may obviously no longer work.

However, tests were also affected, see #37004, and inattentive users had to figure out why all tests are failing.

Now the current problem is being taken care of in #37182. Nevertheless, whenever a soft dependency is freshly introduced and not met, I think the admin should be thrown a notice in ERPNext (“Unmet soft dependency: payments may lead to missing functionality. Please install to continue using that functionality.“) after updating/upgrading a site.

For new installs, the information should be present somewhere.

In this particular case, tests still depending on payments either shouldn’t happen or would have required a hard dependency for tests.

As we‘ve moved quite some code around to new apps and will continue doing so, it might be a good idea to put infrastructure in place ahead of v15 RC.

Also I believe, having better infrastructure for soft dependencies as well as for hard testing dependencies, will be helpful for site admins deploying custom apps on live installs.

ankush commented 8 months ago

The broader issue here is mess that is test fixtures 😔 It's giant task to cleanup tests to run without crazy dependency tree of fixtures or at least well defined tree instead of guessed one.