Uploaded image for project: 'Migration Toolkit for Applications'
  1. Migration Toolkit for Applications
  2. MTA-4790

Python rules should error instead of being unmatched if they have an unsupported field

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • MTA 7.3.0
    • MTA 7.3.0
    • MTA CLI, UI
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False
    • None

      Tested python_rule_new.yaml and observed that only the first two rules are being triggered, while the rest are not. 
      As the Python provider only supports rules using

      python.referenced: 
       pattern: ""

      So the location field on these rules is causing the provider to skip or error these rules.
       Error observed: 

      time="2025-03-13T15:07:52Z" level=info msg="Adding Carrier span info to context" worker=7'
          - '> time="2025-03-13T15:07:52Z" level=error msg="failed to get list of dependencies for provider" error="dependency provider path not set" provider=python'
          - '> time="2025-03-13T15:07:52Z" level=info msg="provider does not have dependency capability" provider=builtin'
          - '> time="2025-03-13T15:07:52Z" level=info msg="failed to get dependencies from all given providers"'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="no incidents found" ruleID=python-sample-rule-003 worker=1'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="finished rule" error=null found=0 rule=python-sample-rule-003 worker=1'
          - '> time="2025-03-13T15:07:53Z" level=info msg="rule returned" ruleID=python-sample-rule-003'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule was evaluated, and we did not find a violation" ruleID=python-sample-rule-003'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule response received" failed=0 matched=0 total=6 unmatched=1'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="no incidents found" ruleID=python-sample-rule-006 worker=4'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="finished rule" error=null found=0 rule=python-sample-rule-006 worker=4'
          - '> time="2025-03-13T15:07:53Z" level=info msg="rule returned" ruleID=python-sample-rule-006'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule was evaluated, and we did not find a violation" ruleID=python-sample-rule-006'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule response received" failed=0 matched=0 total=6 unmatched=2'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="finished rule" error=null found=1 rule=python-sample-rule-001 worker=3'
          - '> time="2025-03-13T15:07:53Z" level=info msg="rule returned" ruleID=python-sample-rule-001'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule response received" failed=0 matched=1 total=6 unmatched=2'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="finished rule" error=null found=1 rule=python-sample-rule-002 worker=0'
          - '> time="2025-03-13T15:07:53Z" level=info msg="rule returned" ruleID=python-sample-rule-002'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule response received" failed=0 matched=2 total=6 unmatched=2'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="finished rule" error=null found=1 rule=python-sample-rule-005 worker=7'
          - '> time="2025-03-13T15:07:53Z" level=info msg="rule returned" ruleID=python-sample-rule-005'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule response received" failed=0 matched=3 total=6 unmatched=2'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="no incidents found" ruleID=python-sample-rule-004 worker=2'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="finished rule" error=null found=0 rule=python-sample-rule-004 worker=2'
          - '> time="2025-03-13T15:07:53Z" level=info msg="rule returned" ruleID=python-sample-rule-004'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule was evaluated, and we did not find a violation" ruleID=python-sample-rule-004'
          - '> time="2025-03-13T15:07:53Z" level=unknown msg="rule response received" failed=0 matched=3 total=6 unmatched=3'But the errors observed are 

      Expected Behavior:
      These rules should error instead of being unmatched, as they have an unsupported field in the rule.

              emcmulla@redhat.com Emily McMullan
              rhn-support-kpunwatk Karishma Punwatkar
              Karishma Punwatkar Karishma Punwatkar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: