Skip to content
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

Add migration diff util for testing and debugging migrations #5499

Merged

Conversation

fxamacker
Copy link
Member

@fxamacker fxamacker commented Mar 4, 2024

Closes #5483

This PR adds two flags to execution-state-extract cmd:

  • --diff to compare Cadence values and log diff results
  • --log-verbose-diff to log entire Cadence values

Migration diff is output as JSON.

Diff is enabled for 3 Cadence value migrators:

  • Cadence1ValueMigrator
  • Cadence1LinkValueMigrator
  • Cadence1CapabilityValueMigrator

The primary use case is for testing and debugging migrations.

This commit adds two flags to execution-state-extract cmd:
* --diff to compare Cadence values and log diff results
* --log-verbose-diff to log entire Cadence values

Migration diff is output as JSON.

The primary use case is for testing and debugging migrations.
@fxamacker fxamacker added Feature Execution Cadence Execution Team labels Mar 4, 2024
@fxamacker fxamacker self-assigned this Mar 4, 2024
@fxamacker
Copy link
Member Author

@turbolent Currently --diff flag is only hooked up with Cadence1ValueMigrator, would you like me to do the same for any other migrators?

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thank you so much for adding this, and so quickly 🙏

cmd/util/ledger/migrations/cadence_value_diff.go Outdated Show resolved Hide resolved
@turbolent
Copy link
Member

👏 👏 👏

@turbolent
Copy link
Member

@fxamacker yes, could you please also add it to NewCadence1LinkValueMigrator and NewCadence1CapabilityValueMigrator?

@turbolent turbolent requested review from a team March 4, 2024 22:19
Copy link
Contributor

@janezpodhostnik janezpodhostnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

cmd/util/ledger/migrations/cadence_values_migration.go Outdated Show resolved Hide resolved
@fxamacker fxamacker merged commit d3c3afe into bastian/improve-migration-2 Mar 5, 2024
@fxamacker fxamacker deleted the fxamacker/add-diff-report-to-migrations branch March 5, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Execution Cadence Execution Team Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants