Page MenuHomePhabricator

Consider combining templates.json and tests.json into a single paths.json configuration file
Open, Needs TriagePublic

Description

We now have three separate configuration files possible per domain: templates.json, tests.json and patterns.json. This separation was meant to minimize edit conflicts and to enable finer-grained protection in case of vandalism. It also allows to more easily identify contributors focusing on either templates or tests.

With Web2Cit-Editor, all configuration parts would have been seamlessly integrated into one single configuration interface. However, this hasn't been implemented. Instead, the Web2Cit-JSON-Editor reinforces this separation, offering a separate form for each configuration file.

As a result, it is often the case that a translation template is defined without a corresponding translation test, or without even indicating a specific path at all. This hinders collaborative maintenance of these configuration files. See for example here.

One possible solution to encourage a specific path be set for a template is to remove the "/" suggestion from the form (T337131). However, this wouldn't prevent editors from skipping translation tests for that path.

Additionally, the Web2Cit-Server's summary page may be adapted by (1) switching the order of the columns (translation goal first, translation output second), and (2) warning the user if they click on edit output when an expectation is not available.

However, the best possible solution may be to join the templates.json and tests.json files into a single paths.json file. This way, the user would be forced to first set a path, then add a field, set an expected output and only then define a translation procedure (if wanted).

If this change is applied, we will have to run a script that automatically converts templates.json and tests.json files into paths.json. Maybe consider merging one into the other to preserve edit history as much as possible.

Documentation should be updated accordingly as well.

Event Timeline

Also note what would happen if a path and field, for which a procedure has been defined but no goal has been set, is opened by the Web2Cit-JSON-Editor form? Will it fail? Will it prevent users from saving until the error has been fixed?