Skip to content

spp_cel_domain: finish the ADR-017 migration of the not-fresh metric() path and drop the remaining legacy spp.indicator probes #540

Description

@gonzalesedwin1123

Follow-up to PR #535 (#443). That PR made the executor probe the retired spp_indicators evaluation service by capability, so a database with spp_indicator installed no longer crashes on a metric() over a not-fresh cached variable. Its honest net effect on OpenSPP2, where no module provides the legacy service, is that the not-fresh path is permanently inert: it returns an empty match set with a warning and a no_service metrics-info entry, and the values are never refreshed even though spp.data.cache.manager.refresh_variable() (models/data_evaluator.py) is in the same module. Callers that treated valid=False as fail-closed (spp_programs eligibility, compliance manager, entitlement condition, spp_simulation, spp_dci_server_social search) now receive a valid domain matching nobody on those databases — the same degradation every database without spp_indicator already had.

Work:

  1. Replace the two legacy branches in cel_executor.py (_exec_metric ~line 1190 and the aggregate path ~1610) with spp.data.cache.manager.refresh_variable(...) followed by the SQL lookup, per the two # TODO: Fully migrate to spp.data.cache.manager (Phase 4 of ADR-017 complete) comments. Decide the behaviour for a variable with no provider (today's test_metric_lookup_empty_cache_graceful expects 0 ids).
  2. Delete the dead legacy probes: spp.indicator.value (:375), spp.indicator.registry (~1278), spp.indicator.invalidation.buffer (~1114, ~1576), _legacy_metric_service itself once nothing calls it.
  3. Drop the "spp.indicator" not in self.env clause from _check_metrics_available (cel_executor.py:354) and cel_translator.py:127: unreachable today only because spp.data.value is defined by this module, and wrong by name if that ever changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions