Adds a check of the actual remaining budget for the previous billing cycle (based on recorded costs), against the number of compute units sent back to hub (partially based on forecasts)
A slack message is sent showing the result. If there is a difference, the differing totals and the over/under charge are shown.
This check is scheduled to run at 1pm, 3 days after the end of each billing cycle (or the end of the project). This is dependent upon cost logs having been created (which they should be as part of the daily report generation earlier in the day)
For continuous projects this will only run after the project end, as this is the only time they send back unused compute units
rails db:migrate:with_data must be run and the crontab updated with whenever
Implementation Detail
FundsTransferRequests now have a boolean attribute return_unused, to identify requests to compare against. As although currently funds are only sent back to Hub for this purpose, in the future this may change
If in the future we are sending back compute units for other reasons, we may want to replace this with a formalised set of codes
If we want a more in depth report on what costs are different, we will either need to record the forecast costs for future comparisons, or add a way of simulating what the forecasts were at the time (e.g. make the calculations as if there are no cost logs for the final 3 days)
Merging this into enh/hub-driven-balances as appears to be working as expected, and will simplify management of branches after any further changes to the control <--> hub workflow.
Aims to resolve #53
rails db:migrate:with_data
must be run and the crontab updated withwhenever
Implementation Detail
FundsTransferRequests
now have a boolean attributereturn_unused
, to identify requests to compare against. As although currently funds are only sent back to Hub for this purpose, in the future this may change