Enable changes in traffic allocation during active experiments

Note that some additional work has been done here to fix some issues from !262 (merged), so let's consider this MR has the work that had to be done + an improvement for the other one:

Regarding how everything works from the point of view of the user once the instrument/experiment is already active (where "active" means that the instrument/experiment was already activated at some point, regardless of the user has deactivated it after that, or/and the start date has been reached):

  • Instruments:
    • Increase/decrease sample_rate and adding/removing wikis both are allowed
  • Experiments:
    • Increase traffic is allowed for existing wikis
    • Decrease traffic is not allowed (error message is shown for client/server validation)
    • Adding/removing wikis is not allowed (corresponding buttons are disabled)
  • Both cases:
    • Start date will be blocked and cannot be changed, so validation rules related to this field will be deactivated (start date must be in the future, 24 hours ahead and so on)

Regarding how validation works for client and server side:

  • For client side validation there is a new attribute action to know which kind of action is the user performing (registering or updating)
  • For server side validation, when updating an instrument/experiment, there will be a currentData object in the backend to know whether traffic/wikis are being changed in a way that xLab allows/disallows to do it

Some test cases have been added related to increase/decrease traffic and adding/removing wikis

Bug: T396650

Edited by Santiago Faci

Merge request reports

Loading