Conversation
| # `str` and `bytes` are also iterable | ||
| if not isinstance(rule_ids, Iterable) or isinstance(rule_ids, (str, bytes)): | ||
| rule_ids = [rule_ids] | ||
| else: | ||
| rule_ids = list(rule_ids) |
There was a problem hiding this comment.
I think this is okish for now, as we sometimes use the rule_ids keyword explicitly and sometimes we omit it. So this makes sure that everything is working without scanning through every usage of SyncRuleValidationResult. Maybe we should revisit using type hints again.
|
Visually the change still looks non-actionable, is there some follow-up planned for this change? |
|
Ah I see, there's now one message instead of two, which is nice. We can address the readability of it separately, I guess? |
Yes exactly. The heading is set within Kibana, that's a separate change. The message can be adjusted. WDYT about |
…te-basic-rule-errors' into tim/deduplicate-semantic-duplicate-basic-rule-errors
I think ids are not very useful - they are not exposed in UI at all. Is it possible to instead specify the rule - e.g. |
| connectors: | ||
| - | ||
| connector_id: "BdDmZYsBMwlGH8qyGO3r" | ||
| service_type: "mongodb" | ||
| api_key: "QjlEbVpZc0JNd2xHSDhxeUx1MVc6aXBubndhc1dScC1lbWVYTndZbWFjZw==" | ||
| elasticsearch: | ||
| host: "http://localhost:9200" | ||
| api_key: "QjlEbVpZc0JNd2xHSDhxeUx1MVc6aXBubndhc1dScC1lbWVYTndZbWFjZw==" |
There was a problem hiding this comment.
I expect you didn't mean to to commit this
| [basic_rule, semantic_duplicate], key=lambda rule: rule.order | ||
| ) | ||
|
|
||
| semantic_duplicate_msg = f"{format(rules_ordered[0], Format.SHORT.value)} is semantically equal to {format(rules_ordered[1], Format.SHORT.value)}." |
There was a problem hiding this comment.
IMO, all we really need to do for this issue is make the to_string better for rules. If we just make
connectors/connectors/filtering/basic_rule.py
Lines 360 to 369 in d806758
return f"{rule_one} is semantically equal to {rule_two}"
|
@timgrein do you still want to pursue these changes? |
|
Bump @timgrein can you either close this or get it cleaned up and ready for re-review? |
|
Can be closed, there's probably a better solution for this issue |
Closes https://github.com/elastic/enterprise-search-team/issues/6062
The
FilterValidationErrorAPI allows for multipleids. I've changed the API ofSyncRuleValidationResultto allow to also reference multiple ids as one result could correlate to multiple sync rules. I've adapted the constructor ofSyncRuleValidationResultthat it can still work with a single value (but now also with a list).This enables the duplication of the semantic duplicate errors messages:
Note: The ids in the box heading require a Kibana change. This change adapts the message inside the box details.
Before (two times the same error just flipped):

After:

Checklists
Pre-Review Checklist
v7.13.2,v7.14.0,v8.0.0)