refactor: refactor the package structure and layout#1348
refactor: refactor the package structure and layout#1348wtrocki merged 4 commits intoredhat-developer:developmentfrom
Conversation
f64606f to
b748693
Compare
|
@craicoverflow can you transform that PR to document so we can discuss, ask questions and comment on the package structure? |
|
I will try to ask questions inline: Why would that be outside core? Any special meaning/plans for that packages? Core looks good but it is mixed bag of responsibilities. I see some utils but also command line logic like status.
|
Core is designated for packages without any attachment to one specific section of the SDK or CLI. Things like logging, i18n and config are general purpose which touch every area of the CLI.
This is not the
Other than
What is the utils in core you speak of? What is "logic" this is a vague term..it is all logic?
I'm not sure how you think core os "utils", can you maybe expand on that point. |
|
@wtrocki @rkpattnaik780 changed the base branch to |
Rather than having the utility methods outside, can we have them in |
Could you mock that up in the same way I have done so I can visualise it? I'm trying to understand the multiple "shared" folder concept and what it is for. |
While this wouldn't be a full replacement to |
|
That could make sense. Would the utils which are under cmd/kafka/shared be only intended for the cmd/kafka commands in that case? If yes I think it makes sense. By the way, overly broad package names like "shared" and "util" and "common" are not recommended in Go, Probably "core" is not good either though. |
Yes.
I agree. Maybe we could use prefix for naming the shared folders |
|
@rkpattnaik780 what should we do with this PR? |
|
As agreed lets:
|
449c888 to
39a8791
Compare
57db19b to
123544d
Compare
|
Updated. Currently at 222 files changed. |
| @@ -1,4 +1,4 @@ | |||
| ``# Generating AsciiDoc Docs For Your Own cobra.Command | |||
There was a problem hiding this comment.
Do you mind excluding those changes as well.
There is #1352 that addresses that
| @@ -0,0 +1,278 @@ | |||
| package defaultapi | |||
There was a problem hiding this comment.
Do we know why this appears as new file?
There was a problem hiding this comment.
Because it is a new file. Create package separation between interface and implementation to prevent circular dependency. Maybe there is a better way.
|
@craicoverflow the contents of |
Yes, I can change that tomorrow. |
|
Merging - we can apply other fixes separately - like moving status to separate package or moving cluster commands |
The purpose of this refactor was to make the general layout more consistent and try to group files and packages by their domains as much as possible. This by no means constitutes a final CLI SDK, but I believe it will make it easier to build the SDK when ready, as much of the structure is already logically grouped together.
There are 506 files in this PR, many of those include file renames, generated content etc which are hidden by default so the real figure to review is closer to ~200. And that is mainly package renames.
I have reviewed this and verified a couple of times myself, but needs more eyes.
ℹ️ I have no strong attachment to this PR. If you feel we should wait and do this together with the SDK epic I'm totally fine with that.