Conversation
3f4cd10 to
32127d9
Compare
|
Good luck with this one, @astorije… ;) Feel free to assign it to me when you're ready. |
d3ab455 to
5e09d0b
Compare
1abba64 to
4443d48
Compare
4443d48 to
7d83e96
Compare
|
Cancelling Travis CI as style checker won't pass... |
f9495f5 to
41bdec8
Compare
…istory and error report at the moment)
dd955fd to
986283d
Compare
|
Pfiou, I just sucessfully rebased my 41 commits, that was something :-) @tripu, I think I am more or less done here! If the answer to the previous question is no, then you can start reviewing. Meanwhile, I will provide tests now that this architecture offers it \o/ And by the time this PR is fully reviewed, hopefully it's gonna be fully tested too! I have put a lot of love in this, I hope you'll like it :-) |
|
@astorije, this LGTM! I see this build failed, but only because code coverage dropped a little bit. No big deal now. I think you are right in that the only “output” here was done through the module I've tried to follow your commits and the diff, but yeah, it's difficult :¬/ For what I can see, the core logic and the flow of steps and checks is preserved (and obviously tests pass), so I won't try to dig very deep. About tests: I'd say we merge this right now, as is; and work on tests in a separate PR. I fear that if you, @plehegar or I tackle tests for this in this same branch and without merging to master first, the snowball is going to keep of growing. I predict new rebases and an even messier diff to review… Maybe I didn't understand you, and that is what you were suggesting anyway? Please merge yourself (or grab @deniak if you want a third opinion; but I say go). Good job :¬) |
98% is still a decent number :P
Okay, I have some ideas to improve this then :-)
Yes.
Indeed, I essentially just made things modular and scalable. My worry was that I might have lost some existing behavior, mostly persistence and side-effects (since most of what's added in
Well, I would never suggest merging without tests or biking without a helmet :D
Here is my proposal: I'll merge only tomorrow. If @deniak, @darobin, @tabatkins (thanks for your input!) or @dontcallmedom has a free eye to spare on this (partially, even) by then, that's cool. Otherwise, no worries.
Thanks :-) |
There was a problem hiding this comment.
this is brittle (strings redefined across modules); I would make it a "static" property of RequestState. (i.e. add RequestState.started = "started", etc in lib/request-state.js)
There was a problem hiding this comment.
Yep, I am planning to consolidate this very soon. Thanks!
|
I haven't looked very closely, but it looks like good stuff and I'm all for fast-merging of refactors that pass their tests. Otherwise things get really painful. |
|
Huge thanks to @dontcallmedom for reviewing this. Everything you highlighted is very valid and I'll make sure to go through all of them, whether it's prior to or after merging. @tripu, most comments will be addressed after merging I think, but there are a couple of things I'd like to change before merging, so definitely let me merge if you don't mind (or wait to merge yourself) :-) |
|
@darobin thanks again for the input. Although I can entirely break Echidna and pass the tests with my changes, you know :-) I'll process comments of both of you tomorrow, fixing right away what I can fix and opening issues/preparing PRs for the rest. I am very glad overall that you all like it! Thanks ❤️ |
|
Actually, after re-reading all comments, I am going to merge this now, open issues to document what was said and send PRs for these (sooner or later depending on the issue). |
|
OK to remove the branch? |
One of the ideas here is that
app.jsshould get as little intelligence as possible.The result is an
Orchestratorthat controls the process of publication. This class manipulates a frozen (immutable) state,RequestState. Basically, everything theOrchestratordoes is manipulate a state that is given as an argument of the computation so that the outer state is never modified as a side effect. That way, we avoid unexpected changes.To help with this and abstracting, the code makes use of higher-order functions (functions given as arguments or returned by other functions). This separates concerns because the code for a function makes little assumption on what an argument is supposed to do in addition to its type (for example, if as an argument I give a function
f: Int => Promise.<Int>, I don't really care whatfis doing, I only care about what I feed it with and what I get in return). I'll keep improving the code to that extent to favor maintainability.In the end, the main entry point is a recursive function that recurses on a function producing a promise until a predicate is reached. This will probably be hidden under the hood in a near future, but at least in the present state it allows us to do something (whatever it is, since it's an higher-order function) every time the request state is changed (that is, every time a step in the process makes it change). At the time of writing this, I am just displaying the new state on the console, but it is also a good place to consider persistence support.