-
Notifications
You must be signed in to change notification settings - Fork 6
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
3rd party pallet support (e.g. ORML) #14
Comments
In theory yes, it's definitely possible. I can see there is a I see there are branches in the repository with Polkadot SDK versions like |
The Cargo.dev.toml is up to date. i.e. It is the file used for the publishing process. All the crates in ORML have a same version number and all of them get released. |
In this case, I think is totally possible to integrate it. If ORML doesn't exists for an specific version, when trying to upgrade the versions of a project, the tool will just skip the ORML crates (potentially could be possible to add a warning in case a ORML crate is detected). Therefore, for now we could add a --orml flag to the CLI that if used, will fetch the versions from ORML's |
@xlc So are we looking to overwrite our polkadot-sdk crates with the corresponding ORML crates for that version? Or are we trying to fetch the corresponding updated ORML crate version for the polkadot-sdk version we mentioned, given that we are using a few of the ORML crates? |
The problem to solve is that for a chain that's using ORML, they can use psvm to manage polkadot-sdk version but still need to go through some hops to figure out what version of ORML to use. It is not too hard as all crates in ORML are sharing a single version number so there is only one number to deal with but still, that can be improved. |
If for example the command is |
exactly |
I wish to take up on this issue. Can you assign this to me @patriciobcs? |
I have assigned you @0xsouravm |
@xlc Just to finalise the workflow:
NOTE: This is only supposed to work for |
Yeah that will work. It will be great if you can define exactly what is expected by psvm and then I can ensure the ORML release process is compatiable. Not exactly in scope but a nice to have thing is make this generalized so it can support other libraries as well as long as they are following the same release process. |
My current methodology is:
The issue here is reading the If there were some file where the crates' names were mentioned alongside their versions (this would be redundant in case of ORML because every version would be same, but this is a more generic approach if we are planning to include support for other libraries) like a key-value pair for example, I could directly parse that file after STEP-2. And the pre-requisite for this to work is those pallets in ORML should be released in crates.io for that particular version. |
ORML crates are published to crates.io so maybe it is possible to fetch the version mapping from there instead? If it is too slow or too much requests to make, maybe we can have a script that fetches the data, build a json and have it saved somewhere (this repo or ORML) |
I think it might not be possible to fetch the correct version of the crate from crates.io corresponding to the release-branch version that is passed in the command. From the current usage of the crates.io API in the psvm, it simply fetches all the names of the crates that are owned by a particular user(Parity in this case). |
I am not familiar with crates.io and cargo enough so this may not be feasible:
|
I am not really sure if I understood your approach. Or maybe I understood the problem wrong.
The command is: The output is:
This is my understanding: I will update the ORML crates with the correct version if I find them in the release branches in the ORML repository, else I will print a warning that ORML crates are found for which versions are unavailable. |
Yes the expected output is correct. I am just proposing a more generic approach to address deps conflict that will work with any crates and does not require special branch strategy on ORML repo |
Maybe we can work on the generic approach after this PR. I think the commands will run faster if we define a standard for psvm that other libraries should follow if they want their deps to be updated using the command. For now if you can mention in a comment the version of the crates being used in the Something like |
Yeah I can add something in |
I am not entirely sure if parity-publish will work for ORML because I think it takes some credentials in the crates.io API that is for parity alone. Maybe @shawntabrizi can clarify. Else we can have a similar tool for ORML that you can use instead of cargo release I think? But yeah for now I guess just adding something to the |
can you open a PR to ORML to update the Cargo.dev.toml to add it? It is easier you do it to ensure it is exactly what you expecting. |
Sure on it. I will be updating versions v1.1.0 - v1.14.0 |
On second thought I will have to raise 7-8 PRs for every applicable branch. Is it possible to add me as a collaborator or something so I can directly commit in the ORML repo? That many PRs for just 1 line of change each seems like an overkill. |
I pushed the changes but CI/CD in some branches failed. |
the errors are not critical. we don't need to republish the versions anyway |
Can someone please review the above PR? @shawntabrizi @xlc @ggwpez |
I will take a look tomorrow, thanks! |
Sure, thanks! |
Okay i put some comments. I think for usability it would be nicer to have |
Perhaps that will result in conflicts because orml-1.3.0 is compatible with polkasdk-1.3.0 and orml-1.4.0 is compatible with polkasdk-1.4.0 That's why xlc suggested to have the same version and update if the corresponding release version is available in orml repo. |
There exists custom metadata that can be parsed by a TOML parser so that we dont need to rely on comments. Example.
Okay i see. So it tries to find a the same version and errors if it cant find it? Yea then its fine 👍 |
I am updating this PR with the use of the toml parser library. I didn't know we could do that. I will update the OMRL branches with this metadata and use the toml library to fetch it in the code. |
I made the changes:
Can you review @ggwpez ? |
Is it possible to make psvm also supports other pallets like ORML? In that way it can identify the right version of ORML to use.
Happy to do whatever needed on ORML side to make this possible.
The text was updated successfully, but these errors were encountered: