fermitools / managed-tokens

Managed Tokens service for FIFE Experiments at Fermilab
Apache License 2.0
0 stars 0 forks source link

Possible code duplication in preparing Service Emails and Admin emails #57

Closed shreyb closed 7 months ago

shreyb commented 12 months ago

https://github.com/shreyb/managed-tokens/blob/200b4b540da8b2f53fe37e2716d14342cb3bb56f/internal/notifications/tableUtils.go#L120

Investigate if this func can be replaced with a call to PrepareTableStringFromMap, like in this line:

https://github.com/shreyb/managed-tokens/blob/main/internal/notifications/admin.go#L464

Given that the service email table and the admin email table are the same, I think they can be the same thing. Then maybe we don't have to duplicate the work of aggregating it in a service email AND an admin email, and just have both read from the same data structure.

shreyb commented 7 months ago

This is done. Just have to run some end-to-end tests and write documentation and this feature is done.

shreyb commented 7 months ago

All tests pass. There was one bug that came up, but has been fixed. Now to document the changes to the AdminNotificationManager interface.

shreyb commented 7 months ago

Documentation done.