Problem/Motivation

The entity type SensorConfig exposes a config property called result_class. Setting it doesn't do anything, since this it not properly wired. This should be fixed, so the code does what is expected.

Steps to reproduce

Try setting result_class to a custom class on a sensor, and notice the class doesn't get used.

Proposed resolution

Amend SensorRunner::getResultObject to read from the SensorConfig before falling back to the default class.

Remaining tasks

Post a MR.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Issue fork monitoring-3608887

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alecsmrekar created an issue. See original summary.

alecsmrekar’s picture

Pipeline failure is caused by a test in MonitoringSearchAPITest, which doesn't seem to be related to the MR here. The new test method testResultClass is green.

alecsmrekar’s picture

Assigned: alecsmrekar » Unassigned
Status: Active » Needs review
berdir’s picture

Status: Needs review » Fixed

Thanks, merging.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • berdir committed 80397561 on 8.x-1.x authored by alecsmrekar
    fix: #3608887 Wire result_class to the sensor runner
    
    By: alecsmrekar
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.