Repository navigation
fix(view): log a refused search at WARNING; correct metric_trend's docstring (6.2.29) - #574
Merged
Merged
Conversation
…'s docstring exec_report_spec logged every ValueError at ERROR. A refusal (AllowlistRefusal, AnalyticFunctionRefused, RoleRefused, CannotRunYet, MicroflowError) is an expected outcome, so it now logs at WARNING; any other ValueError still logs at ERROR. Both are still raised. Tests cover each refusal type and a plain ValueError. metric_trend's docstring said a dotted metric_path still works but is deprecated; it has been refused since 6.2.19. It now says only registered names are accepted. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…WARNING find_elements_by_property_value and find_metadata_elements_with_string refuse '*' with no type (or, for the former, a root type) as a plain ValueError, so exec_report_spec logged them at ERROR. They now raise SearchRefused, a ValueError subclass in pyegeria.core.request_filters, which _is_spec_refusal recognises: they log at WARNING and except ValueError still catches them. Tests: SearchRefused in the refusal cases, an end-to-end Element-DrE-Basic '*' run through exec_report_spec (WARNING, still a ValueError, no request sent), and the existing refusal tests now expect SearchRefused. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…aises SearchRefused The WARNING branch wraps only the find call, so the release note now says a refusal that reaches exec_report_spec's failure log (today the '*' search refusals, SearchRefused) logs at WARNING, and that the analytic and role refusals are raised before that log. The executor test stub for the '*' refusal raises SearchRefused, as the real find methods do. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.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.
Summary
Two small fixes for 6.2.29, from the release queue.
exec_report_spec's failure log now logs an expected refusal at WARNING; any otherValueErrorstill logs at ERROR. Both are still raised. The '*' search refusals (find_elements_by_property_valuewith no type or a root type,find_metadata_elements_with_stringwith no type) now raise a newSearchRefused, aValueErrorsubclass inpyegeria/core/request_filters.py, so existingexcept ValueErrorcallers are unaffected. The analytic and role refusals are raised before that log, so they are unchanged.metric_trenddocstring corrected. It said a dottedmetric_path"still works but is deprecated"; it has been refused since 6.2.19 (AnalyticFunctionRefused).Release note:
docs/release-notes/6.2.29.md("Fixed").Test plan
tests/micro-tests/test_report_spec_refusal_log_level.py: refusals log at WARNING, a plainValueErrorat ERROR,SearchRefusedis aValueError, and an end-to-end '*' report spec raisesSearchRefused, logs one WARNING and sends no request.ValueError(searched pyegeria, the Portal handlers and the trellis packages); the only visible change is the class name in a few error messages.🤖 Generated with Claude Code