-
Notifications
You must be signed in to change notification settings - Fork 0
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
move datanode to internal/node #82
Conversation
Clues has grown organically into a split between the api that places data in the right spot (clues) and the structure which contains the data (nodes). As we move more behavior into subpackages, and as we look forward to future subpackage additions, it makes the most sense to move the node systems into an internal package so that they can be generically utilized across all clues subpackages without issues like import cycles. This movement is 80% copy/paste, 19% renaming and reorganization, and 1% interface/import adaptation. No logical changes were intended. copy/paste: datanode.go has moved into /internal/node/node.go. otel.go has moved into /internal/node/otel.go. reorganization: datanode.go has been broken into multiple files. Discrete concerns (comments, agents, otel) all exist as various files within /node. Generic and basic functionality stays in /node/node.go. adaptation: OTELConfig now has a user-facing config builder in /clues/otel.go, while the core otel config struct still lives in /internal/node/otel.go.
aa1f138
to
869138e
Compare
clues.go
Outdated
// --------------------------------------------------------------------------- | ||
|
||
// In retrieves the clues structured data from the context. | ||
// TODO: turn return an interface instead of a node, have nodes |
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.
// TODO: turn return an interface instead of a node, have nodes | |
// TODO: return an interface instead of a node, have nodes |
} | ||
|
||
// AddComment creates a new nodewith a comment but no other properties. | ||
func (dn *Node) AddComment( |
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.
I see that TestAddComment
exists but in clues_test.go
. Could you move it to comments_test.go
file in a future PR?
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.
can do!
Split the clues interface between context management and error handling by moving all error functionality to a new subpackage: /clerr. This change is 80% copy/paste, and 20% renaming/reorganization. No logical changes are intended. * `copy/paste`: all error stuffs have been moved to /clerr. Since error tests and clues tests shared a common test framework, that framework has moved to /internal/tester to be available for both. * 'reorganization': the err.go file has been split into a couple files, primarily cluerr.go (the public interface) and err.go (the backing struct). Extensions like comments and labels have moved into their own file.
Clues has grown organically into a split between the api that places data in the right spot (clues) and the structure which contains the data (nodes). As we move more behavior into subpackages, and as we look forward to future subpackage additions, it makes the most sense to move the node systems into an internal package so that they can be generically utilized across all clues subpackages without issues like import cycles.
This movement is 80% copy/paste, 19% renaming and reorganization, and 1% interface/import adaptation. No logical changes were intended.