-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Epic] Restructure nearcore project #1881
Comments
This is really great that someone is looking into this and raising these concerns, I really liked the comments. pytest are not just stress tests they are very similar to So I suggest we do the following renaming:
WDYT? |
The suggested renaming sounds reasonable to me. I will apply the suggestion (update my post) tomorrow. |
also note that nightly heavily relies on the relative paths, so if we change the dirs, nightly needs to be changed accordingly. |
Let's jut put in into |
Assigning it to @frol so that we have only one assignee as per guidelines. |
The first steps in this direction are #2511 and #2520. @SkidanovAlex @nearmax @ilblackdragon Do you have any objections against project refactoring? The code is not going to change, it should be just more clear folder naming towards better navigation around the project. I want to make the following steps (separate PR iterations):
My motivation mentioned in the issue description only grows with the time I spend with nearcore. I don't want to have lengthy conversations about this, but it hurts my productivity. It is somewhat related to #2433. |
I agree, this is the kinda of stuff that slows down everyone and makes our code less appealing to external contributors. We discussed with @fckt that having a folder named "libraries" is kinda weird, given most of our crates are libraries, but on the second looks it looks ok. |
I'd suggest the following adjustment. We can have a
|
@fckt Given the project is nearcore, it implies that everything in the repository is related to near. Thus, "near" as a folder name does not introduce any clarity (the same way I don't really like |
The idea is to associate crates which are the core components (direct dependencies) of neard process and their dependencies.
Right, but not all of crates are the direct dependencies of the The following crates make up the system and these can be naturally form a list of the core components (approximated):
However, don't really think that this list as an accurate and complete. For example, its questionable if |
Let me list all the crates we have:
Let's extract tools:
Let's move
Everyone is welcome to suggest a clear separation of the packages. Currently, we have:
I find this separation quite reasonable, but it is hard to find a place for things like |
Where does the neard go under this separation @frol ? Also I think we can merge utils and test-utils (those that are not test utils in utils should probably go to tools). |
what is difference between util and tool?
…On Wed, Apr 29, 2020 at 4:56 PM Bowen Wang ***@***.***> wrote:
Where does the neard go under this separation @frol
<https://github.com/frol> ? Also I think we can merge utils and
test-utils (those that are not test utils in utils should probably go to
tools).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1881 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADFFFCD2TWHOBH4WXHS2PQLRPC5CRANCNFSM4J5FE2PQ>
.
|
I propose keeping neard in the root folder since it is the main entry point to the project. "utils" was just recently introduced (#2511) and it has the only crate (near-actix-utils), and I can see we either extract it to a standalone helper (separate package and repo) or merge into neard-lib (extract I think we can get rid of both "utils" and "test-utils" (just move the relevant crates to "common" and "tools").
I view them as follows: a tool is something that you use as a standalone piece (i.e. executable), while util is anything that is useful (e.g. a library, a file, a script, and even an executable). |
As a general methodology, I think if we want to define a category it should be valuable and not tautological. In other words the definition should add a value, be unique and be not ambiguous.
|
The "utils" to me is a common code which exists because you don't want to repeat it (and this is a dominating characteristic of it). But in the same time, it's a small enough and don't deserve to evolve into a separate library (yet). In the same time, that code should be not exclusively specific to the project (e.g. it must not use custom types, defined in the project). For the exclusive common code and types of the components, Essential logic which covers dedicated pieces of the project spec (and at the same time are not useful separately (excluding artificial purposes like testing)), better to be colocated together. \ |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
Yes, I believe there's still room for improvement for project structure, and that this is non-urgent, but important. @miraclx recently make great progress here as well! Let's keep this open. |
One suggestion I have is to flatten out the directory layout and keep all rust crates in the one-level deep See https://matklad.github.io/2021/08/22/large-rust-workspaces.html for an extended motivation. (0.8 confidence the end state will be much better, 0.95 confidence that its a big and a somewhat painful change, 0.7 confidence that we should actually do that) |
My developer experience with nearcore is not great, so I contemplated the improvements that can be made.
The very first thing that is missing for me is a clear project structure. I believe that the best code is no code and the same goes for documentation (this is why I don't want to introduce documentation of the project structure, but rather prefer having an obvious project structure that does not require a lot of time to understand and makes it easy to navigate without a need to memorize all the components).
I don't have enough experience with the existing infrastructure, but here is my first take on it.
The root folder:
It is still crowded with various config files, but at least the folders have a clear structure. Just for the reference, here is the current project structure:
So, I suggest collapsing those 13 folders into 3 top-level ones:
The exact naming is yet to be discussed.
The crates structure and naming also needs some love.
The text was updated successfully, but these errors were encountered: