-
Notifications
You must be signed in to change notification settings - Fork 14
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
Lineage: First version of IsAppendOnly #123
Conversation
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 realize this is still marked draft, but it does seem increasingly like we need to get some version of it as a prerequisite to other work.
IMO it's fine to merge this even if the comparison algorithm is flawed, so long as we're happy with the IsAppendOnly
function signature.
return res, nil | ||
} | ||
|
||
func Equal(val1 cue.Value, val2 cue.Value) bool { |
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.
Need comment for exported func
@@ -268,3 +279,23 @@ type unaryConvLineage[T Assignee] struct { | |||
func (lin *unaryConvLineage[T]) TypedSchema() TypedSchema[T] { | |||
return lin.tsch | |||
} | |||
|
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.
Need comment for exported func. Probably worth noting in that comment that the comparison algorithm this currently uses is unsophisticated and subject to change
@@ -268,3 +279,23 @@ type unaryConvLineage[T Assignee] struct { | |||
func (lin *unaryConvLineage[T]) TypedSchema() TypedSchema[T] { | |||
return lin.tsch | |||
} | |||
|
|||
func IsAppendOnly(oldLineage Lineage, newLineage Lineage) bool { |
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 think this is the signature we want. Even if we can't convey much in the error message right now, it'll be crucial that a failure here is able to provide line-level feedback on where the problem was.
func IsAppendOnly(oldLineage Lineage, newLineage Lineage) bool { | |
func IsAppendOnly(old, new Lineage) error { |
Closing in favor of #130 |
This is a first basic implementation of
IsAppendOnly(oldLineage, newLineage Lineage)
that does string comparison.Long-term, we probably want a more complex version that is less strict (allow authorized changes).