fix(logs): avoid false-positive error level for no-error values (#4538)#4539
Open
brendler wants to merge 1 commit into
Open
fix(logs): avoid false-positive error level for no-error values (#4538)#4539brendler wants to merge 1 commit into
brendler wants to merge 1 commit into
Conversation
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.
What
getLogTypeclassifies log lines purely by keyword/substring matching, with no awareness of the value following a keyword. As a result, successful job-scheduler completion lines such as:get highlighted red as errors, because
error: nonematches theerror:pattern andfailed: falsematches thefailedpattern.Closes #4538.
Changes
error:/err:,failed, andfailurenow only classify as an error when not immediately followed by a no-error value (none|null|false|nil|no|0), via negative lookahead. This is value-specific, not a blanket suppressor — a line likeerror: none, failed: trueis still correctly flagged as an error.NOTICE(no colon) is now treated asinfoso scheduler lines short-circuit before the error branch.notice:(with colon) is left to the warning branch, preserving existing behaviour.Tests
Added
__test__/utils/log-type.test.tscovering the scheduler "finished" line,error: none, the mixederror: none, failed: truecase (proves the exclusion isn't over-broad), genuine errors, and bareNOTICE. All pass.Note
This is a targeted fix for the reported false positives. The underlying heuristic is still substring-based and has produced similar issues before (see closed #3305); a structured log-level parser would be the more robust long-term solution, but is out of scope here.