Page MenuHomePhabricator

Be more explicit about why a configuration definition may be misformatted
Closed, ResolvedPublic

Description

Currently, fetching from our configuration storage in Meta would be the only way that a misformatted configuration definition may reach the Web2Cit-Core (this may change if T301749 is addressed).

Therefore, the DomainConfiguration's fetchRevision method checks (via the parse method implementations in the respective subclasses) if configuration definitions fetched from Meta are valid (and ignores those that are not). However, it doesn't give any information regarding why a configuration definition may be wrong.

Consider skipping this verification at the fetchRevision method. Instead, we may delegate it to the constructors of the TranslationTemplate, TemplateField, TranslationProcedure, etc classes. This way, we can have a better understanding of why a configuration definition is failing.

If we do this, we have to change the output of the fetchRevision method (and its consumers) from a ConfigurationRevision to a ContentRevision, or declare the type of its configuration property as unknown.

Event Timeline

diegodlh renamed this task from Be more explicit about why a configuration definition may misformatted to Be more explicit about why a configuration definition may be misformatted.Feb 23 2022, 6:26 PM

TranslationTemplate, TemplateField and TranslationProcedure constructors now have an optional strict parameter. If set to false, it tries to skip invalid sub-element definitions (i.e, template fields, translation procedures, and translation steps, respectively), instead of refusing to create the container altogether.

Invalid elements found are logged as warnings.

diegodlh claimed this task.