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

Fix error conditions when warnings occur in validation output #94

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

ericglau
Copy link
Member

@ericglau ericglau commented Jan 24, 2025

When running validations via upgrades core CLI:

  • success is indicated by exit code 0 and "SUCCESS"
  • failures are indicated by exit code 1 and "FAILURE"
  • warnings are written to stderr. This is intentional, and allows the warnings to be separate from validation results output (which has extraneous information such as which contracts passed, which we want to ignore if validations succeded)

Previously, if exit code was 1 (validations failed) and there is content in stderr, we would revert with stderr as the reason. This is misleading because stderr only contains the warnings, and not the actual validation results.

Instead, we should log all warnings (from stderr) if the CLI finished with stdout containing "SUCCESS" or "FAILURE", and then report validation results appropriately.

If stdout not have "SUCCESS" or "FAILURE", this indicates a problem with running the CLI itself.

Fixes #83
Fixes OpenZeppelin/openzeppelin-upgrades#1117

@ericglau ericglau merged commit c29dd49 into OpenZeppelin:main Jan 24, 2025
4 checks passed
@ericglau ericglau deleted the printWarningsToOutput branch January 24, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to run OZ upgrade validation Missleading revert message
2 participants