Closed esakal closed 6 years ago
@eshaham a spoiler alert, this is going to be a bit long comment, I tried to cover everything. I will work on the inline comments soon.
I must say I can’t wait to be able to start using what you implemented here 👍
Thanks! it feels very powerful to scrape all the accounts at the same time.
- The underscore notation of private fields makes me tick… 😄 . I would rather see functions extracted outside of the class if they are not to be shared publicly. At some point I gave up and stopped adding comments about it, but I would love to see it changed.
When I created the PR I was really hoping that you and I are on the same side of this debate :) I don't understand how private properties/methods were left out of the specification. It is be very hard for me to remove the _
prefix, mostly because not having a way to let other developers distinguish between private and public api is like not having an api at all. I can live with moving private functions from the class even if it breaks the class isolation/encapsulation and makes the code less readable, but not having private properties is... well... But I respect your thought and opinion and will make the relevant adjustments to ditch the _
prefix.
This was a massive PR, and I really had a hard time reviewing all of it at once. I would prefer seeing smaller incremental PRs, but anyway… Given this comment, I never tend to re-review PRs, but in this case I reserve the right to review again 😄
We are on the same page, having smaller incremental PRs are easier to follow. This is the reason I created #29 and #30 to begin with. But I don't think there is an intuitive way to split the rest of the code. This PR deals with managing & scraping tasks and splitting those two tasks is irrelevant. As a side note, I would like to recommend an awesome reviewing tool that I integrated into my company development process which was essential to the success of our project and is called reviewable.io. it is marked as beta but I think it is like that just because they forgot to remove the label. I love this tool and I think it has everything you dream for in reviewing service. Obviously you don't need to use it with the project unless you want to give it a try, but I owe it to the developers of this service to talk about it whenever I can.
Would be great to see some reflection of this in the README file
Sure, will do
@esakal you might want to close this issue using one of the relevant keywords in the PR description.
Done
Thanks so much for all the effort you put into this!
It is the minimum I can do, I really appreciate your work on those libraries and your contribution to the open banking concept in Israel.
As a side note, I would like to recommend an awesome reviewing tool that I integrated into my company development process which was essential to the success of our project and is called reviewable.io
Could you TL;DR about what's so great about reviewable.io? Took a peek at their website, but their explanation isn't that clear. I'm not sure what I would gain from their tool, which doesn't already exist on GitHub.
Could you TL;DR about what's so great about reviewable.io?
I think the following article layout nicely the reasons why reviewable.io transcends github reviewing support. I think it sums up to whether you believe that code reviews are essential part of the development process, if you do then once you will start using it you will not look back.
@eshaham I pushed some improvements/fixes to this pr:
generate-report.js
file as you recommended.I know this PR is already big so I try to to a few adjustments as possible. Hopefully you are experimenting reviewable.io with this branch and if this is the case so it should be much simpler to follow the adjustments.
Have a great weekend
@eshaham if you still find it difficult to review, I can split this one into two separated branches/prs:
There are some complications with this separation:
I know it is hard to follow big reviews when using github PR dashboard so if you think it worth the effort we can do it and tackle the complications as we go.
Please lmk if you want to continue with the PR or with the suggested alternative
@esakal let's keep this PR, as we've already made some progress with it. I've looked at reviewable.io, but didn't like the fact that mixing reviews in GH and reviewable will cause line comments to become top level comments, see here. I think I will stick to GH for now. Will go over your comments and changes and provide feedback soon.
thanks, I will wait for your feedback. Regarding reviewable.io, I also almost ruled out reviewable. But since my work project rely heavily on reviews we learned over time that once you start working with reviewable you don't feel the need to use github dashboard anymore. This is my personal experience but I understand your concerns about the comments becoming top level comments instead of inline comments.
@eshaham I handled all the comments we currently have in this PR.
tasks-manager.js
into tasks.js
and separated the summary creation from the task manager. I also exported the class instead of a singleton.Night!
@esakal I don't believe in squashing commits, I like to see the evolution of the PR in the commit list.
Overview
Motivation
This PR was created following #28.
A task structure
A task defines a set of scrapers and relevant scraping options. A user can define multiple tasks that serve different budgets (for example separated work and home budget).
An example for a real task can be:
Setup a task
A user can manage tasks using the existing setup command
npm run setup
. I was working on the setup process to be as friendly as possible.You can see the task setup menu structure here.
Changes in the repository
New dependencies
Linting adjustments
Splitting individual scrape code
A task is basically a group of individual scrapers with predefined scraping options. So basically we want to run the individual scraper multiple times when executing a task. To keep DRY principle I needed to split the original scrape-individual.js file into two files. The first file handles the actual scraping and is used both by the individual scraper and the task scraper. The second file is the entry point when the user wants to scrape individual scraper and is used to get the relevant parameters from the user.
Extracting the report generation
A task scraper support two types of output, a single report that combine all the scrapped accounts together and for backward compatible it also allow creating multiple reports, one per each account. For the same reason as explained above to keep the DRY principle I extracted the report generation into a separated file.
That's it, all the remaining files are there mostly to setup and scrape a task.
@eshaham Please review. Thanks!
Closes #28
This change is