Separate types/features/acid-state/backups across all features#1492
Separate types/features/acid-state/backups across all features#1492isovector wants to merge 32 commits intohaskell:masterfrom
Conversation
4874521 to
d874999
Compare
9b52ee5 to
e990392
Compare
|
I see this has gotten force pushed a bunch. Is it ready for review or merge yet? Or do you want us to wait? |
|
@ysangkok Sorry for the churn. I noticed some minor cleanup issues and was force pushing because of that. But the PR is ready for review! |
|
Looks like the tests are not compiling... |
|
@ysangkok fixed, sorry! I'm continually caught off guard that |
|
@isovector When starting a Hackage-Server with an older database from before this PR, I get an error about |
|
@ysangkok ugh, good catch. Digging in, it turns out that Egregious state of affairs. By my reckoning, there are two solutions here:
It might be tempting to consider 3. don't move this code, but that seems like a non-starter to me; once Of these bad solutions, (2) seems less bad to me. It's less terrible than it sounds, since the inlined splices haven't had any changes in:
I've added a new module |
|
I think this is a reasonable solution, as long as we're confident we're on a path to moving away from this stuff altogether. The comments and documentation also suffice so that if we need to pull back we can do an effective revert of these four modules too. But I also think "don't move the code" could be the best path. I mean the code will be somewhere until it isn't, and having it in an unexpected module isn't the end of the world. And when we want to get rid of it, we can still do so, no matter where it was. So unless there's a stronger reason I'm missing, I'd urge at least a reconsideration of or further discussion of "3". |
|
As I understand it, even with "3", the bulk of the PR is the same, no? It only means that we don't have code motion for four specific instances... |
|
I don't have a particularly strong opinion here; happy to split out the acid movement into its own branch and shelve it for the time being if you'd prefer! |
|
I like option 2 (this current version of the PR) since I think it means that each PR will be smaller? It's gonna be a pain to review the next one if it effectively includes this PR... |
|
If both of you prefer option 2, fine by me
|
|
My plan of attack here is a PR where each commit renames one state module and implements equivalent database logic in its place---even if it's non idiomatic db code. Should be straightforward (if tedious) to review. We can follow up with some patches to improve the idioms. |
Overview
As part of #1486, for each feature
Xthis PR clearly separates:Features.Xfor the core HackageFeaturesFeatures.X.Typesfor any domain-specific types that should persist after ripping outacid-stateFeatures.X.Statefor anyacid-statecode (which will eventually be removed as part of Migrating away from acid-state #1486)1Features.X.Backupfor any CSV backup/restore codeThese conventions area already used haphazardly across the codebase; this PR applies them across the board.
In addition, this PR also imports the
Features.X.Statequalified asAcid, making it clear to all downstream callers where precisely theacid-stateis occurring.Note to Reviewers
This is chopped out of a long-running branch I'm working on to remove acid-state. It's the first chunk of PR-appropriate work, but I'm happy to split it into smaller PRs if you'd like. Furthermore, the
qualified as Acidimports are very helpful on my end, but might not be worth upstreaming. If you have concerns about that, I'm happy to remove those from this PR.Footnotes
For the new modules that got this code split out, I used
Features.X.Acidinstead ofFeatures.X.State. Happy to make this consistent if it's a concern during review. The reason to not simply use*.Stateis that I noticedReverseDeps.Stateis a counterexample to the state modules being foracid-state. ↩