-
Notifications
You must be signed in to change notification settings - Fork 544
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
refactor(scaffold): refactor cosmosver
and print the migration guide
#1550
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.
This time it'll not show the warning when scaffolding fails. We need to print the warning before starting to scaffolding.
Maybe we can just use a persistent pre run hook for the starport scaffold
command?
Great, it's done! To put the logic into the |
We don't necessarily need to use the hook, if that doesn't work, we can just call the check func on each cmd handler. I think we should avoid printing anything inside services/ to the stdout as much as possible, I would rather keep it in the cmd. |
I'm always in favor of making things more resilient even if it needs to introduce some limitations feature wise. If we make the cmd fail in case of a version mismatch, we can also recommend people to use an older, but compatible version of Starport and show downgrade instructions alongside the migration instructions. |
I like the idea of showing the downgrade instructions, but we do not know whats version the user needs to downgrade to works. We can show a generic guide, but the user needs to discover whats version is |
Is it still WIP? It's still scaffolding in older chains for me |
It's easier to update the website, so let's add more content there, instead of the message printed to the terminal. |
cosmosver
and print the migration guide
I mean scaffolding commands still run in chains using |
Ohh, sorry, I forgot that. I thought I already pushed the code. You can try now |
ignite#1550) * print migration tests * convert entire folder from localfs * use sub instead create a new embed.FS * fix linter and migration dir * fix cmd * add examples * improve template parse * show a warning if cosmos SDK version is too old * remove html from markdown generation * add version checker every time a user scaffolds something and there is a version mismatch. * avoid read parse parse `go.mod` twice * create newApp method to check the app version * remove `GetVersion` method and `Export` version field * create versioning structure * pass the spinner obj to the newApp method * fix warning msg condition * refactor(pkg/cosmosver): refactor (ignite#1607) * refactor(pkg/cosmosver): refactor * fix * Update starport/pkg/cosmosver/cosmosver.go Co-authored-by: Danilo Pantani <danpantani@gmail.com> Co-authored-by: Danilo Pantani <danpantani@gmail.com> * Update starport/pkg/cosmosver/cosmosver.go * fix ci lint * update warning message * return error for version mismatch and remove 0.43.0 * run gofmt Co-authored-by: İlker G. Öztürk <ilkergoktugozturk@gmail.com>
close #1548
What does this MR does?
Convert the migration guide to HTML to shows the user how to update any version mismatch.
How to test?
Try to scaffold anything into a chain with an SDK version older them
v0.43.0
with any scaffold error. You will see the migration message.If you scaffold something into an old chain without errors or into a new chain with errors, the message does not appear.