Description
Pending discussion with @Sarai-WMF, we should probably have better inline validation for all the forms. This task is also about applying specific validation rules (see ACs below). There is no way for now to automatically disable an experiment and we are considering a way to remove non-active ones (based on status + dates) from the xLab API responses (we also could do that in the Experiment Manager though). That could be enough for now.
Acceptance Criteria
- (Partially done, see details below) Some inline validation errors are triggered on the client side to support users' input (Find validation specifications per field on this spreadsheet)
- Traffic per wiki validation rules are pending and they will be addressed in T396059: xLab: update validation for traffic per wiki for Experiments
- (Partially done, see details below) On form submit, inline validation errors are triggered (See spreadsheet for more details)
- Traffic per wiki validation rules are pending and they will be addressed in T396059: xLab: update validation for traffic per wiki for Experiments
- The validation rule to check existing instruments/experiments with the same name will be addressed in T396151: xLab: Add a validation rule to check whether a name/slug is already used by an existing instrument/experiment
- Slug validation: Slug is unique and matches Varnish name validation (^[A-Za-z0-9][-_.A-Za-z0-9]{7,62}$). We could even not consider hyphens and dots as valid characters to simplify the way we generate the machine-readable name (slug) and the final value would still match Varnish validation. To do that we could transform spaces into underscores and do nothing with the rest of the special characters. In principle the same rule validation would apply for instruments (both instruments and experiments share this part of the form).
- Group name validation: in the case of the machine readable name, we will need to apply the same rule we are applying for machine-readable names for experiments. Varnish uses same validation for both fields: experiment and groups names (^[A-Za-z0-9][-_.A-Za-z0-9]{0,62}$)
- Unique and valid experiment names and some others validation rules to be aligned with enrollment authorities (Varnish + MW) (See spreadsheet for more details)
- (nice to have): have a way to trigger all validation to easily test validation and message copy
Required
- Unit/Integration tests (unit and integrations tests have been update accordingly)
- Passed QA













