Skip to content

fix(cli): exit non-zero on issues register logical failures#746

Open
ebios-star wants to merge 1 commit intoentrius:testfrom
ebios-star:fix/register-logical-failures-exit-code
Open

fix(cli): exit non-zero on issues register logical failures#746
ebios-star wants to merge 1 commit intoentrius:testfrom
ebios-star:fix/register-logical-failures-exit-code

Conversation

@ebios-star
Copy link
Copy Markdown
Contributor

Summary

Two logical failure branches in gitt issues register still return with exit code 0, matching the class of bug fixed in #707 for admin/vote/harvest (which did not touch register):

  • Contract metadata missing — printed a red Error: line and returned (exit 0). Now uses print_error for consistency and raise SystemExit(1).
  • Transaction returns is_success=False (e.g., ContractReverted) — printed the failure reasons and the transaction hash, then returned (exit 0). Still prints the hash for debugging, now exits non-zero.

CI/scripting that chains gitt issues register && <next-step> previously treated these failures as successes; after this change they propagate the failure correctly.

Related Issues

N/A — follow-on to #707.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • Added TestCliRegisterLogicalFailures::test_register_exits_non_zero_when_contract_metadata_missing to guard the metadata-missing path.
  • uv run --extra dev pytest tests/ — all 430 tests pass.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

Two logical failure branches in `issues register` previously printed
an error then returned (exit code 0), matching the class of bug fixed
in entrius#707 for admin/vote/harvest. Both now raise SystemExit(1):

- Contract metadata missing: error printed via print_error for
  consistency with the rest of the command.
- Transaction returns is_success=False (ContractReverted, etc.):
  transaction hash still printed for debugging, then exits non-zero.

Add a regression test under TestCliRegisterLogicalFailures.
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Apr 24, 2026
@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented Apr 24, 2026

Fold #747 into this PR — same class of fix in issue_commands/, no reason to review them separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants