Skip to content

refactor: enhance error reporting and complete architectural cleanup#2

Merged
mosishon merged 1 commit into
mainfrom
refactor-notification-and-architecture-8713588421718732842
Feb 3, 2026
Merged

refactor: enhance error reporting and complete architectural cleanup#2
mosishon merged 1 commit into
mainfrom
refactor-notification-and-architecture-8713588421718732842

Conversation

@mosishon
Copy link
Copy Markdown
Owner

@mosishon mosishon commented Feb 3, 2026

This commit completes the architectural refactoring of Healthy API with the following enhancements:

  • Implemented detailed, recursive error reporting in Condition.Evaluate:
    • AND conditions now report the specific index and reason of the failing sub-condition.
    • OR conditions now aggregate reasons from all failing sub-conditions.
    • NOT conditions now clearly state when a forbidden condition matched.
  • Updated NotificationMetadata to include FailureCount and Threshold.
  • Updated HealthChecker and MailNotifier to utilize the expanded metadata.
  • Fixed a bug in Condition.Validate where it was incorrectly iterating over c.And when validating the Or branch.
  • Added comprehensive unit tests for the new descriptive reasoning logic and corrected condition validation.
  • Ensured proper resource cleanup (log file closure) in main.go.

This commit completes the architectural refactoring of Healthy API with
the following enhancements:

- Implemented detailed, recursive error reporting in `Condition.Evaluate`:
  - AND conditions now report the specific index and reason of the failing
    sub-condition.
  - OR conditions now aggregate reasons from all failing sub-conditions.
  - NOT conditions now clearly state when a forbidden condition matched.
- Updated `NotificationMetadata` to include `FailureCount` and `Threshold`.
- Updated `HealthChecker` and `MailNotifier` to utilize the expanded metadata.
- Fixed a bug in `Condition.Validate` where it was incorrectly iterating
  over `c.And` when validating the `Or` branch.
- Added comprehensive unit tests for the new descriptive reasoning logic
  and corrected condition validation.
- Ensured proper resource cleanup (log file closure) in `main.go`.

Co-authored-by: mosishon <61285975+mosishon@users.noreply.github.com>
@mosishon mosishon merged commit 846b676 into main Feb 3, 2026
2 checks passed
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.

1 participant