-
Notifications
You must be signed in to change notification settings - Fork 932
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
CHASM: include library name in fully qualified component/task type name #7545
Conversation
802d6a7
to
5ca9dff
Compare
chasm/library.go
Outdated
Namer interface { | ||
Name() string | ||
} |
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 we merge this interface back to Library? I think developer will be quite confused why it has a separate definition, but only used by Library.
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.
Agree.
chasm/registrable_component.go
Outdated
// Type returns the fully qualified name of the component, which is a combination of | ||
// the library name and the component type. This is used to uniquely identify | ||
// the component in the registry. | ||
func (rc RegistrableComponent) Type() string { | ||
return rc.componentType | ||
if rc.library == nil { | ||
// this should never happen because the component is only accessible from the library. | ||
panic("component is not registered to a library") | ||
} | ||
return fullyQualifiedName(rc.library.Name(), rc.componentType) |
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.
let's make this method private for now. I don't think component developers needs to get the fully qualified name.
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.
Yes, great idea.
What changed?
CHASM: include library name in fully qualified component/task type name.
Why?
Type of
RegistrableComponent
is stored insideChasmNode.Metadata
and required to look up go type for proper deserialization. Therefore returned value must be fully qualified type name, not just type name.How did you test it?
Modified existing unit tests.
Potential risks
No risks.
Documentation
No.
Is hotfix candidate?
No.