Skip to content

export_targeting_sql validates targeting expressions with untranslatable clauses dropped #17246

Description

@jaredlockhart

When an attribute is untranslatable, jexl_to_sql drops that clause and returns the rest of the expression instead of returning nothing:

https://github.com/mozilla/experimenter/blob/main/experimenter/experimenter/experiments/jexl*to*sql.py#L337-L347

export_targeting_sql only skips a config when result.sql is None, and ignores result.warnings. So a partially translated expression gets exported and dry-run validated as if it were complete.

For example android_existing_users_not_accepted_terms_of_use is user_accepted_tou == false && days_since_install >= 28, but user_accepted_tou has no column yet (EXP-7326), so what actually gets validated is just daysSinceInstall >= 28. That passes, and the CI output reads as a full pass.

This currently affects 5 of the 18 exported Fenix configs and 4 of the 16 exported iOS configs. Two of the Fenix ones mix && and ||, so dropping a clause changes the shape of the expression rather than just narrowing it.

The dry run can only check syntax and types, so it will never catch this. The fix is to make the skipping visible.

Acceptance criteria:

  • export_targeting_sql either skips configs that produced warnings, or records the warnings in its JSON output
  • validate_targeting_sql.py prints how many configs were skipped and which attributes caused it, so the pass count is not mistaken for full coverage

┆Issue is synchronized with this Jira Task

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

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions