OSC / ondemand

Supercomputing. Seamlessly. Open, Interactive HPC Via the Web
https://openondemand.org/
MIT License
277 stars 103 forks source link

standardize MOTD initialization #3223

Open johrstrom opened 9 months ago

johrstrom commented 9 months ago

While reviewing #3216, we noticed this here, where we're rescuing from a StandardError while attempting to create the message of the day (MOTD).

https://github.com/OSC/ondemand/blob/cdfbab078b7b92efcf9c1aadc75fda7351581f6e/apps/dashboard/app/controllers/dashboard_controller.rb#L8-L9

I'm now wondering if this is useful at all (i.e., if it ever throws an exception anymore) and if it's required. If it is required, it should likely go in the set_motd method in the new concern. If not, then we should remove it as being unused.

johrstrom commented 9 months ago

In fact, we should likely follow the same pattern that widgets do if they have some issue rendering - i.e., an error widget is rendered instead of the failed partial.

https://github.com/OSC/ondemand/blob/b62c362b54144801326304f99bffe750820dfddb/apps/dashboard/app/helpers/dashboard_helper.rb#L41-L47