cli
cli copied to clipboard
feat: tool for comparing different ignite versions
close #3699
Description
This PR implements a tool to scaffold two chains for different versions, compare them, and generate a concise version diff into a document file. This tool automates the comparison process by scaffolding a chain for each version and analyzing the differences to produce an informative report. After creating a new migration doc into the docs/docs/06-migration migration folder with the name of the version (eg: v28.2.0.md)
go run main.go -f v28.0.0 -t v28.2.0
Sample of output (renamed to .TXT only for I can share here):
v28.2.0.md.TXT
CO-AUTHOR: @Pantani
@Pantani I worked a lot on the diff subtraction algorithm but i think it still has room for improvements as it can not subtract chain and module differences from other scaffold types perfectly but since this tool is now independent from the diff.Subtract function we can work on improving subtract algorithm in another PR.
Visit the preview URL for this PR (updated for commit b44ebe5):
https://igntservices-docs--pr3718-feat-auto-migdoc-56lg2jj2.web.app
(expires Wed, 27 Mar 2024 00:36:14 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: 95379efd94dd497aaa37c2d0354e6e2cafca5ec5
Just finished running the following command:
./scripts/gen-mig-diffs \
--output /Users/jeronimoalbi/tmp/migration-output \
--repo-output /Users/jeronimoalbi/tmp/migration-repo \
--repo-cleanup\
--from v0.27.2 \
--to v28.0.0
The idea was to generate a diff between v0.27.2 and v28.0.0 but the command generated the diff between the latest two releases:
Cloned ignite repository to: /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/migration-source
Built ignite cli for v28.2.0 at /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/bin/v28.2.0/ignite
Built ignite cli for v28.3.0 at /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/bin/v28.3.0/ignite
Scaffolded code for v28.2.0 at /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/jfsf/migration/v28.2.0
Scaffolded code for v28.3.0 at /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/vrxj/migration/v28.3.0
Diff calculated successfully
Migration doc generated successfully at /Users/jeronimoalbi/Projects/ignite/cli/docs/docs/06-migration/v28.3.0.md
Another thing I noticed is that the diff for go.mod appears more than once. I'm not sure if it happens with other files.
I'm attaching the output in case it helps.
Just finished running the following command:
./scripts/gen-mig-diffs \ --output /Users/jeronimoalbi/tmp/migration-output \ --repo-output /Users/jeronimoalbi/tmp/migration-repo \ --repo-cleanup\ --from v0.27.2 \ --to v28.0.0The idea was to generate a diff between
v0.27.2andv28.0.0but the command generated the diff between the latest two releases:Cloned ignite repository to: /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/migration-source Built ignite cli for v28.2.0 at /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/bin/v28.2.0/ignite Built ignite cli for v28.3.0 at /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/bin/v28.3.0/ignite Scaffolded code for v28.2.0 at /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/jfsf/migration/v28.2.0 Scaffolded code for v28.3.0 at /var/folders/mz/2tv1_svd3yv48szrgmhqwltr0000gn/T/vrxj/migration/v28.3.0 Diff calculated successfully Migration doc generated successfully at /Users/jeronimoalbi/Projects/ignite/cli/docs/docs/06-migration/v28.3.0.mdAnother thing I noticed is that the diff for
go.modappears more than once. I'm not sure if it happens with other files. I'm attaching the output in case it helps.
weird, maybe try to use --repo-cleanup \ instead --repo-cleanup\ if it works
this flag was also removed