[Umbrella/RFC] Improvements to the scheduler & platforms layer
So I took a closer look at how backend/platforms are implemented, and I have a few ideas on how to improve.
@NunoSempere, let me know if you're ok with all these or if you have other suggestions.
- [x] Separate fetching and storing layers more clearly (see #34)
- [x] CLI with names instead of numbers (current approach seems quite fragile to me)
- [ ] #9
- [x] Unify platforms list on frontend and backend (will require figuring out how to avoid bringing backend platforms code to the frontend bundle, but I think it's doable with lazy loading or some other trick)
- [ ] #35
- [ ] Support incremental updates, as I mentioned in PS in my https://github.com/QURIresearch/metaforecast/issues/30#issuecomment-1081319952 comment
This is a longer term roadmap, and the last two items are a bit more complex, but I believe that they're quite beneficial. Getting closer to the "metaforecast data is never stale" goal would be great.
Most of these sound good, no strong opinions on unifying the platforms list.
One more thing: I'd like to change the platform field values in the DB and other related code (e.g. stars.ts) to the short platform name/id, e.g. "goodjudgment" instead of "Good Judgment", and leave longer titles just for displaying. This is useful for consistency, for type safety, etc.
(from https://github.com/QURIresearch/metaforecast/issues/33#issuecomment-1084570512, but relevant here too)
I also think that stars.ts code maybe should be split and moved into platforms files too. I see the benefit of having it all in a single file, but I don't like the fragility of "if I make a typo in a platform's name then it'll just fallback on 2 stars default without any signal that something went wrong".