refactor: enhance error reporting and complete architectural cleanup#2
Merged
mosishon merged 1 commit intoFeb 3, 2026
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit completes the architectural refactoring of Healthy API with the following enhancements:
Condition.Evaluate:NotificationMetadatato includeFailureCountandThreshold.HealthCheckerandMailNotifierto utilize the expanded metadata.Condition.Validatewhere it was incorrectly iterating overc.Andwhen validating theOrbranch.main.go.