-
Notifications
You must be signed in to change notification settings - Fork 162
Add NodeBuilder for node instantiation #158
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
Conversation
As a milestone, current NodeBuilder supports only namespace and no node options are supported. This PR also has current implementation change. |
@Soya-Onishi there seems to have been a mixup with the recently merged PRs, could you rebase it cleanly onto master? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I left some initial remarks.
Also, feel free to explicitly request a review on your PRs when they're ready, otherwise it's easy for us to miss them.
For backward compatibility, it is better to retain constructor method but deperecated. As for now, constructors only use NodeBuilder.
Sorry for lack of knowledge about git. Is this form desired commits which @nnmm mentioned? |
That will re-appear when supporting node options
Co-authored-by: Nikolai Morin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality-wise, this looks good to me. I'd only delete the Node::new_with_namespace()
and Context::create_node_with_namespace()
functions.
However, I think we should aim for making the documentation excellent as well.
- The "Naming" section of the
Node::new_with_namespace()
function's docs should probably be moved to theNode
struct - The
NodeBuilder::namespace()
function should reference the naming rules for namespaces, and mention that validation only happens later, in thebuild()
function. - The
NodeBuilder::new()
function should do the same for the node name, since it takes the node name as an argument - Every function should have an example/doctest. The example from
Node::new_with_namespace()
can be reused for these. - Convenience functions should reference the original functions they're equivalent to (in this case, that's only
Context::create_node_builder()
, which I've left a suggestion for)
Co-authored-by: Nikolai Morin <[email protected]>
Co-authored-by: Nikolai Morin <[email protected]>
@Soya-Onishi thank you so much for your contribution! 🙂 |
@Soya-Onishi Seems like there are again some accidental changes from resolving conflicts with master. |
From some searches, I cannot found the way to rebase with clean commit logs, For now, merge is clearner than rebase in this case(conflict appear after creating PR), I think. |
@Soya-Onishi That's fine, the commit log doesn't need to be clean since we usually squash when merging. But if you're interested, I usually simply do "git rebase master" when there are conflicts with master, and if I want to squash things locally, I do "git reset --soft master && git commit" on the branch. |
Also, thanks for fixing the error type in the doctests! |
@Soya-Onishi Would you be okay with me pushing some documentation improvements directly to this branch (no code changes)? That would be easier than commenting here. |
@nnmm Sure, please push your commits. |
@Soya-Onishi Just an update, I didn't manage to do the doc improvements yet, but probably tomorrow. |
@Soya-Onishi Done. From my side, this is now almost good to go. I have three suggestions:
|
@nnmm Should I swap arguments of |
Yes, please. |
@esteve Could you maybe re-review and see if you feel like you can remove the changes requested status? Then I'd do a final review of documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only four small improvements, then this is good to go from my side!
Co-authored-by: Nikolai Morin <[email protected]>
Co-authored-by: Nikolai Morin <[email protected]>
Co-authored-by: Nikolai Morin <[email protected]>
Co-authored-by: Nikolai Morin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
@esteve ptal!
@Soya-Onishi thanks for iterating and addressing our feedback! |
Thanks for your suggestions and cooperation!! |
Close #157
This PR add builder only for replacing current
Node
constructor, and still not implement node options for #142.Current implmentation still remain node constructor.
However, after builder implementation, does normal constructor have demand?
If no, I'll remove constructor, and I also fix some docs and implementations.