Skip to content
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

Merged
merged 4 commits into from
Apr 1, 2025

Conversation

alexshtin
Copy link
Member

@alexshtin alexshtin commented Mar 31, 2025

What changed?

CHASM: include library name in fully qualified component/task type name.

Why?

Type of RegistrableComponent is stored inside ChasmNode.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.

@alexshtin alexshtin requested a review from a team as a code owner March 31, 2025 22:48
@alexshtin alexshtin requested a review from yycptt March 31, 2025 22:49
@alexshtin alexshtin force-pushed the feature/chasm-rc-type branch from 802d6a7 to 5ca9dff Compare March 31, 2025 23:49
chasm/library.go Outdated
Comment on lines 41 to 43
Namer interface {
Name() string
}
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree.

Comment on lines 81 to 89
// 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)
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, great idea.

@alexshtin alexshtin requested a review from yycptt April 1, 2025 01:12
@alexshtin alexshtin enabled auto-merge (squash) April 1, 2025 01:20
@alexshtin alexshtin merged commit ed1dffd into main Apr 1, 2025
50 checks passed
@alexshtin alexshtin deleted the feature/chasm-rc-type branch April 1, 2025 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants