Context:
Currently entity validation for import uses the same validation logic as already present for entities that are created "manually". In the case of Dashboard variable filters, existence of variable name/type combos is validated by checking against the variables present in the datasource of the Dashboard's reports. Since during import, the reports may be imported at the same time they may not yet exist in the system, so there are no data sources for those reports and hence no variables - leading to invalid variable filters. Instead, lets consider separating this validation logic so that during import, existence of reports is sidestepped by directly checking variable name/type existence in the specified datasources without first attempting to look up the reports by ID.
Hint: Most of this logic is contained in DashboardService.validateVariableFiltersExistInReports as currently used by the entity (/dashboard) import service.
AT:
- during import of a dashboard with reports and variable filters, variable filters are validated against existing definitions rather than existing report datasources.