Skip to content

Control expression query evaluator

Harsimar Sandhu requested to merge 507239-requirements-query-evaluator into master

What does this MR do and why?

Control expression query evaluator

This commit adds a query evaluator to parse and evaluate control expression

EE: true Changelog: added

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Open rails console and enter:
::ComplianceManagement::ComplianceRequirements::ControlExpressionEvaluator.new("{\"operator\":\"=\",\"field\":\"project_name\",\"value\":\"name\"}", Project.last).execute
  1. Should return true if input name matches project's name, otherwise returns false
  2. You can also check trying checking different fields and values

Related to #507239

Edited by Harsimar Sandhu

Merge request reports

Loading