-
Notifications
You must be signed in to change notification settings - Fork 72
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
feat: Support storing Component Fork data in SocialDB via Component Metadata #341
Comments
clarifying: the blockheight in the path should be the latest blockheight at which the source component was published (i.e. the version) as opposed to the blockheight at time of fork, correct? |
That's correct @mpeterdev thanks for chiming in. I've updated the description with a very long name to help make that clear. |
I propose to store |
@milenakrawczyk consider this task for next week's sprint. |
Would it make sense for forking (and writing the correct metadata) to be a smart contract operation so that all tools can call the same logic instead of implementing it themselves? |
@mpeterdev it is an interesting idea. However, I am not sure if it would be easier/more useful than to simply write the metadata with the correct path. The smart contract would need to get the source path as an argument. It might fetch the block height of the path and that would be possibly beneficial. The downside would be that there are two distinct operations instead of one: writing the component + writing the metadata with the source path. The tools would need to implement the logic to know whether a component is a fork or not. |
I was suggesting more of a GitHub workflow where the first step is the fork action which takes a component path as an argument and makes a copy of it as-is in your SocialDB widgets space with the appropriate metadata, then you can start editing and saving modifications to the src. This would also lead to some really interesting analytics where you could index SocialDB This could be considered as an improvement down the line if it's overengineering at the moment |
@mpeterdev I see, this sounds very useful. As far as I understand it could be achieved without a smart contract - it suffices to modify the Fork button so that it saves the data before loading the sandbox. The Fork button could be reused by other gateways as well. |
I agree with @milenakrawczyk, modifying "Fork button" to remember the fork metadata and save it when users publish the component makes more sense to me. |
Regarding the bos-cli-rs implementation there are two ways that this could be implemented:
@frol what do you think about these solutions? Forking in general does not go well with bos-cli-rs and this is my main concern. |
Context
Out of all of the MVP Notification types to be supported, Component Forks are the only event type which is not currently written on-chain.
We need to create a pattern of writing component fork events on-chain and integrate this with the near.org UI and tools like bos-cli-rs, such that when a user forks a component and submits the transaction to write the forked component, a payload is included which writes the forked data on-chain.
This can be accomplished by
{"fork_of": "original/component/path@blockheightAtOriginalComponentLastPublished"}
2. Creating an indexer that parses component metadata and persists a schema that supports
@pkudinov's team can help leverage an existing QueryAPI indexer to support
#2
Related Data Platform Issue
The text was updated successfully, but these errors were encountered: