guardian / typerighter

Even if you’re the right typer, couldn’t hurt to use Typerighter!
Apache License 2.0
276 stars 12 forks source link

Only display the total rules per category in the Checker rules page, not all the rules #418

Closed rhystmills closed 1 year ago

rhystmills commented 1 year ago

With the 250,000+ dictionary rules, serialising all the rules to HTML uses all the available memory when we load the /rules page in the Checker service. The Rule Manager shows us all rules already, and we don't want to solve this problem in both apps.

Instead, only show the total rules per category in the Checker. This should give us confidence that the correct number of rules are published for each category (e.g. subcategories of style guide rules, language tool rules, dictionary rule).

image

In the future it may be a good idea to include some kind of artefact id in the Checker, in order to verify that a new artefact from the Rule Manager has been properly ingested by the Checker.

How to test

  1. Run the Checker service according to the instructions in the readme.
  2. Visit the rules page.
  3. If there is a table with total rules per category there, including dictionary rules (probably reported as 'Typos'), this branch is working as expected.
    1. If not, run the Rule Manager service, make sure dictionary rules have been created (by hitting the api/refreshDictionary endpoint). Then check the /rules page in the Checker again.