cli icon indicating copy to clipboard operation
cli copied to clipboard

feat: tool for comparing different ignite versions

Open Ehsan-saradar opened this issue 2 years ago • 3 comments

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

Ehsan-saradar avatar Oct 30 '23 11:10 Ehsan-saradar

@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.

Ehsan-saradar avatar Feb 09 '24 11:02 Ehsan-saradar

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

github-actions[bot] avatar Mar 01 '24 21:03 github-actions[bot]

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.

jeronimoalbi avatar Apr 01 '24 15:04 jeronimoalbi

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.

weird, maybe try to use --repo-cleanup \ instead --repo-cleanup\ if it works

this flag was also removed

Pantani avatar Apr 03 '24 00:04 Pantani